@simplybusiness/mobius 10.1.1 → 10.2.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 +17 -0
- package/dist/cjs/components/AddressLookup/AddressLookup.js +540 -526
- package/dist/cjs/components/AddressLookup/AddressLookup.js.map +4 -4
- package/dist/cjs/components/AddressLookup/index.js +540 -526
- package/dist/cjs/components/AddressLookup/index.js.map +4 -4
- package/dist/cjs/components/Alert/Alert.js +79 -11
- package/dist/cjs/components/Alert/Alert.js.map +4 -4
- package/dist/cjs/components/Alert/index.js +79 -11
- package/dist/cjs/components/Alert/index.js.map +4 -4
- package/dist/cjs/components/Checkbox/Checkbox.js +506 -492
- package/dist/cjs/components/Checkbox/Checkbox.js.map +4 -4
- package/dist/cjs/components/Checkbox/CheckboxGroup.js +506 -492
- package/dist/cjs/components/Checkbox/CheckboxGroup.js.map +4 -4
- package/dist/cjs/components/Checkbox/index.js +485 -471
- package/dist/cjs/components/Checkbox/index.js.map +4 -4
- package/dist/cjs/components/Combobox/Combobox.js +540 -526
- package/dist/cjs/components/Combobox/Combobox.js.map +4 -4
- package/dist/cjs/components/Combobox/index.js +540 -526
- package/dist/cjs/components/Combobox/index.js.map +4 -4
- package/dist/cjs/components/DateField/DateField.js +527 -513
- package/dist/cjs/components/DateField/DateField.js.map +4 -4
- package/dist/cjs/components/DateField/index.js +527 -513
- package/dist/cjs/components/DateField/index.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js +527 -513
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/index.js +527 -513
- package/dist/cjs/components/ErrorMessage/index.js.map +4 -4
- package/dist/cjs/components/ExpandableText/ExpandableText.js +527 -513
- package/dist/cjs/components/ExpandableText/ExpandableText.js.map +4 -4
- package/dist/cjs/components/ExpandableText/index.js +527 -513
- package/dist/cjs/components/ExpandableText/index.js.map +4 -4
- package/dist/cjs/components/MaskedField/MaskedField.js +537 -523
- package/dist/cjs/components/MaskedField/MaskedField.js.map +4 -4
- package/dist/cjs/components/MaskedField/index.js +537 -523
- package/dist/cjs/components/MaskedField/index.js.map +4 -4
- package/dist/cjs/components/NumberField/NumberField.js +528 -514
- package/dist/cjs/components/NumberField/NumberField.js.map +4 -4
- package/dist/cjs/components/NumberField/index.js +528 -514
- package/dist/cjs/components/NumberField/index.js.map +4 -4
- package/dist/cjs/components/PasswordField/PasswordField.js +524 -510
- package/dist/cjs/components/PasswordField/PasswordField.js.map +4 -4
- package/dist/cjs/components/PasswordField/ShowHideButton.js +523 -509
- package/dist/cjs/components/PasswordField/ShowHideButton.js.map +4 -4
- package/dist/cjs/components/PasswordField/index.js +524 -510
- package/dist/cjs/components/PasswordField/index.js.map +4 -4
- package/dist/cjs/components/Radio/Radio.js +506 -492
- package/dist/cjs/components/Radio/Radio.js.map +4 -4
- package/dist/cjs/components/Radio/RadioGroup.js +505 -491
- package/dist/cjs/components/Radio/RadioGroup.js.map +4 -4
- package/dist/cjs/components/Radio/index.js +484 -470
- package/dist/cjs/components/Radio/index.js.map +4 -4
- package/dist/cjs/components/Select/Select.js +511 -497
- package/dist/cjs/components/Select/Select.js.map +4 -4
- package/dist/cjs/components/Select/index.js +511 -497
- package/dist/cjs/components/Select/index.js.map +4 -4
- package/dist/cjs/components/TextArea/TextArea.js +521 -507
- package/dist/cjs/components/TextArea/TextArea.js.map +4 -4
- package/dist/cjs/components/TextArea/index.js +521 -507
- package/dist/cjs/components/TextArea/index.js.map +4 -4
- package/dist/cjs/components/TextField/TextField.js +537 -523
- package/dist/cjs/components/TextField/TextField.js.map +4 -4
- package/dist/cjs/components/TextField/index.js +537 -523
- package/dist/cjs/components/TextField/index.js.map +4 -4
- package/dist/cjs/components/index.js +567 -553
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/index.js +567 -553
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/meta.json +1372 -1305
- package/dist/esm/{chunk-FTSJNY4J.js → chunk-N5WGQAHM.js} +14 -2
- package/dist/esm/chunk-N5WGQAHM.js.map +7 -0
- package/dist/esm/{chunk-C4BILMFX.js → chunk-RR4UQSOZ.js} +5 -1
- package/dist/esm/chunk-RR4UQSOZ.js.map +7 -0
- package/dist/esm/components/AddressLookup/AddressLookup.js +2 -2
- package/dist/esm/components/AddressLookup/index.js +2 -2
- package/dist/esm/components/Alert/Alert.js +4 -1
- package/dist/esm/components/Alert/index.js +4 -1
- package/dist/esm/components/Checkbox/Checkbox.js +2 -2
- package/dist/esm/components/Checkbox/CheckboxGroup.js +2 -2
- package/dist/esm/components/Checkbox/index.js +2 -2
- package/dist/esm/components/Combobox/Combobox.js +2 -2
- package/dist/esm/components/Combobox/index.js +2 -2
- package/dist/esm/components/DateField/DateField.js +2 -2
- package/dist/esm/components/DateField/index.js +2 -2
- package/dist/esm/components/ErrorMessage/ErrorMessage.js +2 -2
- package/dist/esm/components/ErrorMessage/index.js +2 -2
- package/dist/esm/components/ExpandableText/ExpandableText.js +2 -2
- package/dist/esm/components/ExpandableText/index.js +2 -2
- package/dist/esm/components/MaskedField/MaskedField.js +2 -2
- package/dist/esm/components/MaskedField/index.js +2 -2
- package/dist/esm/components/NumberField/NumberField.js +2 -2
- package/dist/esm/components/NumberField/index.js +2 -2
- package/dist/esm/components/PasswordField/PasswordField.js +2 -2
- package/dist/esm/components/PasswordField/ShowHideButton.js +2 -2
- package/dist/esm/components/PasswordField/index.js +2 -2
- package/dist/esm/components/Radio/Radio.js +2 -2
- package/dist/esm/components/Radio/RadioGroup.js +2 -2
- package/dist/esm/components/Radio/index.js +2 -2
- package/dist/esm/components/Select/Select.js +2 -2
- package/dist/esm/components/Select/index.js +2 -2
- package/dist/esm/components/TextArea/TextArea.js +2 -2
- package/dist/esm/components/TextArea/index.js +2 -2
- package/dist/esm/components/TextField/TextField.js +2 -2
- package/dist/esm/components/TextField/index.js +2 -2
- package/dist/esm/components/index.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/meta.json +164 -131
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/AddressLookup/AddressLookup.test.tsx +76 -0
- package/src/components/AddressLookup/AddressLookup.tsx +9 -0
- package/src/components/Alert/Alert.tsx +10 -1
- package/src/components/Drawer/Drawer.css +24 -3
- package/src/components/Modal/Modal.css +42 -3
- package/dist/esm/chunk-C4BILMFX.js.map +0 -7
- package/dist/esm/chunk-FTSJNY4J.js.map +0 -7
|
@@ -2255,6 +2255,10 @@ var init_AddressLookup = __esm({
|
|
|
2255
2255
|
);
|
|
2256
2256
|
const handleSelected = (selected) => {
|
|
2257
2257
|
setError(null);
|
|
2258
|
+
const isEmpty = typeof selected === "string" ? selected === "" : !selected.id && !selected.value;
|
|
2259
|
+
if (isEmpty) {
|
|
2260
|
+
return Promise.resolve();
|
|
2261
|
+
}
|
|
2258
2262
|
if (typeof selected === "string" || !selected.id) {
|
|
2259
2263
|
setError(new Error("Selected option missing id"));
|
|
2260
2264
|
return Promise.resolve();
|
|
@@ -2395,19 +2399,98 @@ var init_AddressLookup2 = __esm({
|
|
|
2395
2399
|
}
|
|
2396
2400
|
});
|
|
2397
2401
|
|
|
2402
|
+
// src/components/Text/Text.tsx
|
|
2403
|
+
var import_dedupe15, import_Text, import_jsx_runtime16, getElementType, Text;
|
|
2404
|
+
var init_Text = __esm({
|
|
2405
|
+
"src/components/Text/Text.tsx"() {
|
|
2406
|
+
"use strict";
|
|
2407
|
+
import_dedupe15 = __toESM(require("classnames/dedupe"));
|
|
2408
|
+
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
2409
|
+
import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2410
|
+
getElementType = (variant, elementType) => {
|
|
2411
|
+
if (variant) {
|
|
2412
|
+
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
2413
|
+
}
|
|
2414
|
+
return elementType || "p";
|
|
2415
|
+
};
|
|
2416
|
+
Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
2417
|
+
const { variant, className, spacing, ...otherProps } = props;
|
|
2418
|
+
const elementType = getElementType(variant, Component);
|
|
2419
|
+
const variantType = variant || elementType;
|
|
2420
|
+
const classes = (0, import_dedupe15.default)(
|
|
2421
|
+
"mobius",
|
|
2422
|
+
"mobius-text",
|
|
2423
|
+
{ [`--is-${variantType}`]: variantType },
|
|
2424
|
+
{ [`--has-line-height-${spacing}`]: spacing },
|
|
2425
|
+
className
|
|
2426
|
+
);
|
|
2427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
2428
|
+
};
|
|
2429
|
+
Text.displayName = "Text";
|
|
2430
|
+
}
|
|
2431
|
+
});
|
|
2432
|
+
|
|
2433
|
+
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
2434
|
+
var import_react15, import_jsx_runtime17, isHTML, TextOrHTML;
|
|
2435
|
+
var init_TextOrHTML = __esm({
|
|
2436
|
+
"src/components/TextOrHTML/TextOrHTML.tsx"() {
|
|
2437
|
+
"use strict";
|
|
2438
|
+
import_react15 = require("react");
|
|
2439
|
+
init_Text();
|
|
2440
|
+
import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2441
|
+
isHTML = (text) => /^\s*<[a-z]/i.test(text);
|
|
2442
|
+
TextOrHTML = ({
|
|
2443
|
+
ref,
|
|
2444
|
+
text,
|
|
2445
|
+
htmlClassName,
|
|
2446
|
+
htmlElementType,
|
|
2447
|
+
textWrapper = false,
|
|
2448
|
+
autoDetect = false,
|
|
2449
|
+
...textProps
|
|
2450
|
+
}) => {
|
|
2451
|
+
const textIsHTML = autoDetect && isHTML(text);
|
|
2452
|
+
const shouldWrapInText = autoDetect ? textWrapper || !textIsHTML : textWrapper;
|
|
2453
|
+
const resolvedElementType = htmlElementType ?? (textIsHTML ? "div" : "span");
|
|
2454
|
+
const DangerousComponent = resolvedElementType;
|
|
2455
|
+
const dangerousHTML = (0, import_react15.useMemo)(() => ({ __html: text }), [text]);
|
|
2456
|
+
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2457
|
+
DangerousComponent,
|
|
2458
|
+
{
|
|
2459
|
+
className: htmlClassName,
|
|
2460
|
+
dangerouslySetInnerHTML: dangerousHTML
|
|
2461
|
+
}
|
|
2462
|
+
);
|
|
2463
|
+
if (shouldWrapInText) {
|
|
2464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
2465
|
+
}
|
|
2466
|
+
return dangerousElement;
|
|
2467
|
+
};
|
|
2468
|
+
TextOrHTML.displayName = "TextOrHTML";
|
|
2469
|
+
}
|
|
2470
|
+
});
|
|
2471
|
+
|
|
2472
|
+
// src/components/TextOrHTML/index.tsx
|
|
2473
|
+
var init_TextOrHTML2 = __esm({
|
|
2474
|
+
"src/components/TextOrHTML/index.tsx"() {
|
|
2475
|
+
"use strict";
|
|
2476
|
+
init_TextOrHTML();
|
|
2477
|
+
}
|
|
2478
|
+
});
|
|
2479
|
+
|
|
2398
2480
|
// src/components/Alert/Alert.tsx
|
|
2399
2481
|
function isAlertVariant(value) {
|
|
2400
2482
|
return value === "info" || value === "success" || value === "warning" || value === "error";
|
|
2401
2483
|
}
|
|
2402
|
-
var import_icons4,
|
|
2484
|
+
var import_icons4, import_dedupe16, import_Alert, import_jsx_runtime18, Alert;
|
|
2403
2485
|
var init_Alert = __esm({
|
|
2404
2486
|
"src/components/Alert/Alert.tsx"() {
|
|
2405
2487
|
"use strict";
|
|
2406
2488
|
import_icons4 = require("@simplybusiness/icons");
|
|
2407
|
-
|
|
2489
|
+
import_dedupe16 = __toESM(require("classnames/dedupe"));
|
|
2408
2490
|
init_Icon2();
|
|
2491
|
+
init_TextOrHTML2();
|
|
2409
2492
|
import_Alert = require("@simplybusiness/mobius/src/components/Alert/Alert.css");
|
|
2410
|
-
|
|
2493
|
+
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2411
2494
|
Alert = ({ ref, ...props }) => {
|
|
2412
2495
|
const {
|
|
2413
2496
|
elementType: Element = "div",
|
|
@@ -2420,7 +2503,7 @@ var init_Alert = __esm({
|
|
|
2420
2503
|
if (!show) return null;
|
|
2421
2504
|
const variant = variantProp && isAlertVariant(variantProp) ? variantProp : "info";
|
|
2422
2505
|
const colorValue = variant === "success" ? `var(--color-valid)` : `var(--color-${variant})`;
|
|
2423
|
-
const classes = (0,
|
|
2506
|
+
const classes = (0, import_dedupe16.default)(
|
|
2424
2507
|
"mobius",
|
|
2425
2508
|
"mobius-alert",
|
|
2426
2509
|
{
|
|
@@ -2438,14 +2521,23 @@ var init_Alert = __esm({
|
|
|
2438
2521
|
warning: import_icons4.warning,
|
|
2439
2522
|
error: import_icons4.error
|
|
2440
2523
|
};
|
|
2441
|
-
const headerClasses = (0,
|
|
2442
|
-
const iconClasses = (0,
|
|
2443
|
-
const contentClasses = (0,
|
|
2444
|
-
return /* @__PURE__ */ (0,
|
|
2445
|
-
/* @__PURE__ */ (0,
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2447
|
-
header && /* @__PURE__ */ (0,
|
|
2448
|
-
|
|
2524
|
+
const headerClasses = (0, import_dedupe16.default)("mobius", "mobius-alert__header");
|
|
2525
|
+
const iconClasses = (0, import_dedupe16.default)("mobius", "mobius-alert__icon");
|
|
2526
|
+
const contentClasses = (0, import_dedupe16.default)("mobius", "mobius-alert__content");
|
|
2527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Element, { ref, role: "alert", ...otherProps, className: classes, children: [
|
|
2528
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { icon: icon[variant], color: colorValue }) }),
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
2530
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2531
|
+
TextOrHTML,
|
|
2532
|
+
{
|
|
2533
|
+
autoDetect: true,
|
|
2534
|
+
htmlElementType: "span",
|
|
2535
|
+
className: headerClasses,
|
|
2536
|
+
htmlClassName: headerClasses,
|
|
2537
|
+
text: header
|
|
2538
|
+
}
|
|
2539
|
+
),
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: contentClasses, children })
|
|
2449
2541
|
] })
|
|
2450
2542
|
] });
|
|
2451
2543
|
};
|
|
@@ -2462,14 +2554,14 @@ var init_Alert2 = __esm({
|
|
|
2462
2554
|
});
|
|
2463
2555
|
|
|
2464
2556
|
// src/components/Box/Box.tsx
|
|
2465
|
-
var
|
|
2557
|
+
var import_dedupe17, import_Box, import_jsx_runtime19, Box;
|
|
2466
2558
|
var init_Box = __esm({
|
|
2467
2559
|
"src/components/Box/Box.tsx"() {
|
|
2468
2560
|
"use strict";
|
|
2469
|
-
|
|
2561
|
+
import_dedupe17 = __toESM(require("classnames/dedupe"));
|
|
2470
2562
|
init_utils();
|
|
2471
2563
|
import_Box = require("@simplybusiness/mobius/src/components/Box/Box.css");
|
|
2472
|
-
|
|
2564
|
+
import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2473
2565
|
Box = ({ ref, ...props }) => {
|
|
2474
2566
|
const {
|
|
2475
2567
|
elementType: Element = "div",
|
|
@@ -2495,7 +2587,7 @@ var init_Box = __esm({
|
|
|
2495
2587
|
style,
|
|
2496
2588
|
...otherProps
|
|
2497
2589
|
} = props;
|
|
2498
|
-
const classes = (0,
|
|
2590
|
+
const classes = (0, import_dedupe17.default)("mobius", "mobius-box", otherProps.className);
|
|
2499
2591
|
const styleProps = filterUndefinedProps({
|
|
2500
2592
|
padding: getSpacingValue(padding),
|
|
2501
2593
|
paddingInline: getSpacingValue(paddingInline || paddingX),
|
|
@@ -2512,7 +2604,7 @@ var init_Box = __esm({
|
|
|
2512
2604
|
height,
|
|
2513
2605
|
...style
|
|
2514
2606
|
});
|
|
2515
|
-
return /* @__PURE__ */ (0,
|
|
2607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Element, { ref, style: styleProps, ...otherProps, className: classes });
|
|
2516
2608
|
};
|
|
2517
2609
|
Box.displayName = "Box";
|
|
2518
2610
|
}
|
|
@@ -2527,27 +2619,27 @@ var init_Box2 = __esm({
|
|
|
2527
2619
|
});
|
|
2528
2620
|
|
|
2529
2621
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
2530
|
-
var
|
|
2622
|
+
var import_react16, import_dedupe18, import_Breadcrumbs, import_jsx_runtime20, Breadcrumbs;
|
|
2531
2623
|
var init_Breadcrumbs = __esm({
|
|
2532
2624
|
"src/components/Breadcrumbs/Breadcrumbs.tsx"() {
|
|
2533
2625
|
"use strict";
|
|
2534
2626
|
"use client";
|
|
2535
|
-
|
|
2536
|
-
|
|
2627
|
+
import_react16 = require("react");
|
|
2628
|
+
import_dedupe18 = __toESM(require("classnames/dedupe"));
|
|
2537
2629
|
import_Breadcrumbs = require("@simplybusiness/mobius/src/components/Breadcrumbs/Breadcrumbs.css");
|
|
2538
|
-
|
|
2630
|
+
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2539
2631
|
Breadcrumbs = ({ ref, ...props }) => {
|
|
2540
2632
|
const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
|
|
2541
2633
|
const { navProps } = { navProps: { "aria-label": ariaLabel } };
|
|
2542
2634
|
const { children, ...otherProps } = props;
|
|
2543
|
-
const childArray =
|
|
2544
|
-
const classes = (0,
|
|
2635
|
+
const childArray = import_react16.Children.toArray(children);
|
|
2636
|
+
const classes = (0, import_dedupe18.default)(
|
|
2545
2637
|
"mobius",
|
|
2546
2638
|
"mobius-breadcrumb",
|
|
2547
2639
|
otherProps.className
|
|
2548
2640
|
);
|
|
2549
|
-
return /* @__PURE__ */ (0,
|
|
2550
|
-
(child, i) => (0,
|
|
2641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { children: childArray.map(
|
|
2642
|
+
(child, i) => (0, import_react16.cloneElement)(
|
|
2551
2643
|
child,
|
|
2552
2644
|
{
|
|
2553
2645
|
key: i,
|
|
@@ -2561,22 +2653,22 @@ var init_Breadcrumbs = __esm({
|
|
|
2561
2653
|
});
|
|
2562
2654
|
|
|
2563
2655
|
// src/components/Breadcrumbs/BreadcrumbItem.tsx
|
|
2564
|
-
var
|
|
2656
|
+
var import_react17, import_dedupe19, import_jsx_runtime21, BreadcrumbItem;
|
|
2565
2657
|
var init_BreadcrumbItem = __esm({
|
|
2566
2658
|
"src/components/Breadcrumbs/BreadcrumbItem.tsx"() {
|
|
2567
2659
|
"use strict";
|
|
2568
2660
|
"use client";
|
|
2569
|
-
|
|
2570
|
-
|
|
2661
|
+
import_react17 = require("react");
|
|
2662
|
+
import_dedupe19 = __toESM(require("classnames/dedupe"));
|
|
2571
2663
|
init_Box2();
|
|
2572
|
-
|
|
2664
|
+
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2573
2665
|
BreadcrumbItem = ({ ref, ...props }) => {
|
|
2574
2666
|
const {
|
|
2575
2667
|
isDisabled = false,
|
|
2576
2668
|
isCurrent = false,
|
|
2577
2669
|
"aria-current": ariaCurrent = "page",
|
|
2578
2670
|
children,
|
|
2579
|
-
separator = /* @__PURE__ */ (0,
|
|
2671
|
+
separator = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box, { className: "mobius-breadcrumb__separator", "aria-hidden": "true", children: ">" }),
|
|
2580
2672
|
...otherProps
|
|
2581
2673
|
} = props;
|
|
2582
2674
|
const { itemProps } = {
|
|
@@ -2586,14 +2678,14 @@ var init_BreadcrumbItem = __esm({
|
|
|
2586
2678
|
...otherProps
|
|
2587
2679
|
}
|
|
2588
2680
|
};
|
|
2589
|
-
const classes = (0,
|
|
2681
|
+
const classes = (0, import_dedupe19.default)(
|
|
2590
2682
|
"mobius",
|
|
2591
2683
|
"mobius-breadcrumb__item",
|
|
2592
2684
|
props.className
|
|
2593
2685
|
);
|
|
2594
|
-
const child = typeof children === "string" ? /* @__PURE__ */ (0,
|
|
2595
|
-
return /* @__PURE__ */ (0,
|
|
2596
|
-
(0,
|
|
2686
|
+
const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { ...itemProps, children }) : import_react17.Children.only(children);
|
|
2687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: classes, children: [
|
|
2688
|
+
(0, import_react17.cloneElement)(child, {
|
|
2597
2689
|
...child.props,
|
|
2598
2690
|
...itemProps,
|
|
2599
2691
|
ref
|
|
@@ -2615,19 +2707,19 @@ var init_Breadcrumbs2 = __esm({
|
|
|
2615
2707
|
});
|
|
2616
2708
|
|
|
2617
2709
|
// src/components/Button/Loading.tsx
|
|
2618
|
-
var import_icons5,
|
|
2710
|
+
var import_icons5, import_jsx_runtime22, Loading;
|
|
2619
2711
|
var init_Loading = __esm({
|
|
2620
2712
|
"src/components/Button/Loading.tsx"() {
|
|
2621
2713
|
"use strict";
|
|
2622
2714
|
import_icons5 = require("@simplybusiness/icons");
|
|
2623
2715
|
init_Icon2();
|
|
2624
2716
|
init_VisuallyHidden2();
|
|
2625
|
-
|
|
2717
|
+
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2626
2718
|
Loading = (props) => {
|
|
2627
2719
|
const { children } = props;
|
|
2628
|
-
return /* @__PURE__ */ (0,
|
|
2629
|
-
/* @__PURE__ */ (0,
|
|
2630
|
-
/* @__PURE__ */ (0,
|
|
2720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
2721
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { icon: import_icons5.loading, spin: true, size: "md" }) }),
|
|
2722
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VisuallyHidden, { className: "mobius-button__loading-text", children: "Loading" }),
|
|
2631
2723
|
children
|
|
2632
2724
|
] });
|
|
2633
2725
|
};
|
|
@@ -2635,33 +2727,33 @@ var init_Loading = __esm({
|
|
|
2635
2727
|
});
|
|
2636
2728
|
|
|
2637
2729
|
// src/components/Button/Success.tsx
|
|
2638
|
-
var import_icons6,
|
|
2730
|
+
var import_icons6, import_jsx_runtime23, Success;
|
|
2639
2731
|
var init_Success = __esm({
|
|
2640
2732
|
"src/components/Button/Success.tsx"() {
|
|
2641
2733
|
"use strict";
|
|
2642
2734
|
import_icons6 = require("@simplybusiness/icons");
|
|
2643
2735
|
init_Icon2();
|
|
2644
2736
|
init_VisuallyHidden2();
|
|
2645
|
-
|
|
2646
|
-
Success = () => /* @__PURE__ */ (0,
|
|
2647
|
-
/* @__PURE__ */ (0,
|
|
2648
|
-
/* @__PURE__ */ (0,
|
|
2737
|
+
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2738
|
+
Success = () => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { icon: import_icons6.tick, size: "md" }) }),
|
|
2740
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(VisuallyHidden, { className: "mobius-button__success-text", children: "Success" })
|
|
2649
2741
|
] });
|
|
2650
2742
|
}
|
|
2651
2743
|
});
|
|
2652
2744
|
|
|
2653
2745
|
// src/components/Button/Button.tsx
|
|
2654
|
-
var
|
|
2746
|
+
var import_dedupe20, import_Button, import_jsx_runtime24, Button;
|
|
2655
2747
|
var init_Button = __esm({
|
|
2656
2748
|
"src/components/Button/Button.tsx"() {
|
|
2657
2749
|
"use strict";
|
|
2658
2750
|
"use client";
|
|
2659
|
-
|
|
2751
|
+
import_dedupe20 = __toESM(require("classnames/dedupe"));
|
|
2660
2752
|
init_Loading();
|
|
2661
2753
|
init_useButton2();
|
|
2662
2754
|
init_Success();
|
|
2663
2755
|
import_Button = require("@simplybusiness/mobius/src/components/Button/Button.css");
|
|
2664
|
-
|
|
2756
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2665
2757
|
Button = ({ ref, ...props }) => {
|
|
2666
2758
|
const {
|
|
2667
2759
|
children,
|
|
@@ -2676,7 +2768,7 @@ var init_Button = __esm({
|
|
|
2676
2768
|
...otherProps
|
|
2677
2769
|
} = props;
|
|
2678
2770
|
const { buttonProps } = useButton(props);
|
|
2679
|
-
otherProps.className = (0,
|
|
2771
|
+
otherProps.className = (0, import_dedupe20.default)(
|
|
2680
2772
|
"mobius",
|
|
2681
2773
|
"mobius-button",
|
|
2682
2774
|
`--variant-${variant}`,
|
|
@@ -2688,9 +2780,9 @@ var init_Button = __esm({
|
|
|
2688
2780
|
},
|
|
2689
2781
|
otherProps.className
|
|
2690
2782
|
);
|
|
2691
|
-
return /* @__PURE__ */ (0,
|
|
2692
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2693
|
-
isSuccess && !isLoading && /* @__PURE__ */ (0,
|
|
2783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Component, { ref, ...buttonProps, ...otherProps, children: [
|
|
2784
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Loading, { children }) : children,
|
|
2785
|
+
isSuccess && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Success, {})
|
|
2694
2786
|
] });
|
|
2695
2787
|
};
|
|
2696
2788
|
Button.displayName = "Button";
|
|
@@ -2706,13 +2798,13 @@ var init_Button2 = __esm({
|
|
|
2706
2798
|
});
|
|
2707
2799
|
|
|
2708
2800
|
// src/components/Checkbox/Checkbox.tsx
|
|
2709
|
-
var
|
|
2801
|
+
var import_react18, import_dedupe21, import_icons7, import_Checkbox, import_jsx_runtime25, Checkbox;
|
|
2710
2802
|
var init_Checkbox = __esm({
|
|
2711
2803
|
"src/components/Checkbox/Checkbox.tsx"() {
|
|
2712
2804
|
"use strict";
|
|
2713
2805
|
"use client";
|
|
2714
|
-
|
|
2715
|
-
|
|
2806
|
+
import_react18 = require("react");
|
|
2807
|
+
import_dedupe21 = __toESM(require("classnames/dedupe"));
|
|
2716
2808
|
import_icons7 = require("@simplybusiness/icons");
|
|
2717
2809
|
init_ErrorMessage2();
|
|
2718
2810
|
init_spaceDelimitedList();
|
|
@@ -2720,7 +2812,7 @@ var init_Checkbox = __esm({
|
|
|
2720
2812
|
init_Icon2();
|
|
2721
2813
|
init_Stack2();
|
|
2722
2814
|
import_Checkbox = require("@simplybusiness/mobius/src/components/Checkbox/Checkbox.css");
|
|
2723
|
-
|
|
2815
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2724
2816
|
Checkbox = ({ ref, ...props }) => {
|
|
2725
2817
|
const {
|
|
2726
2818
|
id,
|
|
@@ -2740,18 +2832,18 @@ var init_Checkbox = __esm({
|
|
|
2740
2832
|
["aria-describedby"]: ariaDescribedBy,
|
|
2741
2833
|
...rest
|
|
2742
2834
|
} = props;
|
|
2743
|
-
const [checked, setChecked] = (0,
|
|
2744
|
-
const fallbackRef = (0,
|
|
2835
|
+
const [checked, setChecked] = (0, import_react18.useState)(defaultSelected);
|
|
2836
|
+
const fallbackRef = (0, import_react18.useRef)(null);
|
|
2745
2837
|
const refObj = ref || fallbackRef;
|
|
2746
|
-
const inputId = (0,
|
|
2838
|
+
const inputId = (0, import_react18.useId)();
|
|
2747
2839
|
const isControlled = typeof selected === "boolean";
|
|
2748
|
-
(0,
|
|
2840
|
+
(0, import_react18.useEffect)(() => {
|
|
2749
2841
|
if (isControlled) {
|
|
2750
2842
|
setChecked(selected);
|
|
2751
2843
|
}
|
|
2752
2844
|
}, [selected, isControlled]);
|
|
2753
2845
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2754
|
-
const sharedClasses = (0,
|
|
2846
|
+
const sharedClasses = (0, import_dedupe21.default)(
|
|
2755
2847
|
{
|
|
2756
2848
|
"--is-disabled": isDisabled,
|
|
2757
2849
|
"--is-selected": checked,
|
|
@@ -2760,31 +2852,31 @@ var init_Checkbox = __esm({
|
|
|
2760
2852
|
},
|
|
2761
2853
|
validationClasses
|
|
2762
2854
|
);
|
|
2763
|
-
const wrapperClasses = (0,
|
|
2855
|
+
const wrapperClasses = (0, import_dedupe21.default)(
|
|
2764
2856
|
"mobius",
|
|
2765
2857
|
"mobius-checkbox",
|
|
2766
2858
|
sharedClasses,
|
|
2767
2859
|
className
|
|
2768
2860
|
);
|
|
2769
|
-
const labelClasses = (0,
|
|
2770
|
-
const inputClasses = (0,
|
|
2771
|
-
const iconClasses = (0,
|
|
2772
|
-
const errorMessageId = (0,
|
|
2861
|
+
const labelClasses = (0, import_dedupe21.default)("mobius-checkbox__label", sharedClasses);
|
|
2862
|
+
const inputClasses = (0, import_dedupe21.default)("mobius-checkbox__input", sharedClasses);
|
|
2863
|
+
const iconClasses = (0, import_dedupe21.default)("mobius-checkbox__icon", sharedClasses);
|
|
2864
|
+
const errorMessageId = (0, import_react18.useId)();
|
|
2773
2865
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2774
2866
|
const describedBy = spaceDelimitedList([
|
|
2775
2867
|
shouldErrorMessageShow,
|
|
2776
2868
|
ariaDescribedBy
|
|
2777
2869
|
]);
|
|
2778
|
-
const labelId = (0,
|
|
2870
|
+
const labelId = (0, import_react18.useId)();
|
|
2779
2871
|
const handleChange = (event) => {
|
|
2780
2872
|
setChecked(!checked);
|
|
2781
2873
|
if (onChange) {
|
|
2782
2874
|
onChange(event, isLastItem);
|
|
2783
2875
|
}
|
|
2784
2876
|
};
|
|
2785
|
-
return /* @__PURE__ */ (0,
|
|
2786
|
-
/* @__PURE__ */ (0,
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
2877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Stack, { gap: "xs", className: wrapperClasses, children: [
|
|
2878
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: labelClasses, children: [
|
|
2879
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2788
2880
|
"input",
|
|
2789
2881
|
{
|
|
2790
2882
|
"aria-describedby": describedBy,
|
|
@@ -2805,7 +2897,7 @@ var init_Checkbox = __esm({
|
|
|
2805
2897
|
...rest
|
|
2806
2898
|
}
|
|
2807
2899
|
),
|
|
2808
|
-
/* @__PURE__ */ (0,
|
|
2900
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2809
2901
|
Icon,
|
|
2810
2902
|
{
|
|
2811
2903
|
icon: checked ? import_icons7.squareTick : import_icons7.square,
|
|
@@ -2813,9 +2905,9 @@ var init_Checkbox = __esm({
|
|
|
2813
2905
|
className: iconClasses
|
|
2814
2906
|
}
|
|
2815
2907
|
),
|
|
2816
|
-
/* @__PURE__ */ (0,
|
|
2908
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { id: labelId, className: "mobius-checkbox__visible-label", children: label })
|
|
2817
2909
|
] }),
|
|
2818
|
-
/* @__PURE__ */ (0,
|
|
2910
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2819
2911
|
] });
|
|
2820
2912
|
};
|
|
2821
2913
|
Checkbox.displayName = "Checkbox";
|
|
@@ -2823,20 +2915,20 @@ var init_Checkbox = __esm({
|
|
|
2823
2915
|
});
|
|
2824
2916
|
|
|
2825
2917
|
// src/components/Checkbox/CheckboxGroup.tsx
|
|
2826
|
-
var
|
|
2918
|
+
var import_dedupe22, import_react19, import_CheckboxGroup, import_jsx_runtime26, CheckboxGroup;
|
|
2827
2919
|
var init_CheckboxGroup = __esm({
|
|
2828
2920
|
"src/components/Checkbox/CheckboxGroup.tsx"() {
|
|
2829
2921
|
"use strict";
|
|
2830
2922
|
"use client";
|
|
2831
|
-
|
|
2832
|
-
|
|
2923
|
+
import_dedupe22 = __toESM(require("classnames/dedupe"));
|
|
2924
|
+
import_react19 = require("react");
|
|
2833
2925
|
init_hooks();
|
|
2834
2926
|
init_spaceDelimitedList();
|
|
2835
2927
|
init_ErrorMessage2();
|
|
2836
2928
|
init_Label2();
|
|
2837
2929
|
init_Checkbox();
|
|
2838
2930
|
import_CheckboxGroup = require("@simplybusiness/mobius/src/components/Checkbox/CheckboxGroup.css");
|
|
2839
|
-
|
|
2931
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2840
2932
|
CheckboxGroup = ({ ref, ...props }) => {
|
|
2841
2933
|
const {
|
|
2842
2934
|
label,
|
|
@@ -2854,10 +2946,10 @@ var init_CheckboxGroup = __esm({
|
|
|
2854
2946
|
lastItemDisables = false,
|
|
2855
2947
|
...rest
|
|
2856
2948
|
} = props;
|
|
2857
|
-
const [selected, setSelected] = (0,
|
|
2858
|
-
const isInitializedRef = (0,
|
|
2859
|
-
const prevDefaultValueRef = (0,
|
|
2860
|
-
(0,
|
|
2949
|
+
const [selected, setSelected] = (0, import_react19.useState)(defaultValue);
|
|
2950
|
+
const isInitializedRef = (0, import_react19.useRef)(false);
|
|
2951
|
+
const prevDefaultValueRef = (0, import_react19.useRef)(defaultValue);
|
|
2952
|
+
(0, import_react19.useEffect)(() => {
|
|
2861
2953
|
const hasChanged = defaultValue.length !== prevDefaultValueRef.current.length || defaultValue.some(
|
|
2862
2954
|
(val, index) => val !== prevDefaultValueRef.current[index]
|
|
2863
2955
|
);
|
|
@@ -2867,7 +2959,7 @@ var init_CheckboxGroup = __esm({
|
|
|
2867
2959
|
isInitializedRef.current = true;
|
|
2868
2960
|
}
|
|
2869
2961
|
}, [defaultValue]);
|
|
2870
|
-
const checkboxGroupClasses = (0,
|
|
2962
|
+
const checkboxGroupClasses = (0, import_dedupe22.default)(
|
|
2871
2963
|
"mobius",
|
|
2872
2964
|
"mobius-checkbox-group",
|
|
2873
2965
|
className,
|
|
@@ -2879,19 +2971,19 @@ var init_CheckboxGroup = __esm({
|
|
|
2879
2971
|
}
|
|
2880
2972
|
);
|
|
2881
2973
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2882
|
-
const labelClasses = (0,
|
|
2974
|
+
const labelClasses = (0, import_dedupe22.default)(
|
|
2883
2975
|
{
|
|
2884
2976
|
"--is-disabled": isDisabled
|
|
2885
2977
|
},
|
|
2886
2978
|
validationClasses
|
|
2887
2979
|
);
|
|
2888
|
-
const errorMessageId = (0,
|
|
2980
|
+
const errorMessageId = (0, import_react19.useId)();
|
|
2889
2981
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2890
2982
|
const describedBy = spaceDelimitedList([
|
|
2891
2983
|
shouldErrorMessageShow,
|
|
2892
2984
|
props["aria-describedby"]
|
|
2893
2985
|
]);
|
|
2894
|
-
const labelId = (0,
|
|
2986
|
+
const labelId = (0, import_react19.useId)();
|
|
2895
2987
|
const handleChange = (event, isLastItem = false) => {
|
|
2896
2988
|
const {
|
|
2897
2989
|
target: { value, checked }
|
|
@@ -2909,12 +3001,12 @@ var init_CheckboxGroup = __esm({
|
|
|
2909
3001
|
setSelected(newValue);
|
|
2910
3002
|
onChange?.(newValue);
|
|
2911
3003
|
};
|
|
2912
|
-
const childrenArray =
|
|
3004
|
+
const childrenArray = import_react19.Children.toArray(children);
|
|
2913
3005
|
const lastCheckbox = childrenArray.filter(
|
|
2914
|
-
(child) => (0,
|
|
3006
|
+
(child) => (0, import_react19.isValidElement)(child) && child.type === Checkbox
|
|
2915
3007
|
).pop();
|
|
2916
3008
|
const lastCheckboxIsChecked = lastCheckbox && selected.includes(lastCheckbox.props.value);
|
|
2917
|
-
return /* @__PURE__ */ (0,
|
|
3009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2918
3010
|
"div",
|
|
2919
3011
|
{
|
|
2920
3012
|
...rest,
|
|
@@ -2923,16 +3015,16 @@ var init_CheckboxGroup = __esm({
|
|
|
2923
3015
|
className: checkboxGroupClasses,
|
|
2924
3016
|
role: "group",
|
|
2925
3017
|
style: {
|
|
2926
|
-
"--checkbox-items-per-row": itemsPerRow ||
|
|
3018
|
+
"--checkbox-items-per-row": itemsPerRow || import_react19.Children.count(children)
|
|
2927
3019
|
},
|
|
2928
3020
|
children: [
|
|
2929
|
-
label && /* @__PURE__ */ (0,
|
|
2930
|
-
/* @__PURE__ */ (0,
|
|
2931
|
-
if ((0,
|
|
3021
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Label, { elementType: "span", id: labelId, className: labelClasses, children: label }),
|
|
3022
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mobius-checkbox-group__wrapper", children: childrenArray.map((child) => {
|
|
3023
|
+
if ((0, import_react19.isValidElement)(child)) {
|
|
2932
3024
|
const isLastItem = child === lastCheckbox;
|
|
2933
3025
|
const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
|
|
2934
3026
|
const childProps = child.props;
|
|
2935
|
-
return (0,
|
|
3027
|
+
return (0, import_react19.cloneElement)(
|
|
2936
3028
|
child,
|
|
2937
3029
|
{
|
|
2938
3030
|
isDisabled: isChildDisabled,
|
|
@@ -2948,7 +3040,7 @@ var init_CheckboxGroup = __esm({
|
|
|
2948
3040
|
}
|
|
2949
3041
|
return child;
|
|
2950
3042
|
}) }),
|
|
2951
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
3043
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2952
3044
|
]
|
|
2953
3045
|
}
|
|
2954
3046
|
);
|
|
@@ -2975,23 +3067,23 @@ var init_Checkbox2 = __esm({
|
|
|
2975
3067
|
});
|
|
2976
3068
|
|
|
2977
3069
|
// src/components/Container/Container.tsx
|
|
2978
|
-
var
|
|
3070
|
+
var import_dedupe23, import_Container, import_jsx_runtime27, Container;
|
|
2979
3071
|
var init_Container = __esm({
|
|
2980
3072
|
"src/components/Container/Container.tsx"() {
|
|
2981
3073
|
"use strict";
|
|
2982
|
-
|
|
3074
|
+
import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
2983
3075
|
init_utils();
|
|
2984
3076
|
import_Container = require("@simplybusiness/mobius/src/components/Container/Container.css");
|
|
2985
|
-
|
|
3077
|
+
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2986
3078
|
Container = ({ ref, ...props }) => {
|
|
2987
3079
|
const { elementType: Element = "div", size = "md", ...otherProps } = props;
|
|
2988
|
-
const classes = (0,
|
|
3080
|
+
const classes = (0, import_dedupe23.default)(
|
|
2989
3081
|
"mobius",
|
|
2990
3082
|
"mobius-container",
|
|
2991
3083
|
sizeClasses(size),
|
|
2992
3084
|
otherProps.className
|
|
2993
3085
|
);
|
|
2994
|
-
return /* @__PURE__ */ (0,
|
|
3086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
2995
3087
|
};
|
|
2996
3088
|
Container.displayName = "Container";
|
|
2997
3089
|
}
|
|
@@ -3044,17 +3136,17 @@ var init_validation = __esm({
|
|
|
3044
3136
|
});
|
|
3045
3137
|
|
|
3046
3138
|
// src/components/DateField/DateField.tsx
|
|
3047
|
-
var
|
|
3139
|
+
var import_dedupe24, import_react20, import_jsx_runtime28, MIN_MAX_ERROR, DateField;
|
|
3048
3140
|
var init_DateField = __esm({
|
|
3049
3141
|
"src/components/DateField/DateField.tsx"() {
|
|
3050
3142
|
"use strict";
|
|
3051
3143
|
"use client";
|
|
3052
|
-
|
|
3053
|
-
|
|
3144
|
+
import_dedupe24 = __toESM(require("classnames/dedupe"));
|
|
3145
|
+
import_react20 = require("react");
|
|
3054
3146
|
init_mergeRefs();
|
|
3055
3147
|
init_TextField2();
|
|
3056
3148
|
init_validation();
|
|
3057
|
-
|
|
3149
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3058
3150
|
MIN_MAX_ERROR = '"min" value should not be greater than "max" value.';
|
|
3059
3151
|
DateField = ({ ref, ...props }) => {
|
|
3060
3152
|
const {
|
|
@@ -3067,10 +3159,10 @@ var init_DateField = __esm({
|
|
|
3067
3159
|
value,
|
|
3068
3160
|
...otherProps
|
|
3069
3161
|
} = props;
|
|
3070
|
-
const [error3, setError] = (0,
|
|
3071
|
-
const [isInvalid, setIsInvalid] = (0,
|
|
3072
|
-
const localRef = (0,
|
|
3073
|
-
const classes = (0,
|
|
3162
|
+
const [error3, setError] = (0, import_react20.useState)(errorMessage);
|
|
3163
|
+
const [isInvalid, setIsInvalid] = (0, import_react20.useState)(void 0);
|
|
3164
|
+
const localRef = (0, import_react20.useRef)(null);
|
|
3165
|
+
const classes = (0, import_dedupe24.default)("mobius-date-field", className);
|
|
3074
3166
|
const formattedMin = min ? convertToDateFormat(min, format) : void 0;
|
|
3075
3167
|
const formattedMax = max ? convertToDateFormat(max, format) : void 0;
|
|
3076
3168
|
const formattedDefaultValue = defaultValue ? convertToDateFormat(defaultValue, format) : void 0;
|
|
@@ -3083,7 +3175,7 @@ var init_DateField = __esm({
|
|
|
3083
3175
|
setError(props.errorMessage);
|
|
3084
3176
|
setIsInvalid(false);
|
|
3085
3177
|
};
|
|
3086
|
-
(0,
|
|
3178
|
+
(0, import_react20.useEffect)(() => {
|
|
3087
3179
|
if (!isValidDate(min, format)) {
|
|
3088
3180
|
setInvalidState(`Invalid min date: ${min}`);
|
|
3089
3181
|
return;
|
|
@@ -3116,7 +3208,7 @@ var init_DateField = __esm({
|
|
|
3116
3208
|
validate();
|
|
3117
3209
|
otherProps.onBlur?.(event);
|
|
3118
3210
|
};
|
|
3119
|
-
return /* @__PURE__ */ (0,
|
|
3211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3120
3212
|
TextField,
|
|
3121
3213
|
{
|
|
3122
3214
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -3147,23 +3239,23 @@ var init_DateField2 = __esm({
|
|
|
3147
3239
|
});
|
|
3148
3240
|
|
|
3149
3241
|
// src/components/Drawer/Content.tsx
|
|
3150
|
-
var
|
|
3242
|
+
var import_jsx_runtime29, Content;
|
|
3151
3243
|
var init_Content = __esm({
|
|
3152
3244
|
"src/components/Drawer/Content.tsx"() {
|
|
3153
3245
|
"use strict";
|
|
3154
|
-
|
|
3155
|
-
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
3246
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3247
|
+
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { ref, ...otherProps, className: "mobius-drawer__content", children });
|
|
3156
3248
|
Content.displayName = "Content";
|
|
3157
3249
|
}
|
|
3158
3250
|
});
|
|
3159
3251
|
|
|
3160
3252
|
// src/components/Drawer/DrawerContext.tsx
|
|
3161
|
-
var
|
|
3253
|
+
var import_react21, DrawerContext;
|
|
3162
3254
|
var init_DrawerContext = __esm({
|
|
3163
3255
|
"src/components/Drawer/DrawerContext.tsx"() {
|
|
3164
3256
|
"use strict";
|
|
3165
|
-
|
|
3166
|
-
DrawerContext = (0,
|
|
3257
|
+
import_react21 = require("react");
|
|
3258
|
+
DrawerContext = (0, import_react21.createContext)({
|
|
3167
3259
|
onClose: () => {
|
|
3168
3260
|
},
|
|
3169
3261
|
closeLabel: void 0,
|
|
@@ -3173,19 +3265,19 @@ var init_DrawerContext = __esm({
|
|
|
3173
3265
|
});
|
|
3174
3266
|
|
|
3175
3267
|
// src/components/Drawer/Drawer.tsx
|
|
3176
|
-
var
|
|
3268
|
+
var import_dedupe25, import_react22, import_Drawer, import_jsx_runtime30, TRANSITION_CSS_VARIABLE, Drawer;
|
|
3177
3269
|
var init_Drawer = __esm({
|
|
3178
3270
|
"src/components/Drawer/Drawer.tsx"() {
|
|
3179
3271
|
"use strict";
|
|
3180
3272
|
"use client";
|
|
3181
|
-
|
|
3182
|
-
|
|
3273
|
+
import_dedupe25 = __toESM(require("classnames/dedupe"));
|
|
3274
|
+
import_react22 = require("react");
|
|
3183
3275
|
init_hooks();
|
|
3184
3276
|
init_utils();
|
|
3185
3277
|
init_VisuallyHidden2();
|
|
3186
3278
|
init_DrawerContext();
|
|
3187
3279
|
import_Drawer = require("@simplybusiness/mobius/src/components/Drawer/Drawer.css");
|
|
3188
|
-
|
|
3280
|
+
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3189
3281
|
TRANSITION_CSS_VARIABLE = "--drawer-transition-duration";
|
|
3190
3282
|
Drawer = ({ ref, ...props }) => {
|
|
3191
3283
|
const {
|
|
@@ -3198,8 +3290,8 @@ var init_Drawer = __esm({
|
|
|
3198
3290
|
onClose,
|
|
3199
3291
|
children
|
|
3200
3292
|
} = props;
|
|
3201
|
-
const dialogRef = (0,
|
|
3202
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3293
|
+
const dialogRef = (0, import_react22.useRef)(null);
|
|
3294
|
+
const [shouldTransition, setShouldTransition] = (0, import_react22.useState)(false);
|
|
3203
3295
|
const { close } = useDialog({
|
|
3204
3296
|
ref: dialogRef,
|
|
3205
3297
|
isOpen,
|
|
@@ -3210,9 +3302,9 @@ var init_Drawer = __esm({
|
|
|
3210
3302
|
CSSVariable: TRANSITION_CSS_VARIABLE
|
|
3211
3303
|
}
|
|
3212
3304
|
});
|
|
3213
|
-
const hiddenId = `dialog-screen-reader-announce-${(0,
|
|
3214
|
-
const headerId = `dialog-header-${(0,
|
|
3215
|
-
const dialogClasses = (0,
|
|
3305
|
+
const hiddenId = `dialog-screen-reader-announce-${(0, import_react22.useId)()}`;
|
|
3306
|
+
const headerId = `dialog-header-${(0, import_react22.useId)()}`;
|
|
3307
|
+
const dialogClasses = (0, import_dedupe25.default)(
|
|
3216
3308
|
"mobius",
|
|
3217
3309
|
"mobius-drawer",
|
|
3218
3310
|
`--${direction}`,
|
|
@@ -3221,10 +3313,10 @@ var init_Drawer = __esm({
|
|
|
3221
3313
|
"--should-transition": shouldTransition
|
|
3222
3314
|
}
|
|
3223
3315
|
);
|
|
3224
|
-
(0,
|
|
3316
|
+
(0, import_react22.useEffect)(() => {
|
|
3225
3317
|
setShouldTransition(supportsDialog());
|
|
3226
3318
|
}, []);
|
|
3227
|
-
const contextValue = (0,
|
|
3319
|
+
const contextValue = (0, import_react22.useMemo)(
|
|
3228
3320
|
() => ({
|
|
3229
3321
|
onClose: close,
|
|
3230
3322
|
closeLabel,
|
|
@@ -3232,18 +3324,18 @@ var init_Drawer = __esm({
|
|
|
3232
3324
|
}),
|
|
3233
3325
|
[close, closeLabel, headerId]
|
|
3234
3326
|
);
|
|
3235
|
-
return /* @__PURE__ */ (0,
|
|
3327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3236
3328
|
"dialog",
|
|
3237
3329
|
{
|
|
3238
|
-
id: (0,
|
|
3330
|
+
id: (0, import_react22.useId)(),
|
|
3239
3331
|
ref: mergeRefs([dialogRef, ref]),
|
|
3240
3332
|
onCancel: close,
|
|
3241
3333
|
className: dialogClasses,
|
|
3242
3334
|
"aria-describedby": hiddenId,
|
|
3243
3335
|
"aria-labelledby": headerId,
|
|
3244
3336
|
children: [
|
|
3245
|
-
/* @__PURE__ */ (0,
|
|
3246
|
-
/* @__PURE__ */ (0,
|
|
3337
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { id: hiddenId, children: announce }) }),
|
|
3338
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DrawerContext.Provider, { value: contextValue, children })
|
|
3247
3339
|
]
|
|
3248
3340
|
}
|
|
3249
3341
|
);
|
|
@@ -3253,21 +3345,21 @@ var init_Drawer = __esm({
|
|
|
3253
3345
|
});
|
|
3254
3346
|
|
|
3255
3347
|
// src/components/Drawer/useDrawer.ts
|
|
3256
|
-
var
|
|
3348
|
+
var import_react23, useDrawer;
|
|
3257
3349
|
var init_useDrawer = __esm({
|
|
3258
3350
|
"src/components/Drawer/useDrawer.ts"() {
|
|
3259
3351
|
"use strict";
|
|
3260
|
-
|
|
3352
|
+
import_react23 = require("react");
|
|
3261
3353
|
init_DrawerContext();
|
|
3262
3354
|
useDrawer = () => {
|
|
3263
|
-
const { onClose, closeLabel, headerId } = (0,
|
|
3355
|
+
const { onClose, closeLabel, headerId } = (0, import_react23.useContext)(DrawerContext);
|
|
3264
3356
|
return { onClose, closeLabel, headerId };
|
|
3265
3357
|
};
|
|
3266
3358
|
}
|
|
3267
3359
|
});
|
|
3268
3360
|
|
|
3269
3361
|
// src/components/Drawer/Header.tsx
|
|
3270
|
-
var import_icons8,
|
|
3362
|
+
var import_icons8, import_jsx_runtime31, Header;
|
|
3271
3363
|
var init_Header = __esm({
|
|
3272
3364
|
"src/components/Drawer/Header.tsx"() {
|
|
3273
3365
|
"use strict";
|
|
@@ -3275,12 +3367,12 @@ var init_Header = __esm({
|
|
|
3275
3367
|
init_Button2();
|
|
3276
3368
|
init_Icon2();
|
|
3277
3369
|
init_useDrawer();
|
|
3278
|
-
|
|
3370
|
+
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3279
3371
|
Header = ({ ref, children, ...otherProps }) => {
|
|
3280
3372
|
const { onClose, closeLabel, headerId } = useDrawer();
|
|
3281
|
-
return /* @__PURE__ */ (0,
|
|
3282
|
-
/* @__PURE__ */ (0,
|
|
3283
|
-
/* @__PURE__ */ (0,
|
|
3373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("header", { ref, ...otherProps, className: "mobius-drawer__header", children: [
|
|
3374
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", { id: headerId, children }),
|
|
3375
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3284
3376
|
Button,
|
|
3285
3377
|
{
|
|
3286
3378
|
"aria-label": "Close",
|
|
@@ -3289,7 +3381,7 @@ var init_Header = __esm({
|
|
|
3289
3381
|
className: "mobius-drawer__close",
|
|
3290
3382
|
size: "sm",
|
|
3291
3383
|
children: [
|
|
3292
|
-
/* @__PURE__ */ (0,
|
|
3384
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { icon: import_icons8.cross }),
|
|
3293
3385
|
" ",
|
|
3294
3386
|
closeLabel
|
|
3295
3387
|
]
|
|
@@ -3319,17 +3411,17 @@ var init_Drawer2 = __esm({
|
|
|
3319
3411
|
});
|
|
3320
3412
|
|
|
3321
3413
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
3322
|
-
var
|
|
3414
|
+
var import_react24, import_react_accessible_dropdown_menu_hook, import_dedupe26, import_DropdownMenu, import_jsx_runtime32, DropdownMenu;
|
|
3323
3415
|
var init_DropdownMenu = __esm({
|
|
3324
3416
|
"src/components/DropdownMenu/DropdownMenu.tsx"() {
|
|
3325
3417
|
"use strict";
|
|
3326
3418
|
"use client";
|
|
3327
|
-
|
|
3419
|
+
import_react24 = require("react");
|
|
3328
3420
|
import_react_accessible_dropdown_menu_hook = __toESM(require("react-accessible-dropdown-menu-hook"));
|
|
3329
|
-
|
|
3421
|
+
import_dedupe26 = __toESM(require("classnames/dedupe"));
|
|
3330
3422
|
init_Button2();
|
|
3331
3423
|
import_DropdownMenu = require("@simplybusiness/mobius/src/components/DropdownMenu/DropdownMenu.css");
|
|
3332
|
-
|
|
3424
|
+
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3333
3425
|
DropdownMenu = ({ ref, ...props }) => {
|
|
3334
3426
|
const {
|
|
3335
3427
|
elementType: Element = "nav",
|
|
@@ -3338,21 +3430,21 @@ var init_DropdownMenu = __esm({
|
|
|
3338
3430
|
children,
|
|
3339
3431
|
...otherProps
|
|
3340
3432
|
} = props;
|
|
3341
|
-
const [activeId, setActiveId] = (0,
|
|
3342
|
-
const numberOfItems =
|
|
3433
|
+
const [activeId, setActiveId] = (0, import_react24.useState)(null);
|
|
3434
|
+
const numberOfItems = import_react24.Children.count(children);
|
|
3343
3435
|
const {
|
|
3344
3436
|
buttonProps,
|
|
3345
3437
|
itemProps,
|
|
3346
3438
|
isOpen: open,
|
|
3347
3439
|
setIsOpen
|
|
3348
3440
|
} = (0, import_react_accessible_dropdown_menu_hook.default)(numberOfItems);
|
|
3349
|
-
const classes = (0,
|
|
3441
|
+
const classes = (0, import_dedupe26.default)(
|
|
3350
3442
|
"mobius",
|
|
3351
3443
|
"mobius-dropdown-menu",
|
|
3352
3444
|
otherProps.className
|
|
3353
3445
|
);
|
|
3354
|
-
const triggerClasses = (0,
|
|
3355
|
-
const listClasses = (0,
|
|
3446
|
+
const triggerClasses = (0, import_dedupe26.default)("mobius", "mobius-dropdown-menu__trigger");
|
|
3447
|
+
const listClasses = (0, import_dedupe26.default)("mobius", "mobius-dropdown-menu__list", {
|
|
3356
3448
|
"--is-open": open
|
|
3357
3449
|
});
|
|
3358
3450
|
const handleChildClick = ({ onClick }, index) => {
|
|
@@ -3362,16 +3454,16 @@ var init_DropdownMenu = __esm({
|
|
|
3362
3454
|
onClick();
|
|
3363
3455
|
}
|
|
3364
3456
|
};
|
|
3365
|
-
return /* @__PURE__ */ (0,
|
|
3366
|
-
trigger ? (0,
|
|
3457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Element, { ref, ...otherProps, className: classes, children: [
|
|
3458
|
+
trigger ? (0, import_react24.cloneElement)(trigger, {
|
|
3367
3459
|
className: triggerClasses,
|
|
3368
3460
|
open,
|
|
3369
3461
|
label,
|
|
3370
3462
|
...buttonProps
|
|
3371
|
-
}) : /* @__PURE__ */ (0,
|
|
3372
|
-
/* @__PURE__ */ (0,
|
|
3373
|
-
if ((0,
|
|
3374
|
-
return (0,
|
|
3463
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
3464
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: listClasses, role: "menu", children: import_react24.Children.map(children, (child, index) => {
|
|
3465
|
+
if ((0, import_react24.isValidElement)(child)) {
|
|
3466
|
+
return (0, import_react24.cloneElement)(child, {
|
|
3375
3467
|
onClick: () => handleChildClick(child.props, index),
|
|
3376
3468
|
active: index === activeId,
|
|
3377
3469
|
...itemProps[index]
|
|
@@ -3386,13 +3478,13 @@ var init_DropdownMenu = __esm({
|
|
|
3386
3478
|
});
|
|
3387
3479
|
|
|
3388
3480
|
// src/components/DropdownMenu/Item.tsx
|
|
3389
|
-
var
|
|
3481
|
+
var import_react25, import_dedupe27, import_jsx_runtime33, Item;
|
|
3390
3482
|
var init_Item = __esm({
|
|
3391
3483
|
"src/components/DropdownMenu/Item.tsx"() {
|
|
3392
3484
|
"use strict";
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3485
|
+
import_react25 = require("react");
|
|
3486
|
+
import_dedupe27 = __toESM(require("classnames/dedupe"));
|
|
3487
|
+
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3396
3488
|
Item = ({ ref, ...props }) => {
|
|
3397
3489
|
const {
|
|
3398
3490
|
elementType: Element = "li",
|
|
@@ -3401,26 +3493,26 @@ var init_Item = __esm({
|
|
|
3401
3493
|
children,
|
|
3402
3494
|
...otherProps
|
|
3403
3495
|
} = props;
|
|
3404
|
-
const classes = (0,
|
|
3496
|
+
const classes = (0, import_dedupe27.default)(
|
|
3405
3497
|
"mobius",
|
|
3406
3498
|
"mobius-dropdown-menu__item",
|
|
3407
3499
|
{ "--is-active": active },
|
|
3408
3500
|
otherProps.className
|
|
3409
3501
|
);
|
|
3410
|
-
return /* @__PURE__ */ (0,
|
|
3411
|
-
if ((0,
|
|
3412
|
-
const childClasses = (0,
|
|
3502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Element, { ref, onClick, ...otherProps, children: import_react25.Children.map(children, (child) => {
|
|
3503
|
+
if ((0, import_react25.isValidElement)(child)) {
|
|
3504
|
+
const childClasses = (0, import_dedupe27.default)(
|
|
3413
3505
|
child.props.className,
|
|
3414
3506
|
classes
|
|
3415
3507
|
);
|
|
3416
|
-
return (0,
|
|
3508
|
+
return (0, import_react25.cloneElement)(
|
|
3417
3509
|
child,
|
|
3418
3510
|
{
|
|
3419
3511
|
className: childClasses
|
|
3420
3512
|
}
|
|
3421
3513
|
);
|
|
3422
3514
|
}
|
|
3423
|
-
return /* @__PURE__ */ (0,
|
|
3515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: classes, children: child });
|
|
3424
3516
|
}) });
|
|
3425
3517
|
};
|
|
3426
3518
|
Item.displayName = "DropdownMenu.Item";
|
|
@@ -3445,23 +3537,23 @@ var init_DropdownMenu2 = __esm({
|
|
|
3445
3537
|
});
|
|
3446
3538
|
|
|
3447
3539
|
// src/components/Fieldset/Fieldset.tsx
|
|
3448
|
-
var
|
|
3540
|
+
var import_dedupe28, import_react26, import_Fieldset, import_jsx_runtime34, useFieldset, Fieldset;
|
|
3449
3541
|
var init_Fieldset = __esm({
|
|
3450
3542
|
"src/components/Fieldset/Fieldset.tsx"() {
|
|
3451
3543
|
"use strict";
|
|
3452
3544
|
"use client";
|
|
3453
|
-
|
|
3454
|
-
|
|
3545
|
+
import_dedupe28 = __toESM(require("classnames/dedupe"));
|
|
3546
|
+
import_react26 = require("react");
|
|
3455
3547
|
init_Flex2();
|
|
3456
3548
|
import_Fieldset = require("@simplybusiness/mobius/src/components/Fieldset/Fieldset.css");
|
|
3457
|
-
|
|
3549
|
+
import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3458
3550
|
useFieldset = (props) => {
|
|
3459
3551
|
const { legend } = props;
|
|
3460
3552
|
let legendProps = {};
|
|
3461
3553
|
let containerProps = {
|
|
3462
3554
|
role: "group"
|
|
3463
3555
|
};
|
|
3464
|
-
const legendId = (0,
|
|
3556
|
+
const legendId = (0, import_react26.useId)();
|
|
3465
3557
|
if (legend) {
|
|
3466
3558
|
legendProps = {
|
|
3467
3559
|
...legendProps,
|
|
@@ -3481,14 +3573,14 @@ var init_Fieldset = __esm({
|
|
|
3481
3573
|
const {
|
|
3482
3574
|
children,
|
|
3483
3575
|
legend,
|
|
3484
|
-
legendComponent = /* @__PURE__ */ (0,
|
|
3576
|
+
legendComponent = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("legend", {}),
|
|
3485
3577
|
...otherProps
|
|
3486
3578
|
} = props;
|
|
3487
3579
|
const { legendProps, containerProps } = useFieldset(props);
|
|
3488
|
-
const classes = (0,
|
|
3580
|
+
const classes = (0, import_dedupe28.default)("mobius", "mobius-fieldset", props.className);
|
|
3489
3581
|
legendProps.className = "mobius-fieldset__legend";
|
|
3490
|
-
return /* @__PURE__ */ (0,
|
|
3491
|
-
legend && (0,
|
|
3582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
3583
|
+
legend && (0, import_react26.cloneElement)(legendComponent, { ...legendProps }, [legend]),
|
|
3492
3584
|
children
|
|
3493
3585
|
] });
|
|
3494
3586
|
};
|
|
@@ -3505,13 +3597,13 @@ var init_Fieldset2 = __esm({
|
|
|
3505
3597
|
});
|
|
3506
3598
|
|
|
3507
3599
|
// src/components/Grid/Grid.tsx
|
|
3508
|
-
var
|
|
3600
|
+
var import_dedupe29, import_jsx_runtime35, Grid;
|
|
3509
3601
|
var init_Grid = __esm({
|
|
3510
3602
|
"src/components/Grid/Grid.tsx"() {
|
|
3511
3603
|
"use strict";
|
|
3512
|
-
|
|
3604
|
+
import_dedupe29 = __toESM(require("classnames/dedupe"));
|
|
3513
3605
|
init_utils();
|
|
3514
|
-
|
|
3606
|
+
import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3515
3607
|
Grid = ({ ref: _ref, ...props }) => {
|
|
3516
3608
|
const {
|
|
3517
3609
|
columns = 12,
|
|
@@ -3526,7 +3618,7 @@ var init_Grid = __esm({
|
|
|
3526
3618
|
style,
|
|
3527
3619
|
...rest
|
|
3528
3620
|
} = props;
|
|
3529
|
-
const classes = (0,
|
|
3621
|
+
const classes = (0, import_dedupe29.default)("mobius", "mobius-grid", className);
|
|
3530
3622
|
const styles = filterUndefinedProps({
|
|
3531
3623
|
boxSizing: "border-box",
|
|
3532
3624
|
display: "grid",
|
|
@@ -3540,22 +3632,22 @@ var init_Grid = __esm({
|
|
|
3540
3632
|
justifyItems,
|
|
3541
3633
|
...style
|
|
3542
3634
|
});
|
|
3543
|
-
return /* @__PURE__ */ (0,
|
|
3635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { style: styles, className: classes, ...rest });
|
|
3544
3636
|
};
|
|
3545
3637
|
Grid.displayName = "Grid";
|
|
3546
3638
|
}
|
|
3547
3639
|
});
|
|
3548
3640
|
|
|
3549
3641
|
// src/components/Grid/Item.tsx
|
|
3550
|
-
var
|
|
3642
|
+
var import_react27, import_dedupe30, import_jsx_runtime36, getBreakpointMap, DEFAULT_SPAN, GridItem;
|
|
3551
3643
|
var init_Item2 = __esm({
|
|
3552
3644
|
"src/components/Grid/Item.tsx"() {
|
|
3553
3645
|
"use strict";
|
|
3554
3646
|
"use client";
|
|
3555
|
-
|
|
3556
|
-
|
|
3647
|
+
import_react27 = require("react");
|
|
3648
|
+
import_dedupe30 = __toESM(require("classnames/dedupe"));
|
|
3557
3649
|
init_hooks();
|
|
3558
|
-
|
|
3650
|
+
import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3559
3651
|
getBreakpointMap = (config) => Object.entries(config).reduce(
|
|
3560
3652
|
(prev, [key, value]) => {
|
|
3561
3653
|
const previous = Object.values(prev);
|
|
@@ -3590,9 +3682,9 @@ var init_Item2 = __esm({
|
|
|
3590
3682
|
xl,
|
|
3591
3683
|
xxl
|
|
3592
3684
|
});
|
|
3593
|
-
const [responsiveSpan, setResponsiveSpan] = (0,
|
|
3594
|
-
const classes = (0,
|
|
3595
|
-
(0,
|
|
3685
|
+
const [responsiveSpan, setResponsiveSpan] = (0, import_react27.useState)();
|
|
3686
|
+
const classes = (0, import_dedupe30.default)("mobius-grid__item", className);
|
|
3687
|
+
(0, import_react27.useEffect)(() => {
|
|
3596
3688
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
3597
3689
|
}, [breakpointSize, breakpointMap]);
|
|
3598
3690
|
const styles = {
|
|
@@ -3600,7 +3692,7 @@ var init_Item2 = __esm({
|
|
|
3600
3692
|
alignSelf,
|
|
3601
3693
|
justifySelf
|
|
3602
3694
|
};
|
|
3603
|
-
return /* @__PURE__ */ (0,
|
|
3695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { style: { ...styles }, className: classes, ...rest });
|
|
3604
3696
|
};
|
|
3605
3697
|
GridItem.displayName = "GridItem";
|
|
3606
3698
|
}
|
|
@@ -3621,20 +3713,20 @@ var init_Grid2 = __esm({
|
|
|
3621
3713
|
});
|
|
3622
3714
|
|
|
3623
3715
|
// src/components/Image/Image.tsx
|
|
3624
|
-
var
|
|
3716
|
+
var import_dedupe31, import_jsx_runtime37, Image;
|
|
3625
3717
|
var init_Image = __esm({
|
|
3626
3718
|
"src/components/Image/Image.tsx"() {
|
|
3627
3719
|
"use strict";
|
|
3628
|
-
|
|
3629
|
-
|
|
3720
|
+
import_dedupe31 = __toESM(require("classnames/dedupe"));
|
|
3721
|
+
import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3630
3722
|
Image = ({
|
|
3631
3723
|
ref,
|
|
3632
3724
|
alt,
|
|
3633
3725
|
elementType: Component = "img",
|
|
3634
3726
|
...otherProps
|
|
3635
3727
|
}) => {
|
|
3636
|
-
const classes = (0,
|
|
3637
|
-
return /* @__PURE__ */ (0,
|
|
3728
|
+
const classes = (0, import_dedupe31.default)("mobius", "mobius-image", otherProps.className);
|
|
3729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Component, { alt, ref, ...otherProps, className: classes });
|
|
3638
3730
|
};
|
|
3639
3731
|
Image.displayName = "Image";
|
|
3640
3732
|
}
|
|
@@ -3649,13 +3741,13 @@ var init_Image2 = __esm({
|
|
|
3649
3741
|
});
|
|
3650
3742
|
|
|
3651
3743
|
// src/components/Link/Link.tsx
|
|
3652
|
-
var
|
|
3744
|
+
var import_dedupe32, import_Link, import_jsx_runtime38, Link;
|
|
3653
3745
|
var init_Link = __esm({
|
|
3654
3746
|
"src/components/Link/Link.tsx"() {
|
|
3655
3747
|
"use strict";
|
|
3656
|
-
|
|
3748
|
+
import_dedupe32 = __toESM(require("classnames/dedupe"));
|
|
3657
3749
|
import_Link = require("@simplybusiness/mobius/src/components/Link/Link.css");
|
|
3658
|
-
|
|
3750
|
+
import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3659
3751
|
Link = ({ ref, ...props }) => {
|
|
3660
3752
|
const {
|
|
3661
3753
|
isDisabled = false,
|
|
@@ -3669,7 +3761,7 @@ var init_Link = __esm({
|
|
|
3669
3761
|
pointerEvents: "none"
|
|
3670
3762
|
};
|
|
3671
3763
|
const styles = { ...style, ...isDisabled && disabledStyles };
|
|
3672
|
-
const classes = (0,
|
|
3764
|
+
const classes = (0, import_dedupe32.default)(
|
|
3673
3765
|
"mobius",
|
|
3674
3766
|
"mobius-link",
|
|
3675
3767
|
className,
|
|
@@ -3678,7 +3770,7 @@ var init_Link = __esm({
|
|
|
3678
3770
|
"--is-disabled": isDisabled
|
|
3679
3771
|
}
|
|
3680
3772
|
);
|
|
3681
|
-
return /* @__PURE__ */ (0,
|
|
3773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3682
3774
|
Component,
|
|
3683
3775
|
{
|
|
3684
3776
|
ref,
|
|
@@ -3713,16 +3805,16 @@ function LinkButton({
|
|
|
3713
3805
|
if (!href) {
|
|
3714
3806
|
throw new Error("LinkButton requires a href prop");
|
|
3715
3807
|
}
|
|
3716
|
-
const classes = (0,
|
|
3717
|
-
return /* @__PURE__ */ (0,
|
|
3808
|
+
const classes = (0, import_dedupe33.default)("mobius", "mobius-link-button", className);
|
|
3809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, { elementType, href, className: classes, ...rest, children });
|
|
3718
3810
|
}
|
|
3719
|
-
var
|
|
3811
|
+
var import_dedupe33, import_jsx_runtime39;
|
|
3720
3812
|
var init_LinkButton = __esm({
|
|
3721
3813
|
"src/components/LinkButton/LinkButton.tsx"() {
|
|
3722
3814
|
"use strict";
|
|
3723
|
-
|
|
3815
|
+
import_dedupe33 = __toESM(require("classnames/dedupe"));
|
|
3724
3816
|
init_Button2();
|
|
3725
|
-
|
|
3817
|
+
import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3726
3818
|
}
|
|
3727
3819
|
});
|
|
3728
3820
|
|
|
@@ -3735,14 +3827,14 @@ var init_LinkButton2 = __esm({
|
|
|
3735
3827
|
});
|
|
3736
3828
|
|
|
3737
3829
|
// src/components/List/List.tsx
|
|
3738
|
-
var
|
|
3830
|
+
var import_react28, import_dedupe34, import_List, import_jsx_runtime40, List;
|
|
3739
3831
|
var init_List = __esm({
|
|
3740
3832
|
"src/components/List/List.tsx"() {
|
|
3741
3833
|
"use strict";
|
|
3742
|
-
|
|
3743
|
-
|
|
3834
|
+
import_react28 = require("react");
|
|
3835
|
+
import_dedupe34 = __toESM(require("classnames/dedupe"));
|
|
3744
3836
|
import_List = require("@simplybusiness/mobius/src/components/List/List.css");
|
|
3745
|
-
|
|
3837
|
+
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3746
3838
|
List = ({ ref, ...props }) => {
|
|
3747
3839
|
const Component = props.isOrdered ? "ol" : "ul";
|
|
3748
3840
|
const { children, icon, ...otherProps } = props;
|
|
@@ -3751,7 +3843,7 @@ var init_List = __esm({
|
|
|
3751
3843
|
...restProps,
|
|
3752
3844
|
reversed: isReversed
|
|
3753
3845
|
};
|
|
3754
|
-
const classes = (0,
|
|
3846
|
+
const classes = (0, import_dedupe34.default)(
|
|
3755
3847
|
"mobius",
|
|
3756
3848
|
"mobius-list",
|
|
3757
3849
|
{
|
|
@@ -3760,9 +3852,9 @@ var init_List = __esm({
|
|
|
3760
3852
|
},
|
|
3761
3853
|
otherProps.className
|
|
3762
3854
|
);
|
|
3763
|
-
return /* @__PURE__ */ (0,
|
|
3764
|
-
if ((0,
|
|
3765
|
-
return (0,
|
|
3855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Component, { ref, ...mappedProps, className: classes, children: import_react28.Children.map(children, (child) => {
|
|
3856
|
+
if ((0, import_react28.isValidElement)(child)) {
|
|
3857
|
+
return (0, import_react28.cloneElement)(child, {
|
|
3766
3858
|
parentIcon: icon
|
|
3767
3859
|
});
|
|
3768
3860
|
}
|
|
@@ -3774,16 +3866,16 @@ var init_List = __esm({
|
|
|
3774
3866
|
});
|
|
3775
3867
|
|
|
3776
3868
|
// src/components/List/ListItem.tsx
|
|
3777
|
-
var
|
|
3869
|
+
var import_dedupe35, import_jsx_runtime41, ListItem;
|
|
3778
3870
|
var init_ListItem = __esm({
|
|
3779
3871
|
"src/components/List/ListItem.tsx"() {
|
|
3780
3872
|
"use strict";
|
|
3781
|
-
|
|
3782
|
-
|
|
3873
|
+
import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3874
|
+
import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3783
3875
|
ListItem = ({ ref, ...props }) => {
|
|
3784
3876
|
const { parentIcon, icon, children, ...otherProps } = props;
|
|
3785
3877
|
const iconContent = icon || parentIcon;
|
|
3786
|
-
const classes = (0,
|
|
3878
|
+
const classes = (0, import_dedupe35.default)(
|
|
3787
3879
|
"mobius",
|
|
3788
3880
|
"mobius-list__item",
|
|
3789
3881
|
{
|
|
@@ -3791,15 +3883,15 @@ var init_ListItem = __esm({
|
|
|
3791
3883
|
},
|
|
3792
3884
|
props.className
|
|
3793
3885
|
);
|
|
3794
|
-
const contentClasses = (0,
|
|
3795
|
-
const iconClasses = (0,
|
|
3886
|
+
const contentClasses = (0, import_dedupe35.default)("mobius", "mobius-list__item-content");
|
|
3887
|
+
const iconClasses = (0, import_dedupe35.default)("mobius", "mobius-list__icon");
|
|
3796
3888
|
if (iconContent) {
|
|
3797
|
-
return /* @__PURE__ */ (0,
|
|
3798
|
-
/* @__PURE__ */ (0,
|
|
3889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("li", { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: contentClasses, children: [
|
|
3890
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: iconClasses, children: iconContent }),
|
|
3799
3891
|
children
|
|
3800
3892
|
] }) });
|
|
3801
3893
|
}
|
|
3802
|
-
return /* @__PURE__ */ (0,
|
|
3894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("li", { ref, ...otherProps, className: classes, children });
|
|
3803
3895
|
};
|
|
3804
3896
|
ListItem.displayName = "ListItem";
|
|
3805
3897
|
}
|
|
@@ -3815,23 +3907,23 @@ var init_List2 = __esm({
|
|
|
3815
3907
|
});
|
|
3816
3908
|
|
|
3817
3909
|
// src/components/LoadingIndicator/LoadingIndicator.tsx
|
|
3818
|
-
var
|
|
3910
|
+
var import_dedupe36, import_icons9, import_LoadingIndicator, import_jsx_runtime42, LoadingIndicator;
|
|
3819
3911
|
var init_LoadingIndicator = __esm({
|
|
3820
3912
|
"src/components/LoadingIndicator/LoadingIndicator.tsx"() {
|
|
3821
3913
|
"use strict";
|
|
3822
|
-
|
|
3914
|
+
import_dedupe36 = __toESM(require("classnames/dedupe"));
|
|
3823
3915
|
import_icons9 = require("@simplybusiness/icons");
|
|
3824
3916
|
init_Icon2();
|
|
3825
3917
|
import_LoadingIndicator = require("@simplybusiness/mobius/src/components/LoadingIndicator/LoadingIndicator.css");
|
|
3826
|
-
|
|
3918
|
+
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3827
3919
|
LoadingIndicator = ({ ref, ...props }) => {
|
|
3828
3920
|
const { icon = import_icons9.loading, ...otherProps } = props;
|
|
3829
|
-
const classes = (0,
|
|
3921
|
+
const classes = (0, import_dedupe36.default)(
|
|
3830
3922
|
"mobius",
|
|
3831
3923
|
"mobius-loading-indicator",
|
|
3832
3924
|
otherProps.className
|
|
3833
3925
|
);
|
|
3834
|
-
return /* @__PURE__ */ (0,
|
|
3926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { icon, spin: true, ref, ...otherProps, className: classes });
|
|
3835
3927
|
};
|
|
3836
3928
|
LoadingIndicator.displayName = "LoadingIndicator";
|
|
3837
3929
|
}
|
|
@@ -3846,16 +3938,16 @@ var init_LoadingIndicator2 = __esm({
|
|
|
3846
3938
|
});
|
|
3847
3939
|
|
|
3848
3940
|
// src/components/Logo/Logo.tsx
|
|
3849
|
-
var
|
|
3941
|
+
var import_dedupe37, import_jsx_runtime43, Logo;
|
|
3850
3942
|
var init_Logo = __esm({
|
|
3851
3943
|
"src/components/Logo/Logo.tsx"() {
|
|
3852
3944
|
"use strict";
|
|
3853
|
-
|
|
3854
|
-
|
|
3945
|
+
import_dedupe37 = __toESM(require("classnames/dedupe"));
|
|
3946
|
+
import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3855
3947
|
Logo = ({ ref, ...props }) => {
|
|
3856
3948
|
const { className, width, height, ...otherProps } = props;
|
|
3857
|
-
const classes = (0,
|
|
3858
|
-
return /* @__PURE__ */ (0,
|
|
3949
|
+
const classes = (0, import_dedupe37.default)("mobius", "mobius-logo", className);
|
|
3950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3859
3951
|
"svg",
|
|
3860
3952
|
{
|
|
3861
3953
|
width,
|
|
@@ -3865,7 +3957,7 @@ var init_Logo = __esm({
|
|
|
3865
3957
|
viewBox: "0 0 144 37",
|
|
3866
3958
|
...otherProps,
|
|
3867
3959
|
children: [
|
|
3868
|
-
/* @__PURE__ */ (0,
|
|
3960
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3869
3961
|
"linearGradient",
|
|
3870
3962
|
{
|
|
3871
3963
|
id: "logo-gradient",
|
|
@@ -3874,27 +3966,27 @@ var init_Logo = __esm({
|
|
|
3874
3966
|
y1: "76.042%",
|
|
3875
3967
|
y2: "26.973%",
|
|
3876
3968
|
children: [
|
|
3877
|
-
/* @__PURE__ */ (0,
|
|
3878
|
-
/* @__PURE__ */ (0,
|
|
3969
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("stop", { stopColor: "#4632D8", offset: "0%" }),
|
|
3970
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("stop", { stopColor: "#9084E8", offset: "100%" })
|
|
3879
3971
|
]
|
|
3880
3972
|
}
|
|
3881
3973
|
) }),
|
|
3882
|
-
/* @__PURE__ */ (0,
|
|
3883
|
-
/* @__PURE__ */ (0,
|
|
3974
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("g", { children: [
|
|
3975
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3884
3976
|
"path",
|
|
3885
3977
|
{
|
|
3886
3978
|
fill: "#0E0A2B",
|
|
3887
3979
|
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"
|
|
3888
3980
|
}
|
|
3889
3981
|
),
|
|
3890
|
-
/* @__PURE__ */ (0,
|
|
3982
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3891
3983
|
"path",
|
|
3892
3984
|
{
|
|
3893
3985
|
fill: "url(#logo-gradient)",
|
|
3894
3986
|
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"
|
|
3895
3987
|
}
|
|
3896
3988
|
),
|
|
3897
|
-
/* @__PURE__ */ (0,
|
|
3989
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3898
3990
|
"path",
|
|
3899
3991
|
{
|
|
3900
3992
|
fill: "#0E0A2B",
|
|
@@ -3919,23 +4011,23 @@ var init_Logo2 = __esm({
|
|
|
3919
4011
|
});
|
|
3920
4012
|
|
|
3921
4013
|
// src/components/Modal/Content.tsx
|
|
3922
|
-
var
|
|
4014
|
+
var import_jsx_runtime44, Content2;
|
|
3923
4015
|
var init_Content2 = __esm({
|
|
3924
4016
|
"src/components/Modal/Content.tsx"() {
|
|
3925
4017
|
"use strict";
|
|
3926
|
-
|
|
3927
|
-
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
4018
|
+
import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4019
|
+
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { ref, ...otherProps, className: "mobius-modal__content", children });
|
|
3928
4020
|
Content2.displayName = "Content";
|
|
3929
4021
|
}
|
|
3930
4022
|
});
|
|
3931
4023
|
|
|
3932
4024
|
// src/components/Modal/ModalContext.tsx
|
|
3933
|
-
var
|
|
4025
|
+
var import_react29, ModalContext;
|
|
3934
4026
|
var init_ModalContext = __esm({
|
|
3935
4027
|
"src/components/Modal/ModalContext.tsx"() {
|
|
3936
4028
|
"use strict";
|
|
3937
|
-
|
|
3938
|
-
ModalContext = (0,
|
|
4029
|
+
import_react29 = require("react");
|
|
4030
|
+
ModalContext = (0, import_react29.createContext)({
|
|
3939
4031
|
onClose: () => {
|
|
3940
4032
|
},
|
|
3941
4033
|
closeLabel: void 0
|
|
@@ -3944,21 +4036,21 @@ var init_ModalContext = __esm({
|
|
|
3944
4036
|
});
|
|
3945
4037
|
|
|
3946
4038
|
// src/components/Modal/useModal.ts
|
|
3947
|
-
var
|
|
4039
|
+
var import_react30, useModal;
|
|
3948
4040
|
var init_useModal = __esm({
|
|
3949
4041
|
"src/components/Modal/useModal.ts"() {
|
|
3950
4042
|
"use strict";
|
|
3951
|
-
|
|
4043
|
+
import_react30 = require("react");
|
|
3952
4044
|
init_ModalContext();
|
|
3953
4045
|
useModal = () => {
|
|
3954
|
-
const { onClose, closeLabel } = (0,
|
|
4046
|
+
const { onClose, closeLabel } = (0, import_react30.useContext)(ModalContext);
|
|
3955
4047
|
return { onClose, closeLabel };
|
|
3956
4048
|
};
|
|
3957
4049
|
}
|
|
3958
4050
|
});
|
|
3959
4051
|
|
|
3960
4052
|
// src/components/Modal/Header.tsx
|
|
3961
|
-
var import_icons10,
|
|
4053
|
+
var import_icons10, import_jsx_runtime45, Header2;
|
|
3962
4054
|
var init_Header2 = __esm({
|
|
3963
4055
|
"src/components/Modal/Header.tsx"() {
|
|
3964
4056
|
"use strict";
|
|
@@ -3966,12 +4058,12 @@ var init_Header2 = __esm({
|
|
|
3966
4058
|
init_Button2();
|
|
3967
4059
|
init_Icon2();
|
|
3968
4060
|
init_useModal();
|
|
3969
|
-
|
|
4061
|
+
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3970
4062
|
Header2 = ({ ref, children, ...otherProps }) => {
|
|
3971
4063
|
const { onClose, closeLabel } = useModal();
|
|
3972
|
-
return /* @__PURE__ */ (0,
|
|
4064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("header", { ref, ...otherProps, className: "mobius-modal__header", children: [
|
|
3973
4065
|
children,
|
|
3974
|
-
/* @__PURE__ */ (0,
|
|
4066
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3975
4067
|
Button,
|
|
3976
4068
|
{
|
|
3977
4069
|
"aria-label": "Close",
|
|
@@ -3979,7 +4071,7 @@ var init_Header2 = __esm({
|
|
|
3979
4071
|
onPress: onClose,
|
|
3980
4072
|
className: "mobius-modal__close",
|
|
3981
4073
|
children: [
|
|
3982
|
-
/* @__PURE__ */ (0,
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Icon, { icon: import_icons10.cross }),
|
|
3983
4075
|
" ",
|
|
3984
4076
|
closeLabel
|
|
3985
4077
|
]
|
|
@@ -3992,19 +4084,19 @@ var init_Header2 = __esm({
|
|
|
3992
4084
|
});
|
|
3993
4085
|
|
|
3994
4086
|
// src/components/Modal/Modal.tsx
|
|
3995
|
-
var
|
|
4087
|
+
var import_dedupe38, import_react31, import_Modal, import_jsx_runtime46, TRANSITION_CSS_VARIABLE2, Modal;
|
|
3996
4088
|
var init_Modal = __esm({
|
|
3997
4089
|
"src/components/Modal/Modal.tsx"() {
|
|
3998
4090
|
"use strict";
|
|
3999
4091
|
"use client";
|
|
4000
|
-
|
|
4001
|
-
|
|
4092
|
+
import_dedupe38 = __toESM(require("classnames/dedupe"));
|
|
4093
|
+
import_react31 = require("react");
|
|
4002
4094
|
init_hooks();
|
|
4003
4095
|
init_utils();
|
|
4004
4096
|
init_polyfill_tests();
|
|
4005
4097
|
init_ModalContext();
|
|
4006
4098
|
import_Modal = require("@simplybusiness/mobius/src/components/Modal/Modal.css");
|
|
4007
|
-
|
|
4099
|
+
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4008
4100
|
TRANSITION_CSS_VARIABLE2 = "--modal-transition-duration";
|
|
4009
4101
|
Modal = ({ ref, ...props }) => {
|
|
4010
4102
|
const {
|
|
@@ -4018,11 +4110,11 @@ var init_Modal = __esm({
|
|
|
4018
4110
|
animation,
|
|
4019
4111
|
...rest
|
|
4020
4112
|
} = props;
|
|
4021
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
4022
|
-
(0,
|
|
4113
|
+
const [shouldTransition, setShouldTransition] = (0, import_react31.useState)(false);
|
|
4114
|
+
(0, import_react31.useEffect)(() => {
|
|
4023
4115
|
setShouldTransition(supportsDialog());
|
|
4024
4116
|
}, []);
|
|
4025
|
-
const dialogRef = (0,
|
|
4117
|
+
const dialogRef = (0, import_react31.useRef)(null);
|
|
4026
4118
|
const { close } = useDialog({
|
|
4027
4119
|
ref: dialogRef,
|
|
4028
4120
|
isOpen,
|
|
@@ -4033,7 +4125,7 @@ var init_Modal = __esm({
|
|
|
4033
4125
|
CSSVariable: TRANSITION_CSS_VARIABLE2
|
|
4034
4126
|
}
|
|
4035
4127
|
});
|
|
4036
|
-
const modalClasses = (0,
|
|
4128
|
+
const modalClasses = (0, import_dedupe38.default)(
|
|
4037
4129
|
"mobius",
|
|
4038
4130
|
"mobius-modal",
|
|
4039
4131
|
{
|
|
@@ -4046,21 +4138,21 @@ var init_Modal = __esm({
|
|
|
4046
4138
|
},
|
|
4047
4139
|
className
|
|
4048
4140
|
);
|
|
4049
|
-
const contextValue = (0,
|
|
4141
|
+
const contextValue = (0, import_react31.useMemo)(
|
|
4050
4142
|
() => ({
|
|
4051
4143
|
onClose: close,
|
|
4052
4144
|
closeLabel
|
|
4053
4145
|
}),
|
|
4054
4146
|
[close, closeLabel]
|
|
4055
4147
|
);
|
|
4056
|
-
return /* @__PURE__ */ (0,
|
|
4148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4057
4149
|
"dialog",
|
|
4058
4150
|
{
|
|
4059
4151
|
ref: mergeRefs([dialogRef, ref]),
|
|
4060
4152
|
onCancel: close,
|
|
4061
4153
|
className: modalClasses,
|
|
4062
4154
|
...rest,
|
|
4063
|
-
children: /* @__PURE__ */ (0,
|
|
4155
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ModalContext.Provider, { value: contextValue, children })
|
|
4064
4156
|
}
|
|
4065
4157
|
);
|
|
4066
4158
|
};
|
|
@@ -4086,16 +4178,16 @@ var init_Modal2 = __esm({
|
|
|
4086
4178
|
});
|
|
4087
4179
|
|
|
4088
4180
|
// src/components/NumberField/NumberField.tsx
|
|
4089
|
-
var
|
|
4181
|
+
var import_dedupe39, import_react32, import_NumberField, import_jsx_runtime47, NumberField;
|
|
4090
4182
|
var init_NumberField = __esm({
|
|
4091
4183
|
"src/components/NumberField/NumberField.tsx"() {
|
|
4092
4184
|
"use strict";
|
|
4093
4185
|
"use client";
|
|
4094
|
-
|
|
4095
|
-
|
|
4186
|
+
import_dedupe39 = __toESM(require("classnames/dedupe"));
|
|
4187
|
+
import_react32 = require("react");
|
|
4096
4188
|
init_TextField2();
|
|
4097
4189
|
import_NumberField = require("@simplybusiness/mobius/src/components/NumberField/NumberField.css");
|
|
4098
|
-
|
|
4190
|
+
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4099
4191
|
NumberField = ({ ref, ...props }) => {
|
|
4100
4192
|
const {
|
|
4101
4193
|
minValue,
|
|
@@ -4111,15 +4203,15 @@ var init_NumberField = __esm({
|
|
|
4111
4203
|
onBlur: customOnBlur,
|
|
4112
4204
|
...rest
|
|
4113
4205
|
} = otherProps;
|
|
4114
|
-
const focusedInputRef = (0,
|
|
4115
|
-
const wheelHandler = (0,
|
|
4116
|
-
(0,
|
|
4206
|
+
const focusedInputRef = (0, import_react32.useRef)(null);
|
|
4207
|
+
const wheelHandler = (0, import_react32.useCallback)((ev) => ev.preventDefault(), []);
|
|
4208
|
+
(0, import_react32.useEffect)(() => {
|
|
4117
4209
|
return () => {
|
|
4118
4210
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
4119
4211
|
focusedInputRef.current = null;
|
|
4120
4212
|
};
|
|
4121
4213
|
}, [wheelHandler]);
|
|
4122
|
-
const containerClasses = (0,
|
|
4214
|
+
const containerClasses = (0, import_dedupe39.default)("mobius-number-field", className, {
|
|
4123
4215
|
"--hide-spin-buttons": hideSpinButtons
|
|
4124
4216
|
});
|
|
4125
4217
|
const handleBeforeInput = (event) => {
|
|
@@ -4163,7 +4255,7 @@ var init_NumberField = __esm({
|
|
|
4163
4255
|
},
|
|
4164
4256
|
onBlur: (e) => handleBlur(e)
|
|
4165
4257
|
};
|
|
4166
|
-
return /* @__PURE__ */ (0,
|
|
4258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4167
4259
|
TextField,
|
|
4168
4260
|
{
|
|
4169
4261
|
...forwardedProps,
|
|
@@ -4191,18 +4283,18 @@ var init_NumberField2 = __esm({
|
|
|
4191
4283
|
});
|
|
4192
4284
|
|
|
4193
4285
|
// src/components/Option/Option.tsx
|
|
4194
|
-
var
|
|
4286
|
+
var import_jsx_runtime48, Option2;
|
|
4195
4287
|
var init_Option2 = __esm({
|
|
4196
4288
|
"src/components/Option/Option.tsx"() {
|
|
4197
4289
|
"use strict";
|
|
4198
|
-
|
|
4290
|
+
import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4199
4291
|
Option2 = ({ ref, ...props }) => {
|
|
4200
4292
|
const { isDisabled, ...rest } = props;
|
|
4201
4293
|
const mappedProps = {
|
|
4202
4294
|
...rest,
|
|
4203
4295
|
disabled: isDisabled
|
|
4204
4296
|
};
|
|
4205
|
-
return /* @__PURE__ */ (0,
|
|
4297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("option", { ...mappedProps, ref });
|
|
4206
4298
|
};
|
|
4207
4299
|
Option2.displayName = "Option";
|
|
4208
4300
|
}
|
|
@@ -4217,17 +4309,17 @@ var init_Option3 = __esm({
|
|
|
4217
4309
|
});
|
|
4218
4310
|
|
|
4219
4311
|
// src/components/PasswordField/ShowHideButton.tsx
|
|
4220
|
-
var import_icons11,
|
|
4312
|
+
var import_icons11, import_jsx_runtime49, ShowHideButton;
|
|
4221
4313
|
var init_ShowHideButton = __esm({
|
|
4222
4314
|
"src/components/PasswordField/ShowHideButton.tsx"() {
|
|
4223
4315
|
"use strict";
|
|
4224
4316
|
import_icons11 = require("@simplybusiness/icons");
|
|
4225
4317
|
init_src();
|
|
4226
|
-
|
|
4318
|
+
import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4227
4319
|
ShowHideButton = ({
|
|
4228
4320
|
show = false,
|
|
4229
4321
|
onClick
|
|
4230
|
-
}) => /* @__PURE__ */ (0,
|
|
4322
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4231
4323
|
"button",
|
|
4232
4324
|
{
|
|
4233
4325
|
className: "mobius-password-field__show-button",
|
|
@@ -4238,35 +4330,35 @@ var init_ShowHideButton = __esm({
|
|
|
4238
4330
|
},
|
|
4239
4331
|
"aria-label": `${show ? "Hide" : "Show"} password`,
|
|
4240
4332
|
"data-testid": "show-hide-button",
|
|
4241
|
-
children: /* @__PURE__ */ (0,
|
|
4333
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { icon: show ? import_icons11.eyeSlash : import_icons11.eye, "aria-hidden": "true" })
|
|
4242
4334
|
}
|
|
4243
4335
|
);
|
|
4244
4336
|
}
|
|
4245
4337
|
});
|
|
4246
4338
|
|
|
4247
4339
|
// src/components/PasswordField/PasswordField.tsx
|
|
4248
|
-
var
|
|
4340
|
+
var import_dedupe40, import_react33, import_PasswordField, import_jsx_runtime50, PasswordField;
|
|
4249
4341
|
var init_PasswordField = __esm({
|
|
4250
4342
|
"src/components/PasswordField/PasswordField.tsx"() {
|
|
4251
4343
|
"use strict";
|
|
4252
4344
|
"use client";
|
|
4253
|
-
|
|
4254
|
-
|
|
4345
|
+
import_dedupe40 = __toESM(require("classnames/dedupe"));
|
|
4346
|
+
import_react33 = require("react");
|
|
4255
4347
|
init_mergeRefs();
|
|
4256
4348
|
init_TextField2();
|
|
4257
4349
|
init_ShowHideButton();
|
|
4258
4350
|
import_PasswordField = require("@simplybusiness/mobius/src/components/PasswordField/PasswordField.css");
|
|
4259
|
-
|
|
4351
|
+
import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4260
4352
|
PasswordField = ({
|
|
4261
4353
|
ref,
|
|
4262
4354
|
className,
|
|
4263
4355
|
autoComplete = "current-password",
|
|
4264
4356
|
...props
|
|
4265
4357
|
}) => {
|
|
4266
|
-
const [show, setShow] = (0,
|
|
4358
|
+
const [show, setShow] = (0, import_react33.useState)(false);
|
|
4267
4359
|
const type = show ? "text" : "password";
|
|
4268
|
-
const classes = (0,
|
|
4269
|
-
const localRef = (0,
|
|
4360
|
+
const classes = (0, import_dedupe40.default)("mobius-password-field", className);
|
|
4361
|
+
const localRef = (0, import_react33.useRef)(null);
|
|
4270
4362
|
const handleShowHideButtonClick = () => {
|
|
4271
4363
|
const selectionStart = localRef.current?.selectionStart;
|
|
4272
4364
|
const selectionEnd = localRef.current?.selectionEnd;
|
|
@@ -4278,7 +4370,7 @@ var init_PasswordField = __esm({
|
|
|
4278
4370
|
}
|
|
4279
4371
|
});
|
|
4280
4372
|
};
|
|
4281
|
-
return /* @__PURE__ */ (0,
|
|
4373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4282
4374
|
TextField,
|
|
4283
4375
|
{
|
|
4284
4376
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -4286,7 +4378,7 @@ var init_PasswordField = __esm({
|
|
|
4286
4378
|
...props,
|
|
4287
4379
|
autoComplete,
|
|
4288
4380
|
type,
|
|
4289
|
-
suffixInside: /* @__PURE__ */ (0,
|
|
4381
|
+
suffixInside: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ShowHideButton, { onClick: handleShowHideButtonClick, show })
|
|
4290
4382
|
}
|
|
4291
4383
|
);
|
|
4292
4384
|
};
|
|
@@ -4303,39 +4395,39 @@ var init_PasswordField2 = __esm({
|
|
|
4303
4395
|
});
|
|
4304
4396
|
|
|
4305
4397
|
// src/components/Popover/Popover.tsx
|
|
4306
|
-
var
|
|
4398
|
+
var import_react34, import_icons12, import_dedupe41, import_react35, import_mobius_hooks6, import_Popover, import_jsx_runtime51, OFFSET_FROM_CONTENT_DEFAULT, Popover;
|
|
4307
4399
|
var init_Popover = __esm({
|
|
4308
4400
|
"src/components/Popover/Popover.tsx"() {
|
|
4309
4401
|
"use strict";
|
|
4310
|
-
|
|
4402
|
+
import_react34 = require("@floating-ui/react");
|
|
4311
4403
|
import_icons12 = require("@simplybusiness/icons");
|
|
4312
|
-
|
|
4313
|
-
|
|
4404
|
+
import_dedupe41 = __toESM(require("classnames/dedupe"));
|
|
4405
|
+
import_react35 = require("react");
|
|
4314
4406
|
import_mobius_hooks6 = require("@simplybusiness/mobius-hooks");
|
|
4315
4407
|
init_Button2();
|
|
4316
4408
|
init_Icon2();
|
|
4317
4409
|
import_Popover = require("@simplybusiness/mobius/src/components/Popover/Popover.css");
|
|
4318
|
-
|
|
4410
|
+
import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4319
4411
|
OFFSET_FROM_CONTENT_DEFAULT = 10;
|
|
4320
4412
|
Popover = (props) => {
|
|
4321
4413
|
const { trigger, children, onOpen, onClose, className } = props;
|
|
4322
|
-
const arrowRef = (0,
|
|
4323
|
-
const floatingContainerRef = (0,
|
|
4324
|
-
const [isOpen, setIsOpen] = (0,
|
|
4325
|
-
const { refs, floatingStyles, context } = (0,
|
|
4414
|
+
const arrowRef = (0, import_react35.useRef)(null);
|
|
4415
|
+
const floatingContainerRef = (0, import_react35.useRef)(null);
|
|
4416
|
+
const [isOpen, setIsOpen] = (0, import_react35.useState)(false);
|
|
4417
|
+
const { refs, floatingStyles, context } = (0, import_react34.useFloating)({
|
|
4326
4418
|
open: isOpen,
|
|
4327
4419
|
onOpenChange: setIsOpen,
|
|
4328
|
-
whileElementsMounted:
|
|
4420
|
+
whileElementsMounted: import_react34.autoUpdate,
|
|
4329
4421
|
middleware: [
|
|
4330
|
-
(0,
|
|
4422
|
+
(0, import_react34.arrow)({
|
|
4331
4423
|
element: arrowRef
|
|
4332
4424
|
}),
|
|
4333
|
-
(0,
|
|
4334
|
-
(0,
|
|
4335
|
-
(0,
|
|
4425
|
+
(0, import_react34.offset)(OFFSET_FROM_CONTENT_DEFAULT),
|
|
4426
|
+
(0, import_react34.shift)(),
|
|
4427
|
+
(0, import_react34.flip)()
|
|
4336
4428
|
]
|
|
4337
4429
|
});
|
|
4338
|
-
const dismiss = (0,
|
|
4430
|
+
const dismiss = (0, import_react34.useDismiss)(context, {
|
|
4339
4431
|
bubbles: true,
|
|
4340
4432
|
outsidePress: (event) => {
|
|
4341
4433
|
const toggle = refs.reference.current;
|
|
@@ -4346,20 +4438,20 @@ var init_Popover = __esm({
|
|
|
4346
4438
|
return true;
|
|
4347
4439
|
}
|
|
4348
4440
|
});
|
|
4349
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
4350
|
-
const containerClasses = (0,
|
|
4441
|
+
const { getReferenceProps, getFloatingProps } = (0, import_react34.useInteractions)([dismiss]);
|
|
4442
|
+
const containerClasses = (0, import_dedupe41.default)(
|
|
4351
4443
|
"mobius",
|
|
4352
4444
|
"mobius-popover__container",
|
|
4353
4445
|
className
|
|
4354
4446
|
);
|
|
4355
|
-
const setFloatingRef = (0,
|
|
4447
|
+
const setFloatingRef = (0, import_react35.useCallback)(
|
|
4356
4448
|
(node) => {
|
|
4357
4449
|
refs.setFloating(node);
|
|
4358
4450
|
floatingContainerRef.current = node;
|
|
4359
4451
|
},
|
|
4360
4452
|
[refs]
|
|
4361
4453
|
);
|
|
4362
|
-
(0,
|
|
4454
|
+
(0, import_react35.useEffect)(() => {
|
|
4363
4455
|
const el = floatingContainerRef.current;
|
|
4364
4456
|
if (!el) return;
|
|
4365
4457
|
const preventLabelActivation = (e) => {
|
|
@@ -4380,9 +4472,9 @@ var init_Popover = __esm({
|
|
|
4380
4472
|
setIsOpen(true);
|
|
4381
4473
|
onOpen?.();
|
|
4382
4474
|
};
|
|
4383
|
-
const triggerComponent = (0,
|
|
4475
|
+
const triggerComponent = (0, import_react35.cloneElement)(trigger, {
|
|
4384
4476
|
ref: refs.setReference,
|
|
4385
|
-
className: (0,
|
|
4477
|
+
className: (0, import_dedupe41.default)(
|
|
4386
4478
|
trigger.props.className,
|
|
4387
4479
|
"mobius-popover__toggle"
|
|
4388
4480
|
),
|
|
@@ -4396,9 +4488,9 @@ var init_Popover = __esm({
|
|
|
4396
4488
|
e.stopPropagation();
|
|
4397
4489
|
}
|
|
4398
4490
|
});
|
|
4399
|
-
return /* @__PURE__ */ (0,
|
|
4491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
4400
4492
|
triggerComponent,
|
|
4401
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4493
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
4402
4494
|
"div",
|
|
4403
4495
|
{
|
|
4404
4496
|
className: containerClasses,
|
|
@@ -4406,8 +4498,8 @@ var init_Popover = __esm({
|
|
|
4406
4498
|
style: floatingStyles,
|
|
4407
4499
|
...getFloatingProps(),
|
|
4408
4500
|
children: [
|
|
4409
|
-
/* @__PURE__ */ (0,
|
|
4410
|
-
/* @__PURE__ */ (0,
|
|
4501
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "mobius-popover", children: [
|
|
4502
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("header", { className: "mobius-popover__header", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4411
4503
|
Button,
|
|
4412
4504
|
{
|
|
4413
4505
|
type: "button",
|
|
@@ -4415,7 +4507,7 @@ var init_Popover = __esm({
|
|
|
4415
4507
|
onClick: toggleVisibility,
|
|
4416
4508
|
"aria-label": "Close",
|
|
4417
4509
|
variant: "ghost",
|
|
4418
|
-
children: /* @__PURE__ */ (0,
|
|
4510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4419
4511
|
Icon,
|
|
4420
4512
|
{
|
|
4421
4513
|
icon: import_icons12.cross,
|
|
@@ -4425,10 +4517,10 @@ var init_Popover = __esm({
|
|
|
4425
4517
|
)
|
|
4426
4518
|
}
|
|
4427
4519
|
) }),
|
|
4428
|
-
/* @__PURE__ */ (0,
|
|
4520
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mobius-popover__body", children })
|
|
4429
4521
|
] }),
|
|
4430
|
-
/* @__PURE__ */ (0,
|
|
4431
|
-
|
|
4522
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4523
|
+
import_react34.FloatingArrow,
|
|
4432
4524
|
{
|
|
4433
4525
|
ref: arrowRef,
|
|
4434
4526
|
context,
|
|
@@ -4464,17 +4556,17 @@ function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
|
4464
4556
|
console.warn("Progress value is greater than maxValue");
|
|
4465
4557
|
}
|
|
4466
4558
|
}
|
|
4467
|
-
var
|
|
4559
|
+
var import_dedupe42, import_react36, import_Progress, import_jsx_runtime52, sanitizedValue, getLabelComponent, DEFAULT_VALUE, DEFAULT_MIN_VALUE, DEFAULT_MAX_VALUE, Progress;
|
|
4468
4560
|
var init_Progress = __esm({
|
|
4469
4561
|
"src/components/Progress/Progress.tsx"() {
|
|
4470
4562
|
"use strict";
|
|
4471
4563
|
"use client";
|
|
4472
|
-
|
|
4473
|
-
|
|
4564
|
+
import_dedupe42 = __toESM(require("classnames/dedupe"));
|
|
4565
|
+
import_react36 = require("react");
|
|
4474
4566
|
init_Label2();
|
|
4475
4567
|
init_VisuallyHidden2();
|
|
4476
4568
|
import_Progress = require("@simplybusiness/mobius/src/components/Progress/Progress.css");
|
|
4477
|
-
|
|
4569
|
+
import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4478
4570
|
sanitizedValue = (value, defaultValue) => {
|
|
4479
4571
|
if (value === void 0 || Number.isNaN(value)) {
|
|
4480
4572
|
return defaultValue;
|
|
@@ -4483,7 +4575,7 @@ var init_Progress = __esm({
|
|
|
4483
4575
|
};
|
|
4484
4576
|
getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
4485
4577
|
if (showLabel) {
|
|
4486
|
-
return /* @__PURE__ */ (0,
|
|
4578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4487
4579
|
Label,
|
|
4488
4580
|
{
|
|
4489
4581
|
id: progressLabelId,
|
|
@@ -4493,7 +4585,7 @@ var init_Progress = __esm({
|
|
|
4493
4585
|
}
|
|
4494
4586
|
);
|
|
4495
4587
|
}
|
|
4496
|
-
return /* @__PURE__ */ (0,
|
|
4588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4497
4589
|
Label,
|
|
4498
4590
|
{
|
|
4499
4591
|
id: progressLabelId,
|
|
@@ -4507,8 +4599,8 @@ var init_Progress = __esm({
|
|
|
4507
4599
|
DEFAULT_MIN_VALUE = 0;
|
|
4508
4600
|
DEFAULT_MAX_VALUE = 100;
|
|
4509
4601
|
Progress = ({ ref, ...props }) => {
|
|
4510
|
-
const progressId = (0,
|
|
4511
|
-
const progressLabelId = (0,
|
|
4602
|
+
const progressId = (0, import_react36.useId)();
|
|
4603
|
+
const progressLabelId = (0, import_react36.useId)();
|
|
4512
4604
|
const {
|
|
4513
4605
|
id,
|
|
4514
4606
|
label,
|
|
@@ -4533,7 +4625,7 @@ var init_Progress = __esm({
|
|
|
4533
4625
|
100
|
|
4534
4626
|
);
|
|
4535
4627
|
const barWidth = `${percentage}%`;
|
|
4536
|
-
const classes = (0,
|
|
4628
|
+
const classes = (0, import_dedupe42.default)("mobius", "mobius-progress", className, {
|
|
4537
4629
|
"--is-primary": variant === "primary",
|
|
4538
4630
|
"--is-secondary": variant === "secondary"
|
|
4539
4631
|
});
|
|
@@ -4543,7 +4635,7 @@ var init_Progress = __esm({
|
|
|
4543
4635
|
progressBarProps["aria-valuenow"] = value.toString();
|
|
4544
4636
|
progressBarProps["aria-valuetext"] = valueFormatter instanceof Function ? valueFormatter(value, minValue, maxValue) : barWidth;
|
|
4545
4637
|
const labelComponent = getLabelComponent(label, progressLabelId, showLabel);
|
|
4546
|
-
return /* @__PURE__ */ (0,
|
|
4638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
4547
4639
|
"div",
|
|
4548
4640
|
{
|
|
4549
4641
|
id: id || progressId,
|
|
@@ -4554,8 +4646,8 @@ var init_Progress = __esm({
|
|
|
4554
4646
|
"aria-labelledby": progressLabelId,
|
|
4555
4647
|
children: [
|
|
4556
4648
|
labelComponent,
|
|
4557
|
-
/* @__PURE__ */ (0,
|
|
4558
|
-
showValueLabel && /* @__PURE__ */ (0,
|
|
4649
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "mobius-progress__track", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "mobius-progress__bar", style: { width: barWidth } }) }),
|
|
4650
|
+
showValueLabel && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
|
|
4559
4651
|
]
|
|
4560
4652
|
}
|
|
4561
4653
|
);
|
|
@@ -4573,17 +4665,17 @@ var init_Progress2 = __esm({
|
|
|
4573
4665
|
});
|
|
4574
4666
|
|
|
4575
4667
|
// src/components/Radio/Radio.tsx
|
|
4576
|
-
var
|
|
4668
|
+
var import_dedupe43, import_react37, import_Radio, import_jsx_runtime53, Radio;
|
|
4577
4669
|
var init_Radio = __esm({
|
|
4578
4670
|
"src/components/Radio/Radio.tsx"() {
|
|
4579
4671
|
"use strict";
|
|
4580
4672
|
"use client";
|
|
4581
|
-
|
|
4582
|
-
|
|
4673
|
+
import_dedupe43 = __toESM(require("classnames/dedupe"));
|
|
4674
|
+
import_react37 = require("react");
|
|
4583
4675
|
init_ErrorMessage2();
|
|
4584
4676
|
init_Label2();
|
|
4585
4677
|
import_Radio = require("@simplybusiness/mobius/src/components/Radio/Radio.css");
|
|
4586
|
-
|
|
4678
|
+
import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4587
4679
|
Radio = ({ ref, ...props }) => {
|
|
4588
4680
|
const {
|
|
4589
4681
|
children,
|
|
@@ -4607,19 +4699,19 @@ var init_Radio = __esm({
|
|
|
4607
4699
|
const isMultiline = label && children;
|
|
4608
4700
|
const isControlled = selected !== void 0;
|
|
4609
4701
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
4610
|
-
const contentRef = (0,
|
|
4611
|
-
const prevOverflowRef = (0,
|
|
4702
|
+
const contentRef = (0, import_react37.useRef)(null);
|
|
4703
|
+
const prevOverflowRef = (0, import_react37.useRef)({
|
|
4612
4704
|
vertical: false,
|
|
4613
4705
|
horizontal: false
|
|
4614
4706
|
});
|
|
4615
|
-
const hasIconFirst = (0,
|
|
4616
|
-
if (!children ||
|
|
4617
|
-
const firstChild =
|
|
4618
|
-
if (!(0,
|
|
4707
|
+
const hasIconFirst = (0, import_react37.useMemo)(() => {
|
|
4708
|
+
if (!children || import_react37.Children.count(children) === 0) return false;
|
|
4709
|
+
const firstChild = import_react37.Children.toArray(children)[0];
|
|
4710
|
+
if (!(0, import_react37.isValidElement)(firstChild)) return false;
|
|
4619
4711
|
const props2 = firstChild.props;
|
|
4620
4712
|
return "icon" in props2 && props2.icon !== void 0;
|
|
4621
4713
|
}, [children]);
|
|
4622
|
-
(0,
|
|
4714
|
+
(0, import_react37.useLayoutEffect)(() => {
|
|
4623
4715
|
if (!contentRef.current || !onOverflow) return;
|
|
4624
4716
|
if (orientation === "vertical") {
|
|
4625
4717
|
return;
|
|
@@ -4648,13 +4740,13 @@ var init_Radio = __esm({
|
|
|
4648
4740
|
"--is-multiline": !!isMultiline,
|
|
4649
4741
|
"--is-required": isRequired
|
|
4650
4742
|
};
|
|
4651
|
-
const containerClasses = (0,
|
|
4743
|
+
const containerClasses = (0, import_dedupe43.default)(
|
|
4652
4744
|
"mobius-radio__label",
|
|
4653
4745
|
radioClasses,
|
|
4654
4746
|
className,
|
|
4655
4747
|
{ "--has-icon-first": hasIconFirst }
|
|
4656
4748
|
);
|
|
4657
|
-
const inputClasses = (0,
|
|
4749
|
+
const inputClasses = (0, import_dedupe43.default)("mobius-radio__input", radioClasses);
|
|
4658
4750
|
const { "aria-describedby": _ariaDescribedBy, ...rest } = otherProps;
|
|
4659
4751
|
const handleChange = (event) => {
|
|
4660
4752
|
if (setSelected) {
|
|
@@ -4668,9 +4760,9 @@ var init_Radio = __esm({
|
|
|
4668
4760
|
onChange(adaptedEvent);
|
|
4669
4761
|
}
|
|
4670
4762
|
};
|
|
4671
|
-
return /* @__PURE__ */ (0,
|
|
4672
|
-
/* @__PURE__ */ (0,
|
|
4673
|
-
/* @__PURE__ */ (0,
|
|
4763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
4764
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Label, { className: containerClasses, children: [
|
|
4765
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4674
4766
|
"input",
|
|
4675
4767
|
{
|
|
4676
4768
|
"aria-describedby": otherProps["aria-describedby"],
|
|
@@ -4687,12 +4779,12 @@ var init_Radio = __esm({
|
|
|
4687
4779
|
...rest
|
|
4688
4780
|
}
|
|
4689
4781
|
),
|
|
4690
|
-
isMultiline ? /* @__PURE__ */ (0,
|
|
4691
|
-
/* @__PURE__ */ (0,
|
|
4692
|
-
/* @__PURE__ */ (0,
|
|
4693
|
-
] }) : /* @__PURE__ */ (0,
|
|
4782
|
+
isMultiline ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { ref: contentRef, className: "mobius-radio__content--multiline", children: [
|
|
4783
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mobius-radio__content-first-line", children: label }),
|
|
4784
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mobius-radio__extra-content", children })
|
|
4785
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { ref: contentRef, className: "mobius-radio__content", children: label || children })
|
|
4694
4786
|
] }),
|
|
4695
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
4787
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorMessage, { errorMessage })
|
|
4696
4788
|
] });
|
|
4697
4789
|
};
|
|
4698
4790
|
Radio.displayName = "Radio";
|
|
@@ -4700,19 +4792,19 @@ var init_Radio = __esm({
|
|
|
4700
4792
|
});
|
|
4701
4793
|
|
|
4702
4794
|
// src/components/Radio/RadioGroup.tsx
|
|
4703
|
-
var
|
|
4795
|
+
var import_dedupe44, import_react38, import_jsx_runtime54, getDefaultVal, RadioGroup;
|
|
4704
4796
|
var init_RadioGroup = __esm({
|
|
4705
4797
|
"src/components/Radio/RadioGroup.tsx"() {
|
|
4706
4798
|
"use strict";
|
|
4707
4799
|
"use client";
|
|
4708
|
-
|
|
4709
|
-
|
|
4800
|
+
import_dedupe44 = __toESM(require("classnames/dedupe"));
|
|
4801
|
+
import_react38 = require("react");
|
|
4710
4802
|
init_hooks();
|
|
4711
4803
|
init_spaceDelimitedList();
|
|
4712
4804
|
init_ErrorMessage2();
|
|
4713
4805
|
init_Label2();
|
|
4714
4806
|
init_Stack2();
|
|
4715
|
-
|
|
4807
|
+
import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4716
4808
|
getDefaultVal = (children, defaultValue) => {
|
|
4717
4809
|
if (Array.isArray(children) && defaultValue) {
|
|
4718
4810
|
const option = children?.find((item) => item.props.value === defaultValue);
|
|
@@ -4740,15 +4832,15 @@ var init_RadioGroup = __esm({
|
|
|
4740
4832
|
...rest
|
|
4741
4833
|
} = props;
|
|
4742
4834
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
4743
|
-
const [selected, setSelected] = (0,
|
|
4744
|
-
const overflowsRef = (0,
|
|
4745
|
-
const [hasOverflow, setHasOverflow] = (0,
|
|
4746
|
-
(0,
|
|
4835
|
+
const [selected, setSelected] = (0, import_react38.useState)(defaultSelected);
|
|
4836
|
+
const overflowsRef = (0, import_react38.useRef)({});
|
|
4837
|
+
const [hasOverflow, setHasOverflow] = (0, import_react38.useState)(false);
|
|
4838
|
+
(0, import_react38.useEffect)(() => {
|
|
4747
4839
|
if (value !== void 0) {
|
|
4748
4840
|
setSelected(value);
|
|
4749
4841
|
}
|
|
4750
4842
|
}, [value]);
|
|
4751
|
-
const handleOverflow = (0,
|
|
4843
|
+
const handleOverflow = (0, import_react38.useCallback)(
|
|
4752
4844
|
(radioValue, overflow) => {
|
|
4753
4845
|
overflowsRef.current = {
|
|
4754
4846
|
...overflowsRef.current,
|
|
@@ -4772,26 +4864,26 @@ var init_RadioGroup = __esm({
|
|
|
4772
4864
|
[`--is-${effectiveOrientation}`]: true,
|
|
4773
4865
|
[className || ""]: true
|
|
4774
4866
|
};
|
|
4775
|
-
const radioGroupClasses = (0,
|
|
4867
|
+
const radioGroupClasses = (0, import_dedupe44.default)(
|
|
4776
4868
|
"mobius",
|
|
4777
4869
|
"mobius-radio-group",
|
|
4778
4870
|
radioClasses,
|
|
4779
4871
|
validationClasses
|
|
4780
4872
|
);
|
|
4781
|
-
const radioWrapperClasses = (0,
|
|
4873
|
+
const radioWrapperClasses = (0, import_dedupe44.default)("mobius-radio__wrapper", {
|
|
4782
4874
|
[`--is-${effectiveOrientation}`]: true
|
|
4783
4875
|
});
|
|
4784
|
-
const labelClasses = (0,
|
|
4785
|
-
const errorMessageId = (0,
|
|
4786
|
-
const defaultNameAttrId = (0,
|
|
4876
|
+
const labelClasses = (0, import_dedupe44.default)(radioClasses, validationClasses);
|
|
4877
|
+
const errorMessageId = (0, import_react38.useId)();
|
|
4878
|
+
const defaultNameAttrId = (0, import_react38.useId)();
|
|
4787
4879
|
const nameAttribute = name || defaultNameAttrId;
|
|
4788
4880
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4789
4881
|
const describedBy = spaceDelimitedList([
|
|
4790
4882
|
shouldErrorMessageShow,
|
|
4791
4883
|
props["aria-describedby"]
|
|
4792
4884
|
]);
|
|
4793
|
-
const labelId = (0,
|
|
4794
|
-
return /* @__PURE__ */ (0,
|
|
4885
|
+
const labelId = (0, import_react38.useId)();
|
|
4886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4795
4887
|
"div",
|
|
4796
4888
|
{
|
|
4797
4889
|
...rest,
|
|
@@ -4807,12 +4899,12 @@ var init_RadioGroup = __esm({
|
|
|
4807
4899
|
ref,
|
|
4808
4900
|
className: radioGroupClasses,
|
|
4809
4901
|
role: "radiogroup",
|
|
4810
|
-
children: /* @__PURE__ */ (0,
|
|
4811
|
-
label && /* @__PURE__ */ (0,
|
|
4812
|
-
/* @__PURE__ */ (0,
|
|
4813
|
-
if ((0,
|
|
4902
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Stack, { gap: "xs", children: [
|
|
4903
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
4904
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: radioWrapperClasses, children: import_react38.Children.map(children, (child) => {
|
|
4905
|
+
if ((0, import_react38.isValidElement)(child)) {
|
|
4814
4906
|
const childValue = child.props.value;
|
|
4815
|
-
return (0,
|
|
4907
|
+
return (0, import_react38.cloneElement)(
|
|
4816
4908
|
child,
|
|
4817
4909
|
{
|
|
4818
4910
|
orientation: effectiveOrientation,
|
|
@@ -4830,7 +4922,7 @@ var init_RadioGroup = __esm({
|
|
|
4830
4922
|
}
|
|
4831
4923
|
return child;
|
|
4832
4924
|
}) }),
|
|
4833
|
-
/* @__PURE__ */ (0,
|
|
4925
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4834
4926
|
] })
|
|
4835
4927
|
}
|
|
4836
4928
|
);
|
|
@@ -4849,47 +4941,47 @@ var init_Radio2 = __esm({
|
|
|
4849
4941
|
});
|
|
4850
4942
|
|
|
4851
4943
|
// src/components/Segment/SegmentGroup.tsx
|
|
4852
|
-
var
|
|
4944
|
+
var import_dedupe45, import_jsx_runtime55, SegmentGroup;
|
|
4853
4945
|
var init_SegmentGroup = __esm({
|
|
4854
4946
|
"src/components/Segment/SegmentGroup.tsx"() {
|
|
4855
4947
|
"use strict";
|
|
4856
|
-
|
|
4857
|
-
|
|
4948
|
+
import_dedupe45 = __toESM(require("classnames/dedupe"));
|
|
4949
|
+
import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4858
4950
|
SegmentGroup = (props) => {
|
|
4859
4951
|
const { children, horizontal, gap, className, ...rest } = props;
|
|
4860
4952
|
const gapClass = gap ? `gap-${gap}` : "";
|
|
4861
|
-
const classes = (0,
|
|
4953
|
+
const classes = (0, import_dedupe45.default)(
|
|
4862
4954
|
"mobius",
|
|
4863
4955
|
"mobius-segment-group",
|
|
4864
4956
|
className,
|
|
4865
4957
|
{ "--is-horizontal": horizontal },
|
|
4866
4958
|
gapClass
|
|
4867
4959
|
);
|
|
4868
|
-
return /* @__PURE__ */ (0,
|
|
4960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: classes, ...rest, children });
|
|
4869
4961
|
};
|
|
4870
4962
|
SegmentGroup.displayName = "SegmentGroup";
|
|
4871
4963
|
}
|
|
4872
4964
|
});
|
|
4873
4965
|
|
|
4874
4966
|
// src/components/Segment/Segment.tsx
|
|
4875
|
-
var
|
|
4967
|
+
var import_dedupe46, import_Segment, import_jsx_runtime56, Segment;
|
|
4876
4968
|
var init_Segment = __esm({
|
|
4877
4969
|
"src/components/Segment/Segment.tsx"() {
|
|
4878
4970
|
"use strict";
|
|
4879
|
-
|
|
4971
|
+
import_dedupe46 = __toESM(require("classnames/dedupe"));
|
|
4880
4972
|
import_Segment = require("@simplybusiness/mobius/src/components/Segment/Segment.css");
|
|
4881
|
-
|
|
4973
|
+
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4882
4974
|
Segment = (props) => {
|
|
4883
4975
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
4884
|
-
const classes = (0,
|
|
4976
|
+
const classes = (0, import_dedupe46.default)(
|
|
4885
4977
|
"mobius",
|
|
4886
4978
|
"mobius-segment",
|
|
4887
4979
|
colour,
|
|
4888
4980
|
{ inverted },
|
|
4889
4981
|
className
|
|
4890
4982
|
);
|
|
4891
|
-
return /* @__PURE__ */ (0,
|
|
4892
|
-
heading && /* @__PURE__ */ (0,
|
|
4983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: classes, ...rest, children: [
|
|
4984
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "mobius-segment__heading", children: heading }),
|
|
4893
4985
|
children
|
|
4894
4986
|
] });
|
|
4895
4987
|
};
|
|
@@ -4907,14 +4999,14 @@ var init_Segment2 = __esm({
|
|
|
4907
4999
|
});
|
|
4908
5000
|
|
|
4909
5001
|
// src/components/Select/Select.tsx
|
|
4910
|
-
var import_icons13,
|
|
5002
|
+
var import_icons13, import_dedupe47, import_react39, import_Select, import_jsx_runtime57, Select;
|
|
4911
5003
|
var init_Select = __esm({
|
|
4912
5004
|
"src/components/Select/Select.tsx"() {
|
|
4913
5005
|
"use strict";
|
|
4914
5006
|
"use client";
|
|
4915
5007
|
import_icons13 = require("@simplybusiness/icons");
|
|
4916
|
-
|
|
4917
|
-
|
|
5008
|
+
import_dedupe47 = __toESM(require("classnames/dedupe"));
|
|
5009
|
+
import_react39 = require("react");
|
|
4918
5010
|
init_hooks();
|
|
4919
5011
|
init_useLabel2();
|
|
4920
5012
|
init_spaceDelimitedList();
|
|
@@ -4923,7 +5015,7 @@ var init_Select = __esm({
|
|
|
4923
5015
|
init_Label2();
|
|
4924
5016
|
init_Stack2();
|
|
4925
5017
|
import_Select = require("@simplybusiness/mobius/src/components/Select/Select.css");
|
|
4926
|
-
|
|
5018
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4927
5019
|
Select = ({ ref, ...props }) => {
|
|
4928
5020
|
const {
|
|
4929
5021
|
label,
|
|
@@ -4944,24 +5036,24 @@ var init_Select = __esm({
|
|
|
4944
5036
|
"--is-required": typeof isRequired === "boolean" && isRequired,
|
|
4945
5037
|
"--is-optional": typeof isRequired === "boolean" && !isRequired
|
|
4946
5038
|
};
|
|
4947
|
-
const sharedClasses = (0,
|
|
4948
|
-
const wrapperClasses = (0,
|
|
5039
|
+
const sharedClasses = (0, import_dedupe47.default)(validationClasses, stateClasses);
|
|
5040
|
+
const wrapperClasses = (0, import_dedupe47.default)(
|
|
4949
5041
|
"mobius-select__wrapper",
|
|
4950
5042
|
sharedClasses,
|
|
4951
5043
|
otherProps.className
|
|
4952
5044
|
);
|
|
4953
|
-
const selectClasses = (0,
|
|
5045
|
+
const selectClasses = (0, import_dedupe47.default)(
|
|
4954
5046
|
"mobius-select",
|
|
4955
5047
|
sharedClasses,
|
|
4956
5048
|
otherProps.className
|
|
4957
5049
|
);
|
|
4958
|
-
const labelClasses = (0,
|
|
5050
|
+
const labelClasses = (0, import_dedupe47.default)(
|
|
4959
5051
|
"mobius-label",
|
|
4960
5052
|
sharedClasses,
|
|
4961
5053
|
otherProps.className
|
|
4962
5054
|
);
|
|
4963
|
-
const iconClasses = (0,
|
|
4964
|
-
const errorMessageId = (0,
|
|
5055
|
+
const iconClasses = (0, import_dedupe47.default)("mobius-select__icon", sharedClasses);
|
|
5056
|
+
const errorMessageId = (0, import_react39.useId)();
|
|
4965
5057
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4966
5058
|
const describedBy = spaceDelimitedList([
|
|
4967
5059
|
shouldErrorMessageShow,
|
|
@@ -4972,10 +5064,10 @@ var init_Select = __esm({
|
|
|
4972
5064
|
onChange(e);
|
|
4973
5065
|
}
|
|
4974
5066
|
};
|
|
4975
|
-
return /* @__PURE__ */ (0,
|
|
4976
|
-
label && /* @__PURE__ */ (0,
|
|
4977
|
-
/* @__PURE__ */ (0,
|
|
4978
|
-
/* @__PURE__ */ (0,
|
|
5067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
|
|
5068
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
5069
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: wrapperClasses, children: [
|
|
5070
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4979
5071
|
"select",
|
|
4980
5072
|
{
|
|
4981
5073
|
...otherProps,
|
|
@@ -4991,9 +5083,9 @@ var init_Select = __esm({
|
|
|
4991
5083
|
onChange: handleChange
|
|
4992
5084
|
}
|
|
4993
5085
|
),
|
|
4994
|
-
/* @__PURE__ */ (0,
|
|
5086
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { icon: import_icons13.chevronDown }) })
|
|
4995
5087
|
] }),
|
|
4996
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
5088
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4997
5089
|
] });
|
|
4998
5090
|
};
|
|
4999
5091
|
Select.displayName = "Select";
|
|
@@ -5015,27 +5107,27 @@ function numberFormatter(value, formatOptions, locale = navigator.languages?.[0]
|
|
|
5015
5107
|
}
|
|
5016
5108
|
return new Intl.NumberFormat(locale, formatOptions).format(+(value || 0));
|
|
5017
5109
|
}
|
|
5018
|
-
var
|
|
5110
|
+
var import_react40;
|
|
5019
5111
|
var init_helpers = __esm({
|
|
5020
5112
|
"src/components/Slider/helpers.ts"() {
|
|
5021
5113
|
"use strict";
|
|
5022
|
-
|
|
5114
|
+
import_react40 = require("react");
|
|
5023
5115
|
}
|
|
5024
5116
|
});
|
|
5025
5117
|
|
|
5026
5118
|
// src/components/Slider/Slider.tsx
|
|
5027
|
-
var
|
|
5119
|
+
var import_dedupe48, import_react41, import_Slider, import_jsx_runtime58, Slider;
|
|
5028
5120
|
var init_Slider = __esm({
|
|
5029
5121
|
"src/components/Slider/Slider.tsx"() {
|
|
5030
5122
|
"use strict";
|
|
5031
5123
|
"use client";
|
|
5032
|
-
|
|
5033
|
-
|
|
5124
|
+
import_dedupe48 = __toESM(require("classnames/dedupe"));
|
|
5125
|
+
import_react41 = require("react");
|
|
5034
5126
|
init_hooks();
|
|
5035
5127
|
init_Label2();
|
|
5036
5128
|
init_helpers();
|
|
5037
5129
|
import_Slider = require("@simplybusiness/mobius/src/components/Slider/Slider.css");
|
|
5038
|
-
|
|
5130
|
+
import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5039
5131
|
Slider = (props) => {
|
|
5040
5132
|
const {
|
|
5041
5133
|
id,
|
|
@@ -5056,11 +5148,11 @@ var init_Slider = __esm({
|
|
|
5056
5148
|
formatOptions,
|
|
5057
5149
|
isDisabled = false
|
|
5058
5150
|
} = props;
|
|
5059
|
-
const trackRef = (0,
|
|
5060
|
-
const [currentValue, setCurrentValue] = (0,
|
|
5151
|
+
const trackRef = (0, import_react41.useRef)(null);
|
|
5152
|
+
const [currentValue, setCurrentValue] = (0, import_react41.useState)(
|
|
5061
5153
|
value || defaultValue || 0
|
|
5062
5154
|
);
|
|
5063
|
-
const [isDragging, setIsDraggging] = (0,
|
|
5155
|
+
const [isDragging, setIsDraggging] = (0, import_react41.useState)(false);
|
|
5064
5156
|
const { labelProps, fieldProps } = useLabel({
|
|
5065
5157
|
id,
|
|
5066
5158
|
label,
|
|
@@ -5068,7 +5160,7 @@ var init_Slider = __esm({
|
|
|
5068
5160
|
"aria-labelledby": ariaLabelledBy
|
|
5069
5161
|
});
|
|
5070
5162
|
const formattedValue = numberFormatter(currentValue, formatOptions);
|
|
5071
|
-
const classes = (0,
|
|
5163
|
+
const classes = (0, import_dedupe48.default)("mobius", "mobius-slider", className, {
|
|
5072
5164
|
"--is-disabled": isDisabled,
|
|
5073
5165
|
"--is-primary": variant === "primary",
|
|
5074
5166
|
"--is-secondary": variant === "secondary",
|
|
@@ -5090,12 +5182,12 @@ var init_Slider = __esm({
|
|
|
5090
5182
|
onChangeEnd(currentValue);
|
|
5091
5183
|
}
|
|
5092
5184
|
};
|
|
5093
|
-
return /* @__PURE__ */ (0,
|
|
5094
|
-
/* @__PURE__ */ (0,
|
|
5095
|
-
label && /* @__PURE__ */ (0,
|
|
5096
|
-
label && /* @__PURE__ */ (0,
|
|
5185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: classes, children: [
|
|
5186
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "mobius-slider__label-wrapper", children: [
|
|
5187
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Label, { ...labelProps, children: label }),
|
|
5188
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("output", { style: { flex: "1 0 auto", textAlign: "end" }, children: formattedValue })
|
|
5097
5189
|
] }),
|
|
5098
|
-
/* @__PURE__ */ (0,
|
|
5190
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { ref: trackRef, className: "mobius-slider__track-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5099
5191
|
"input",
|
|
5100
5192
|
{
|
|
5101
5193
|
className: "mobius-slider__track",
|
|
@@ -5114,9 +5206,9 @@ var init_Slider = __esm({
|
|
|
5114
5206
|
...fieldProps
|
|
5115
5207
|
}
|
|
5116
5208
|
) }),
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
5118
|
-
/* @__PURE__ */ (0,
|
|
5119
|
-
/* @__PURE__ */ (0,
|
|
5209
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "mobius-slider__labels", children: [
|
|
5210
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "mobius-slider__min-label", "data-testid": "min-label", children: minLabel }),
|
|
5211
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "mobius-slider__max-label", "data-testid": "max-label", children: maxLabel })
|
|
5120
5212
|
] })
|
|
5121
5213
|
] });
|
|
5122
5214
|
};
|
|
@@ -5132,19 +5224,19 @@ var init_Slider2 = __esm({
|
|
|
5132
5224
|
});
|
|
5133
5225
|
|
|
5134
5226
|
// src/components/SVG/SVG.tsx
|
|
5135
|
-
var
|
|
5227
|
+
var import_react42, import_dedupe49, import_jsx_runtime59, SVG;
|
|
5136
5228
|
var init_SVG = __esm({
|
|
5137
5229
|
"src/components/SVG/SVG.tsx"() {
|
|
5138
5230
|
"use strict";
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5231
|
+
import_react42 = require("react");
|
|
5232
|
+
import_dedupe49 = __toESM(require("classnames/dedupe"));
|
|
5233
|
+
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5142
5234
|
SVG = ({ ref, ...props }) => {
|
|
5143
5235
|
const { children, className, ...otherProps } = props;
|
|
5144
|
-
const classes = (0,
|
|
5145
|
-
const svgNode =
|
|
5236
|
+
const classes = (0, import_dedupe49.default)("mobius", "mobius-svg", className);
|
|
5237
|
+
const svgNode = import_react42.Children.only(children);
|
|
5146
5238
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
5147
|
-
return /* @__PURE__ */ (0,
|
|
5239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5148
5240
|
"svg",
|
|
5149
5241
|
{
|
|
5150
5242
|
viewBox,
|
|
@@ -5169,16 +5261,16 @@ var init_SVG2 = __esm({
|
|
|
5169
5261
|
});
|
|
5170
5262
|
|
|
5171
5263
|
// src/components/Switch/Switch.tsx
|
|
5172
|
-
var
|
|
5264
|
+
var import_react43, import_dedupe50, import_Switch, import_jsx_runtime60, Switch;
|
|
5173
5265
|
var init_Switch = __esm({
|
|
5174
5266
|
"src/components/Switch/Switch.tsx"() {
|
|
5175
5267
|
"use strict";
|
|
5176
5268
|
"use client";
|
|
5177
|
-
|
|
5178
|
-
|
|
5269
|
+
import_react43 = require("react");
|
|
5270
|
+
import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
5179
5271
|
init_VisuallyHidden2();
|
|
5180
5272
|
import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
|
|
5181
|
-
|
|
5273
|
+
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5182
5274
|
Switch = ({ ref, ...props }) => {
|
|
5183
5275
|
const {
|
|
5184
5276
|
checked = false,
|
|
@@ -5187,11 +5279,11 @@ var init_Switch = __esm({
|
|
|
5187
5279
|
isDisabled = false,
|
|
5188
5280
|
...otherProps
|
|
5189
5281
|
} = props;
|
|
5190
|
-
const [enabled, setEnabled] = (0,
|
|
5191
|
-
(0,
|
|
5282
|
+
const [enabled, setEnabled] = (0, import_react43.useState)(checked);
|
|
5283
|
+
(0, import_react43.useEffect)(() => {
|
|
5192
5284
|
setEnabled(checked);
|
|
5193
5285
|
}, [checked]);
|
|
5194
|
-
const classes = (0,
|
|
5286
|
+
const classes = (0, import_dedupe50.default)(
|
|
5195
5287
|
"mobius",
|
|
5196
5288
|
"mobius-switch",
|
|
5197
5289
|
{
|
|
@@ -5206,9 +5298,9 @@ var init_Switch = __esm({
|
|
|
5206
5298
|
onChange(event);
|
|
5207
5299
|
}
|
|
5208
5300
|
};
|
|
5209
|
-
return /* @__PURE__ */ (0,
|
|
5210
|
-
/* @__PURE__ */ (0,
|
|
5211
|
-
/* @__PURE__ */ (0,
|
|
5301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("label", { ref, className: classes, children: [
|
|
5302
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { children: enabled ? "On" : "Off" }) }),
|
|
5303
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5212
5304
|
"input",
|
|
5213
5305
|
{
|
|
5214
5306
|
type: "checkbox",
|
|
@@ -5219,7 +5311,7 @@ var init_Switch = __esm({
|
|
|
5219
5311
|
...otherProps
|
|
5220
5312
|
}
|
|
5221
5313
|
),
|
|
5222
|
-
/* @__PURE__ */ (0,
|
|
5314
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "mobius-switch__slider" })
|
|
5223
5315
|
] });
|
|
5224
5316
|
};
|
|
5225
5317
|
Switch.displayName = "Switch";
|
|
@@ -5235,114 +5327,114 @@ var init_Switch2 = __esm({
|
|
|
5235
5327
|
});
|
|
5236
5328
|
|
|
5237
5329
|
// src/components/Table/Table.tsx
|
|
5238
|
-
var
|
|
5330
|
+
var import_dedupe51, import_Table, import_jsx_runtime61, Table;
|
|
5239
5331
|
var init_Table = __esm({
|
|
5240
5332
|
"src/components/Table/Table.tsx"() {
|
|
5241
5333
|
"use strict";
|
|
5242
|
-
|
|
5334
|
+
import_dedupe51 = __toESM(require("classnames/dedupe"));
|
|
5243
5335
|
import_Table = require("@simplybusiness/mobius/src/components/Table/Table.css");
|
|
5244
|
-
|
|
5336
|
+
import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5245
5337
|
Table = ({ ref, ...props }) => {
|
|
5246
|
-
const classes = (0,
|
|
5247
|
-
return /* @__PURE__ */ (0,
|
|
5338
|
+
const classes = (0, import_dedupe51.default)("mobius", "mobius-table", props.className);
|
|
5339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("table", { ref, ...props, className: classes });
|
|
5248
5340
|
};
|
|
5249
5341
|
Table.displayName = "Table";
|
|
5250
5342
|
}
|
|
5251
5343
|
});
|
|
5252
5344
|
|
|
5253
5345
|
// src/components/Table/Head.tsx
|
|
5254
|
-
var
|
|
5346
|
+
var import_dedupe52, import_jsx_runtime62, Head;
|
|
5255
5347
|
var init_Head = __esm({
|
|
5256
5348
|
"src/components/Table/Head.tsx"() {
|
|
5257
5349
|
"use strict";
|
|
5258
|
-
|
|
5259
|
-
|
|
5350
|
+
import_dedupe52 = __toESM(require("classnames/dedupe"));
|
|
5351
|
+
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5260
5352
|
Head = ({ ref, ...props }) => {
|
|
5261
|
-
const classes = (0,
|
|
5262
|
-
return /* @__PURE__ */ (0,
|
|
5353
|
+
const classes = (0, import_dedupe52.default)("mobius", "mobius-table__head", props.className);
|
|
5354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("thead", { ref, ...props, className: classes });
|
|
5263
5355
|
};
|
|
5264
5356
|
Head.displayName = "Table.Head";
|
|
5265
5357
|
}
|
|
5266
5358
|
});
|
|
5267
5359
|
|
|
5268
5360
|
// src/components/Table/Body.tsx
|
|
5269
|
-
var
|
|
5361
|
+
var import_dedupe53, import_jsx_runtime63, Body;
|
|
5270
5362
|
var init_Body = __esm({
|
|
5271
5363
|
"src/components/Table/Body.tsx"() {
|
|
5272
5364
|
"use strict";
|
|
5273
|
-
|
|
5274
|
-
|
|
5365
|
+
import_dedupe53 = __toESM(require("classnames/dedupe"));
|
|
5366
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5275
5367
|
Body = ({ ref, ...props }) => {
|
|
5276
|
-
const classes = (0,
|
|
5277
|
-
return /* @__PURE__ */ (0,
|
|
5368
|
+
const classes = (0, import_dedupe53.default)("mobius", "mobius-table__body", props.className);
|
|
5369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("tbody", { ref, ...props, className: classes });
|
|
5278
5370
|
};
|
|
5279
5371
|
Body.displayName = "Table.Body";
|
|
5280
5372
|
}
|
|
5281
5373
|
});
|
|
5282
5374
|
|
|
5283
5375
|
// src/components/Table/Foot.tsx
|
|
5284
|
-
var
|
|
5376
|
+
var import_dedupe54, import_jsx_runtime64, Foot;
|
|
5285
5377
|
var init_Foot = __esm({
|
|
5286
5378
|
"src/components/Table/Foot.tsx"() {
|
|
5287
5379
|
"use strict";
|
|
5288
|
-
|
|
5289
|
-
|
|
5380
|
+
import_dedupe54 = __toESM(require("classnames/dedupe"));
|
|
5381
|
+
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5290
5382
|
Foot = ({ ref, ...props }) => {
|
|
5291
|
-
const classes = (0,
|
|
5292
|
-
return /* @__PURE__ */ (0,
|
|
5383
|
+
const classes = (0, import_dedupe54.default)("mobius", "mobius-table__foot", props.className);
|
|
5384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("tfoot", { ref, ...props, className: classes });
|
|
5293
5385
|
};
|
|
5294
5386
|
Foot.displayName = "Table.Foot";
|
|
5295
5387
|
}
|
|
5296
5388
|
});
|
|
5297
5389
|
|
|
5298
5390
|
// src/components/Table/Row.tsx
|
|
5299
|
-
var
|
|
5391
|
+
var import_dedupe55, import_jsx_runtime65, Row;
|
|
5300
5392
|
var init_Row = __esm({
|
|
5301
5393
|
"src/components/Table/Row.tsx"() {
|
|
5302
5394
|
"use strict";
|
|
5303
|
-
|
|
5304
|
-
|
|
5395
|
+
import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
5396
|
+
import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5305
5397
|
Row = ({ ref, ...props }) => {
|
|
5306
|
-
const classes = (0,
|
|
5307
|
-
return /* @__PURE__ */ (0,
|
|
5398
|
+
const classes = (0, import_dedupe55.default)("mobius", "mobius-table__row", props.className);
|
|
5399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("tr", { ref, ...props, className: classes });
|
|
5308
5400
|
};
|
|
5309
5401
|
Row.displayName = "Table.Row";
|
|
5310
5402
|
}
|
|
5311
5403
|
});
|
|
5312
5404
|
|
|
5313
5405
|
// src/components/Table/HeaderCell.tsx
|
|
5314
|
-
var
|
|
5406
|
+
var import_dedupe56, import_jsx_runtime66, HeaderCell;
|
|
5315
5407
|
var init_HeaderCell = __esm({
|
|
5316
5408
|
"src/components/Table/HeaderCell.tsx"() {
|
|
5317
5409
|
"use strict";
|
|
5318
|
-
|
|
5319
|
-
|
|
5410
|
+
import_dedupe56 = __toESM(require("classnames/dedupe"));
|
|
5411
|
+
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5320
5412
|
HeaderCell = ({ ref, ...props }) => {
|
|
5321
|
-
const classes = (0,
|
|
5413
|
+
const classes = (0, import_dedupe56.default)(
|
|
5322
5414
|
"mobius",
|
|
5323
5415
|
"mobius-table__head-cell",
|
|
5324
5416
|
props.className
|
|
5325
5417
|
);
|
|
5326
|
-
return /* @__PURE__ */ (0,
|
|
5418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("th", { ...props, ref, className: classes });
|
|
5327
5419
|
};
|
|
5328
5420
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
5329
5421
|
}
|
|
5330
5422
|
});
|
|
5331
5423
|
|
|
5332
5424
|
// src/components/Table/Cell.tsx
|
|
5333
|
-
var
|
|
5425
|
+
var import_dedupe57, import_jsx_runtime67, Cell;
|
|
5334
5426
|
var init_Cell = __esm({
|
|
5335
5427
|
"src/components/Table/Cell.tsx"() {
|
|
5336
5428
|
"use strict";
|
|
5337
|
-
|
|
5338
|
-
|
|
5429
|
+
import_dedupe57 = __toESM(require("classnames/dedupe"));
|
|
5430
|
+
import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5339
5431
|
Cell = ({ ref, ...props }) => {
|
|
5340
|
-
const classes = (0,
|
|
5432
|
+
const classes = (0, import_dedupe57.default)(
|
|
5341
5433
|
"mobius",
|
|
5342
5434
|
"mobius-table__body-cell",
|
|
5343
5435
|
props.className
|
|
5344
5436
|
);
|
|
5345
|
-
return /* @__PURE__ */ (0,
|
|
5437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("td", { ref, ...props, className: classes });
|
|
5346
5438
|
};
|
|
5347
5439
|
Cell.displayName = "Table.Cell";
|
|
5348
5440
|
}
|
|
@@ -5372,37 +5464,6 @@ var init_Table2 = __esm({
|
|
|
5372
5464
|
}
|
|
5373
5465
|
});
|
|
5374
5466
|
|
|
5375
|
-
// src/components/Text/Text.tsx
|
|
5376
|
-
var import_dedupe57, import_Text, import_jsx_runtime66, getElementType, Text;
|
|
5377
|
-
var init_Text = __esm({
|
|
5378
|
-
"src/components/Text/Text.tsx"() {
|
|
5379
|
-
"use strict";
|
|
5380
|
-
import_dedupe57 = __toESM(require("classnames/dedupe"));
|
|
5381
|
-
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
5382
|
-
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5383
|
-
getElementType = (variant, elementType) => {
|
|
5384
|
-
if (variant) {
|
|
5385
|
-
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
5386
|
-
}
|
|
5387
|
-
return elementType || "p";
|
|
5388
|
-
};
|
|
5389
|
-
Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
5390
|
-
const { variant, className, spacing, ...otherProps } = props;
|
|
5391
|
-
const elementType = getElementType(variant, Component);
|
|
5392
|
-
const variantType = variant || elementType;
|
|
5393
|
-
const classes = (0, import_dedupe57.default)(
|
|
5394
|
-
"mobius",
|
|
5395
|
-
"mobius-text",
|
|
5396
|
-
{ [`--is-${variantType}`]: variantType },
|
|
5397
|
-
{ [`--has-line-height-${spacing}`]: spacing },
|
|
5398
|
-
className
|
|
5399
|
-
);
|
|
5400
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
5401
|
-
};
|
|
5402
|
-
Text.displayName = "Text";
|
|
5403
|
-
}
|
|
5404
|
-
});
|
|
5405
|
-
|
|
5406
5467
|
// src/components/Text/index.tsx
|
|
5407
5468
|
var init_Text2 = __esm({
|
|
5408
5469
|
"src/components/Text/index.tsx"() {
|
|
@@ -5412,12 +5473,12 @@ var init_Text2 = __esm({
|
|
|
5412
5473
|
});
|
|
5413
5474
|
|
|
5414
5475
|
// src/components/TextAreaInput/TextAreaInput.tsx
|
|
5415
|
-
var import_dedupe58,
|
|
5476
|
+
var import_dedupe58, import_jsx_runtime68, TextAreaInput;
|
|
5416
5477
|
var init_TextAreaInput = __esm({
|
|
5417
5478
|
"src/components/TextAreaInput/TextAreaInput.tsx"() {
|
|
5418
5479
|
"use strict";
|
|
5419
5480
|
import_dedupe58 = __toESM(require("classnames/dedupe"));
|
|
5420
|
-
|
|
5481
|
+
import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5421
5482
|
TextAreaInput = ({ ref, ...props }) => {
|
|
5422
5483
|
const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
|
|
5423
5484
|
const classes = (0, import_dedupe58.default)(
|
|
@@ -5430,7 +5491,7 @@ var init_TextAreaInput = __esm({
|
|
|
5430
5491
|
},
|
|
5431
5492
|
otherProps.className
|
|
5432
5493
|
);
|
|
5433
|
-
return /* @__PURE__ */ (0,
|
|
5494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5434
5495
|
"textarea",
|
|
5435
5496
|
{
|
|
5436
5497
|
ref,
|
|
@@ -5454,7 +5515,7 @@ var init_TextAreaInput2 = __esm({
|
|
|
5454
5515
|
});
|
|
5455
5516
|
|
|
5456
5517
|
// src/components/TextArea/TextArea.tsx
|
|
5457
|
-
var import_dedupe59, import_TextArea,
|
|
5518
|
+
var import_dedupe59, import_TextArea, import_jsx_runtime69, TextArea;
|
|
5458
5519
|
var init_TextArea = __esm({
|
|
5459
5520
|
"src/components/TextArea/TextArea.tsx"() {
|
|
5460
5521
|
"use strict";
|
|
@@ -5466,7 +5527,7 @@ var init_TextArea = __esm({
|
|
|
5466
5527
|
init_Stack2();
|
|
5467
5528
|
init_TextAreaInput2();
|
|
5468
5529
|
import_TextArea = require("@simplybusiness/mobius/src/components/TextArea/TextArea.css");
|
|
5469
|
-
|
|
5530
|
+
import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5470
5531
|
TextArea = ({ ref, ...props }) => {
|
|
5471
5532
|
const {
|
|
5472
5533
|
isDisabled,
|
|
@@ -5486,9 +5547,9 @@ var init_TextArea = __esm({
|
|
|
5486
5547
|
},
|
|
5487
5548
|
validationClasses
|
|
5488
5549
|
);
|
|
5489
|
-
return /* @__PURE__ */ (0,
|
|
5490
|
-
label && /* @__PURE__ */ (0,
|
|
5491
|
-
/* @__PURE__ */ (0,
|
|
5550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Stack, { className: classes, gap: "xs", children: [
|
|
5551
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Label, { ...labelProps, className: labelClasses, children: props.label }),
|
|
5552
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5492
5553
|
TextAreaInput,
|
|
5493
5554
|
{
|
|
5494
5555
|
...otherProps,
|
|
@@ -5499,7 +5560,7 @@ var init_TextArea = __esm({
|
|
|
5499
5560
|
"aria-invalid": errorMessage != null
|
|
5500
5561
|
}
|
|
5501
5562
|
),
|
|
5502
|
-
/* @__PURE__ */ (0,
|
|
5563
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
5503
5564
|
] });
|
|
5504
5565
|
};
|
|
5505
5566
|
TextArea.displayName = "TextArea";
|
|
@@ -5514,53 +5575,6 @@ var init_TextArea2 = __esm({
|
|
|
5514
5575
|
}
|
|
5515
5576
|
});
|
|
5516
5577
|
|
|
5517
|
-
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
5518
|
-
var import_react43, import_jsx_runtime69, isHTML, TextOrHTML;
|
|
5519
|
-
var init_TextOrHTML = __esm({
|
|
5520
|
-
"src/components/TextOrHTML/TextOrHTML.tsx"() {
|
|
5521
|
-
"use strict";
|
|
5522
|
-
import_react43 = require("react");
|
|
5523
|
-
init_Text();
|
|
5524
|
-
import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5525
|
-
isHTML = (text) => /^\s*<[a-z]/i.test(text);
|
|
5526
|
-
TextOrHTML = ({
|
|
5527
|
-
ref,
|
|
5528
|
-
text,
|
|
5529
|
-
htmlClassName,
|
|
5530
|
-
htmlElementType,
|
|
5531
|
-
textWrapper = false,
|
|
5532
|
-
autoDetect = false,
|
|
5533
|
-
...textProps
|
|
5534
|
-
}) => {
|
|
5535
|
-
const textIsHTML = autoDetect && isHTML(text);
|
|
5536
|
-
const shouldWrapInText = autoDetect ? textWrapper || !textIsHTML : textWrapper;
|
|
5537
|
-
const resolvedElementType = htmlElementType ?? (textIsHTML ? "div" : "span");
|
|
5538
|
-
const DangerousComponent = resolvedElementType;
|
|
5539
|
-
const dangerousHTML = (0, import_react43.useMemo)(() => ({ __html: text }), [text]);
|
|
5540
|
-
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5541
|
-
DangerousComponent,
|
|
5542
|
-
{
|
|
5543
|
-
className: htmlClassName,
|
|
5544
|
-
dangerouslySetInnerHTML: dangerousHTML
|
|
5545
|
-
}
|
|
5546
|
-
);
|
|
5547
|
-
if (shouldWrapInText) {
|
|
5548
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
5549
|
-
}
|
|
5550
|
-
return dangerousElement;
|
|
5551
|
-
};
|
|
5552
|
-
TextOrHTML.displayName = "TextOrHTML";
|
|
5553
|
-
}
|
|
5554
|
-
});
|
|
5555
|
-
|
|
5556
|
-
// src/components/TextOrHTML/index.tsx
|
|
5557
|
-
var init_TextOrHTML2 = __esm({
|
|
5558
|
-
"src/components/TextOrHTML/index.tsx"() {
|
|
5559
|
-
"use strict";
|
|
5560
|
-
init_TextOrHTML();
|
|
5561
|
-
}
|
|
5562
|
-
});
|
|
5563
|
-
|
|
5564
5578
|
// src/components/Title/Title.tsx
|
|
5565
5579
|
var import_dedupe60, import_Title, import_jsx_runtime70, Title;
|
|
5566
5580
|
var init_Title = __esm({
|