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