@simplybusiness/mobius 10.1.1 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/components/AddressLookup/AddressLookup.js +540 -526
- package/dist/cjs/components/AddressLookup/AddressLookup.js.map +4 -4
- package/dist/cjs/components/AddressLookup/index.js +540 -526
- package/dist/cjs/components/AddressLookup/index.js.map +4 -4
- package/dist/cjs/components/Alert/Alert.js +79 -11
- package/dist/cjs/components/Alert/Alert.js.map +4 -4
- package/dist/cjs/components/Alert/index.js +79 -11
- package/dist/cjs/components/Alert/index.js.map +4 -4
- package/dist/cjs/components/Checkbox/Checkbox.js +506 -492
- package/dist/cjs/components/Checkbox/Checkbox.js.map +4 -4
- package/dist/cjs/components/Checkbox/CheckboxGroup.js +506 -492
- package/dist/cjs/components/Checkbox/CheckboxGroup.js.map +4 -4
- package/dist/cjs/components/Checkbox/index.js +485 -471
- package/dist/cjs/components/Checkbox/index.js.map +4 -4
- package/dist/cjs/components/Combobox/Combobox.js +540 -526
- package/dist/cjs/components/Combobox/Combobox.js.map +4 -4
- package/dist/cjs/components/Combobox/index.js +540 -526
- package/dist/cjs/components/Combobox/index.js.map +4 -4
- package/dist/cjs/components/DateField/DateField.js +527 -513
- package/dist/cjs/components/DateField/DateField.js.map +4 -4
- package/dist/cjs/components/DateField/index.js +527 -513
- package/dist/cjs/components/DateField/index.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js +527 -513
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/index.js +527 -513
- package/dist/cjs/components/ErrorMessage/index.js.map +4 -4
- package/dist/cjs/components/ExpandableText/ExpandableText.js +527 -513
- package/dist/cjs/components/ExpandableText/ExpandableText.js.map +4 -4
- package/dist/cjs/components/ExpandableText/index.js +527 -513
- package/dist/cjs/components/ExpandableText/index.js.map +4 -4
- package/dist/cjs/components/MaskedField/MaskedField.js +537 -523
- package/dist/cjs/components/MaskedField/MaskedField.js.map +4 -4
- package/dist/cjs/components/MaskedField/index.js +537 -523
- package/dist/cjs/components/MaskedField/index.js.map +4 -4
- package/dist/cjs/components/NumberField/NumberField.js +528 -514
- package/dist/cjs/components/NumberField/NumberField.js.map +4 -4
- package/dist/cjs/components/NumberField/index.js +528 -514
- package/dist/cjs/components/NumberField/index.js.map +4 -4
- package/dist/cjs/components/PasswordField/PasswordField.js +524 -510
- package/dist/cjs/components/PasswordField/PasswordField.js.map +4 -4
- package/dist/cjs/components/PasswordField/ShowHideButton.js +523 -509
- package/dist/cjs/components/PasswordField/ShowHideButton.js.map +4 -4
- package/dist/cjs/components/PasswordField/index.js +524 -510
- package/dist/cjs/components/PasswordField/index.js.map +4 -4
- package/dist/cjs/components/Radio/Radio.js +506 -492
- package/dist/cjs/components/Radio/Radio.js.map +4 -4
- package/dist/cjs/components/Radio/RadioGroup.js +505 -491
- package/dist/cjs/components/Radio/RadioGroup.js.map +4 -4
- package/dist/cjs/components/Radio/index.js +484 -470
- package/dist/cjs/components/Radio/index.js.map +4 -4
- package/dist/cjs/components/Select/Select.js +511 -497
- package/dist/cjs/components/Select/Select.js.map +4 -4
- package/dist/cjs/components/Select/index.js +511 -497
- package/dist/cjs/components/Select/index.js.map +4 -4
- package/dist/cjs/components/TextArea/TextArea.js +521 -507
- package/dist/cjs/components/TextArea/TextArea.js.map +4 -4
- package/dist/cjs/components/TextArea/index.js +521 -507
- package/dist/cjs/components/TextArea/index.js.map +4 -4
- package/dist/cjs/components/TextField/TextField.js +537 -523
- package/dist/cjs/components/TextField/TextField.js.map +4 -4
- package/dist/cjs/components/TextField/index.js +537 -523
- package/dist/cjs/components/TextField/index.js.map +4 -4
- package/dist/cjs/components/index.js +567 -553
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/index.js +567 -553
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/meta.json +1372 -1305
- package/dist/esm/{chunk-FTSJNY4J.js → chunk-N5WGQAHM.js} +14 -2
- package/dist/esm/chunk-N5WGQAHM.js.map +7 -0
- package/dist/esm/{chunk-C4BILMFX.js → chunk-RR4UQSOZ.js} +5 -1
- package/dist/esm/chunk-RR4UQSOZ.js.map +7 -0
- package/dist/esm/components/AddressLookup/AddressLookup.js +2 -2
- package/dist/esm/components/AddressLookup/index.js +2 -2
- package/dist/esm/components/Alert/Alert.js +4 -1
- package/dist/esm/components/Alert/index.js +4 -1
- package/dist/esm/components/Checkbox/Checkbox.js +2 -2
- package/dist/esm/components/Checkbox/CheckboxGroup.js +2 -2
- package/dist/esm/components/Checkbox/index.js +2 -2
- package/dist/esm/components/Combobox/Combobox.js +2 -2
- package/dist/esm/components/Combobox/index.js +2 -2
- package/dist/esm/components/DateField/DateField.js +2 -2
- package/dist/esm/components/DateField/index.js +2 -2
- package/dist/esm/components/ErrorMessage/ErrorMessage.js +2 -2
- package/dist/esm/components/ErrorMessage/index.js +2 -2
- package/dist/esm/components/ExpandableText/ExpandableText.js +2 -2
- package/dist/esm/components/ExpandableText/index.js +2 -2
- package/dist/esm/components/MaskedField/MaskedField.js +2 -2
- package/dist/esm/components/MaskedField/index.js +2 -2
- package/dist/esm/components/NumberField/NumberField.js +2 -2
- package/dist/esm/components/NumberField/index.js +2 -2
- package/dist/esm/components/PasswordField/PasswordField.js +2 -2
- package/dist/esm/components/PasswordField/ShowHideButton.js +2 -2
- package/dist/esm/components/PasswordField/index.js +2 -2
- package/dist/esm/components/Radio/Radio.js +2 -2
- package/dist/esm/components/Radio/RadioGroup.js +2 -2
- package/dist/esm/components/Radio/index.js +2 -2
- package/dist/esm/components/Select/Select.js +2 -2
- package/dist/esm/components/Select/index.js +2 -2
- package/dist/esm/components/TextArea/TextArea.js +2 -2
- package/dist/esm/components/TextArea/index.js +2 -2
- package/dist/esm/components/TextField/TextField.js +2 -2
- package/dist/esm/components/TextField/index.js +2 -2
- package/dist/esm/components/index.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/meta.json +164 -131
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/AddressLookup/AddressLookup.test.tsx +76 -0
- package/src/components/AddressLookup/AddressLookup.tsx +9 -0
- package/src/components/Alert/Alert.tsx +10 -1
- package/src/components/Drawer/Drawer.css +24 -3
- package/src/components/Modal/Modal.css +42 -3
- package/dist/esm/chunk-C4BILMFX.js.map +0 -7
- package/dist/esm/chunk-FTSJNY4J.js.map +0 -7
package/dist/cjs/index.js
CHANGED
|
@@ -2206,6 +2206,10 @@ var init_AddressLookup = __esm({
|
|
|
2206
2206
|
);
|
|
2207
2207
|
const handleSelected = (selected) => {
|
|
2208
2208
|
setError(null);
|
|
2209
|
+
const isEmpty = typeof selected === "string" ? selected === "" : !selected.id && !selected.value;
|
|
2210
|
+
if (isEmpty) {
|
|
2211
|
+
return Promise.resolve();
|
|
2212
|
+
}
|
|
2209
2213
|
if (typeof selected === "string" || !selected.id) {
|
|
2210
2214
|
setError(new Error("Selected option missing id"));
|
|
2211
2215
|
return Promise.resolve();
|
|
@@ -2346,19 +2350,98 @@ var init_AddressLookup2 = __esm({
|
|
|
2346
2350
|
}
|
|
2347
2351
|
});
|
|
2348
2352
|
|
|
2353
|
+
// src/components/Text/Text.tsx
|
|
2354
|
+
var import_dedupe15, import_Text, import_jsx_runtime16, getElementType, Text;
|
|
2355
|
+
var init_Text = __esm({
|
|
2356
|
+
"src/components/Text/Text.tsx"() {
|
|
2357
|
+
"use strict";
|
|
2358
|
+
import_dedupe15 = __toESM(require("classnames/dedupe"));
|
|
2359
|
+
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
2360
|
+
import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2361
|
+
getElementType = (variant, elementType) => {
|
|
2362
|
+
if (variant) {
|
|
2363
|
+
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
2364
|
+
}
|
|
2365
|
+
return elementType || "p";
|
|
2366
|
+
};
|
|
2367
|
+
Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
2368
|
+
const { variant, className, spacing, ...otherProps } = props;
|
|
2369
|
+
const elementType = getElementType(variant, Component);
|
|
2370
|
+
const variantType = variant || elementType;
|
|
2371
|
+
const classes = (0, import_dedupe15.default)(
|
|
2372
|
+
"mobius",
|
|
2373
|
+
"mobius-text",
|
|
2374
|
+
{ [`--is-${variantType}`]: variantType },
|
|
2375
|
+
{ [`--has-line-height-${spacing}`]: spacing },
|
|
2376
|
+
className
|
|
2377
|
+
);
|
|
2378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
2379
|
+
};
|
|
2380
|
+
Text.displayName = "Text";
|
|
2381
|
+
}
|
|
2382
|
+
});
|
|
2383
|
+
|
|
2384
|
+
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
2385
|
+
var import_react15, import_jsx_runtime17, isHTML, TextOrHTML;
|
|
2386
|
+
var init_TextOrHTML = __esm({
|
|
2387
|
+
"src/components/TextOrHTML/TextOrHTML.tsx"() {
|
|
2388
|
+
"use strict";
|
|
2389
|
+
import_react15 = require("react");
|
|
2390
|
+
init_Text();
|
|
2391
|
+
import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2392
|
+
isHTML = (text) => /^\s*<[a-z]/i.test(text);
|
|
2393
|
+
TextOrHTML = ({
|
|
2394
|
+
ref,
|
|
2395
|
+
text,
|
|
2396
|
+
htmlClassName,
|
|
2397
|
+
htmlElementType,
|
|
2398
|
+
textWrapper = false,
|
|
2399
|
+
autoDetect = false,
|
|
2400
|
+
...textProps
|
|
2401
|
+
}) => {
|
|
2402
|
+
const textIsHTML = autoDetect && isHTML(text);
|
|
2403
|
+
const shouldWrapInText = autoDetect ? textWrapper || !textIsHTML : textWrapper;
|
|
2404
|
+
const resolvedElementType = htmlElementType ?? (textIsHTML ? "div" : "span");
|
|
2405
|
+
const DangerousComponent = resolvedElementType;
|
|
2406
|
+
const dangerousHTML = (0, import_react15.useMemo)(() => ({ __html: text }), [text]);
|
|
2407
|
+
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2408
|
+
DangerousComponent,
|
|
2409
|
+
{
|
|
2410
|
+
className: htmlClassName,
|
|
2411
|
+
dangerouslySetInnerHTML: dangerousHTML
|
|
2412
|
+
}
|
|
2413
|
+
);
|
|
2414
|
+
if (shouldWrapInText) {
|
|
2415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
2416
|
+
}
|
|
2417
|
+
return dangerousElement;
|
|
2418
|
+
};
|
|
2419
|
+
TextOrHTML.displayName = "TextOrHTML";
|
|
2420
|
+
}
|
|
2421
|
+
});
|
|
2422
|
+
|
|
2423
|
+
// src/components/TextOrHTML/index.tsx
|
|
2424
|
+
var init_TextOrHTML2 = __esm({
|
|
2425
|
+
"src/components/TextOrHTML/index.tsx"() {
|
|
2426
|
+
"use strict";
|
|
2427
|
+
init_TextOrHTML();
|
|
2428
|
+
}
|
|
2429
|
+
});
|
|
2430
|
+
|
|
2349
2431
|
// src/components/Alert/Alert.tsx
|
|
2350
2432
|
function isAlertVariant(value) {
|
|
2351
2433
|
return value === "info" || value === "success" || value === "warning" || value === "error";
|
|
2352
2434
|
}
|
|
2353
|
-
var import_icons4,
|
|
2435
|
+
var import_icons4, import_dedupe16, import_Alert, import_jsx_runtime18, Alert;
|
|
2354
2436
|
var init_Alert = __esm({
|
|
2355
2437
|
"src/components/Alert/Alert.tsx"() {
|
|
2356
2438
|
"use strict";
|
|
2357
2439
|
import_icons4 = require("@simplybusiness/icons");
|
|
2358
|
-
|
|
2440
|
+
import_dedupe16 = __toESM(require("classnames/dedupe"));
|
|
2359
2441
|
init_Icon2();
|
|
2442
|
+
init_TextOrHTML2();
|
|
2360
2443
|
import_Alert = require("@simplybusiness/mobius/src/components/Alert/Alert.css");
|
|
2361
|
-
|
|
2444
|
+
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2362
2445
|
Alert = ({ ref, ...props }) => {
|
|
2363
2446
|
const {
|
|
2364
2447
|
elementType: Element = "div",
|
|
@@ -2371,7 +2454,7 @@ var init_Alert = __esm({
|
|
|
2371
2454
|
if (!show) return null;
|
|
2372
2455
|
const variant = variantProp && isAlertVariant(variantProp) ? variantProp : "info";
|
|
2373
2456
|
const colorValue = variant === "success" ? `var(--color-valid)` : `var(--color-${variant})`;
|
|
2374
|
-
const classes = (0,
|
|
2457
|
+
const classes = (0, import_dedupe16.default)(
|
|
2375
2458
|
"mobius",
|
|
2376
2459
|
"mobius-alert",
|
|
2377
2460
|
{
|
|
@@ -2389,14 +2472,23 @@ var init_Alert = __esm({
|
|
|
2389
2472
|
warning: import_icons4.warning,
|
|
2390
2473
|
error: import_icons4.error
|
|
2391
2474
|
};
|
|
2392
|
-
const headerClasses = (0,
|
|
2393
|
-
const iconClasses = (0,
|
|
2394
|
-
const contentClasses = (0,
|
|
2395
|
-
return /* @__PURE__ */ (0,
|
|
2396
|
-
/* @__PURE__ */ (0,
|
|
2397
|
-
/* @__PURE__ */ (0,
|
|
2398
|
-
header && /* @__PURE__ */ (0,
|
|
2399
|
-
|
|
2475
|
+
const headerClasses = (0, import_dedupe16.default)("mobius", "mobius-alert__header");
|
|
2476
|
+
const iconClasses = (0, import_dedupe16.default)("mobius", "mobius-alert__icon");
|
|
2477
|
+
const contentClasses = (0, import_dedupe16.default)("mobius", "mobius-alert__content");
|
|
2478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Element, { ref, role: "alert", ...otherProps, className: classes, children: [
|
|
2479
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { icon: icon[variant], color: colorValue }) }),
|
|
2480
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
2481
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2482
|
+
TextOrHTML,
|
|
2483
|
+
{
|
|
2484
|
+
autoDetect: true,
|
|
2485
|
+
htmlElementType: "span",
|
|
2486
|
+
className: headerClasses,
|
|
2487
|
+
htmlClassName: headerClasses,
|
|
2488
|
+
text: header
|
|
2489
|
+
}
|
|
2490
|
+
),
|
|
2491
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: contentClasses, children })
|
|
2400
2492
|
] })
|
|
2401
2493
|
] });
|
|
2402
2494
|
};
|
|
@@ -2413,14 +2505,14 @@ var init_Alert2 = __esm({
|
|
|
2413
2505
|
});
|
|
2414
2506
|
|
|
2415
2507
|
// src/components/Box/Box.tsx
|
|
2416
|
-
var
|
|
2508
|
+
var import_dedupe17, import_Box, import_jsx_runtime19, Box;
|
|
2417
2509
|
var init_Box = __esm({
|
|
2418
2510
|
"src/components/Box/Box.tsx"() {
|
|
2419
2511
|
"use strict";
|
|
2420
|
-
|
|
2512
|
+
import_dedupe17 = __toESM(require("classnames/dedupe"));
|
|
2421
2513
|
init_utils();
|
|
2422
2514
|
import_Box = require("@simplybusiness/mobius/src/components/Box/Box.css");
|
|
2423
|
-
|
|
2515
|
+
import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2424
2516
|
Box = ({ ref, ...props }) => {
|
|
2425
2517
|
const {
|
|
2426
2518
|
elementType: Element = "div",
|
|
@@ -2446,7 +2538,7 @@ var init_Box = __esm({
|
|
|
2446
2538
|
style,
|
|
2447
2539
|
...otherProps
|
|
2448
2540
|
} = props;
|
|
2449
|
-
const classes = (0,
|
|
2541
|
+
const classes = (0, import_dedupe17.default)("mobius", "mobius-box", otherProps.className);
|
|
2450
2542
|
const styleProps = filterUndefinedProps({
|
|
2451
2543
|
padding: getSpacingValue(padding),
|
|
2452
2544
|
paddingInline: getSpacingValue(paddingInline || paddingX),
|
|
@@ -2463,7 +2555,7 @@ var init_Box = __esm({
|
|
|
2463
2555
|
height,
|
|
2464
2556
|
...style
|
|
2465
2557
|
});
|
|
2466
|
-
return /* @__PURE__ */ (0,
|
|
2558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Element, { ref, style: styleProps, ...otherProps, className: classes });
|
|
2467
2559
|
};
|
|
2468
2560
|
Box.displayName = "Box";
|
|
2469
2561
|
}
|
|
@@ -2478,27 +2570,27 @@ var init_Box2 = __esm({
|
|
|
2478
2570
|
});
|
|
2479
2571
|
|
|
2480
2572
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
2481
|
-
var
|
|
2573
|
+
var import_react16, import_dedupe18, import_Breadcrumbs, import_jsx_runtime20, Breadcrumbs;
|
|
2482
2574
|
var init_Breadcrumbs = __esm({
|
|
2483
2575
|
"src/components/Breadcrumbs/Breadcrumbs.tsx"() {
|
|
2484
2576
|
"use strict";
|
|
2485
2577
|
"use client";
|
|
2486
|
-
|
|
2487
|
-
|
|
2578
|
+
import_react16 = require("react");
|
|
2579
|
+
import_dedupe18 = __toESM(require("classnames/dedupe"));
|
|
2488
2580
|
import_Breadcrumbs = require("@simplybusiness/mobius/src/components/Breadcrumbs/Breadcrumbs.css");
|
|
2489
|
-
|
|
2581
|
+
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2490
2582
|
Breadcrumbs = ({ ref, ...props }) => {
|
|
2491
2583
|
const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
|
|
2492
2584
|
const { navProps } = { navProps: { "aria-label": ariaLabel } };
|
|
2493
2585
|
const { children, ...otherProps } = props;
|
|
2494
|
-
const childArray =
|
|
2495
|
-
const classes = (0,
|
|
2586
|
+
const childArray = import_react16.Children.toArray(children);
|
|
2587
|
+
const classes = (0, import_dedupe18.default)(
|
|
2496
2588
|
"mobius",
|
|
2497
2589
|
"mobius-breadcrumb",
|
|
2498
2590
|
otherProps.className
|
|
2499
2591
|
);
|
|
2500
|
-
return /* @__PURE__ */ (0,
|
|
2501
|
-
(child, i) => (0,
|
|
2592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { children: childArray.map(
|
|
2593
|
+
(child, i) => (0, import_react16.cloneElement)(
|
|
2502
2594
|
child,
|
|
2503
2595
|
{
|
|
2504
2596
|
key: i,
|
|
@@ -2512,22 +2604,22 @@ var init_Breadcrumbs = __esm({
|
|
|
2512
2604
|
});
|
|
2513
2605
|
|
|
2514
2606
|
// src/components/Breadcrumbs/BreadcrumbItem.tsx
|
|
2515
|
-
var
|
|
2607
|
+
var import_react17, import_dedupe19, import_jsx_runtime21, BreadcrumbItem;
|
|
2516
2608
|
var init_BreadcrumbItem = __esm({
|
|
2517
2609
|
"src/components/Breadcrumbs/BreadcrumbItem.tsx"() {
|
|
2518
2610
|
"use strict";
|
|
2519
2611
|
"use client";
|
|
2520
|
-
|
|
2521
|
-
|
|
2612
|
+
import_react17 = require("react");
|
|
2613
|
+
import_dedupe19 = __toESM(require("classnames/dedupe"));
|
|
2522
2614
|
init_Box2();
|
|
2523
|
-
|
|
2615
|
+
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2524
2616
|
BreadcrumbItem = ({ ref, ...props }) => {
|
|
2525
2617
|
const {
|
|
2526
2618
|
isDisabled = false,
|
|
2527
2619
|
isCurrent = false,
|
|
2528
2620
|
"aria-current": ariaCurrent = "page",
|
|
2529
2621
|
children,
|
|
2530
|
-
separator = /* @__PURE__ */ (0,
|
|
2622
|
+
separator = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box, { className: "mobius-breadcrumb__separator", "aria-hidden": "true", children: ">" }),
|
|
2531
2623
|
...otherProps
|
|
2532
2624
|
} = props;
|
|
2533
2625
|
const { itemProps } = {
|
|
@@ -2537,14 +2629,14 @@ var init_BreadcrumbItem = __esm({
|
|
|
2537
2629
|
...otherProps
|
|
2538
2630
|
}
|
|
2539
2631
|
};
|
|
2540
|
-
const classes = (0,
|
|
2632
|
+
const classes = (0, import_dedupe19.default)(
|
|
2541
2633
|
"mobius",
|
|
2542
2634
|
"mobius-breadcrumb__item",
|
|
2543
2635
|
props.className
|
|
2544
2636
|
);
|
|
2545
|
-
const child = typeof children === "string" ? /* @__PURE__ */ (0,
|
|
2546
|
-
return /* @__PURE__ */ (0,
|
|
2547
|
-
(0,
|
|
2637
|
+
const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { ...itemProps, children }) : import_react17.Children.only(children);
|
|
2638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: classes, children: [
|
|
2639
|
+
(0, import_react17.cloneElement)(child, {
|
|
2548
2640
|
...child.props,
|
|
2549
2641
|
...itemProps,
|
|
2550
2642
|
ref
|
|
@@ -2566,19 +2658,19 @@ var init_Breadcrumbs2 = __esm({
|
|
|
2566
2658
|
});
|
|
2567
2659
|
|
|
2568
2660
|
// src/components/Button/Loading.tsx
|
|
2569
|
-
var import_icons5,
|
|
2661
|
+
var import_icons5, import_jsx_runtime22, Loading;
|
|
2570
2662
|
var init_Loading = __esm({
|
|
2571
2663
|
"src/components/Button/Loading.tsx"() {
|
|
2572
2664
|
"use strict";
|
|
2573
2665
|
import_icons5 = require("@simplybusiness/icons");
|
|
2574
2666
|
init_Icon2();
|
|
2575
2667
|
init_VisuallyHidden2();
|
|
2576
|
-
|
|
2668
|
+
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2577
2669
|
Loading = (props) => {
|
|
2578
2670
|
const { children } = props;
|
|
2579
|
-
return /* @__PURE__ */ (0,
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2581
|
-
/* @__PURE__ */ (0,
|
|
2671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
2672
|
+
/* @__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" }) }),
|
|
2673
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VisuallyHidden, { className: "mobius-button__loading-text", children: "Loading" }),
|
|
2582
2674
|
children
|
|
2583
2675
|
] });
|
|
2584
2676
|
};
|
|
@@ -2586,33 +2678,33 @@ var init_Loading = __esm({
|
|
|
2586
2678
|
});
|
|
2587
2679
|
|
|
2588
2680
|
// src/components/Button/Success.tsx
|
|
2589
|
-
var import_icons6,
|
|
2681
|
+
var import_icons6, import_jsx_runtime23, Success;
|
|
2590
2682
|
var init_Success = __esm({
|
|
2591
2683
|
"src/components/Button/Success.tsx"() {
|
|
2592
2684
|
"use strict";
|
|
2593
2685
|
import_icons6 = require("@simplybusiness/icons");
|
|
2594
2686
|
init_Icon2();
|
|
2595
2687
|
init_VisuallyHidden2();
|
|
2596
|
-
|
|
2597
|
-
Success = () => /* @__PURE__ */ (0,
|
|
2598
|
-
/* @__PURE__ */ (0,
|
|
2599
|
-
/* @__PURE__ */ (0,
|
|
2688
|
+
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2689
|
+
Success = () => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
2690
|
+
/* @__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" }) }),
|
|
2691
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(VisuallyHidden, { className: "mobius-button__success-text", children: "Success" })
|
|
2600
2692
|
] });
|
|
2601
2693
|
}
|
|
2602
2694
|
});
|
|
2603
2695
|
|
|
2604
2696
|
// src/components/Button/Button.tsx
|
|
2605
|
-
var
|
|
2697
|
+
var import_dedupe20, import_Button, import_jsx_runtime24, Button;
|
|
2606
2698
|
var init_Button = __esm({
|
|
2607
2699
|
"src/components/Button/Button.tsx"() {
|
|
2608
2700
|
"use strict";
|
|
2609
2701
|
"use client";
|
|
2610
|
-
|
|
2702
|
+
import_dedupe20 = __toESM(require("classnames/dedupe"));
|
|
2611
2703
|
init_Loading();
|
|
2612
2704
|
init_useButton2();
|
|
2613
2705
|
init_Success();
|
|
2614
2706
|
import_Button = require("@simplybusiness/mobius/src/components/Button/Button.css");
|
|
2615
|
-
|
|
2707
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2616
2708
|
Button = ({ ref, ...props }) => {
|
|
2617
2709
|
const {
|
|
2618
2710
|
children,
|
|
@@ -2627,7 +2719,7 @@ var init_Button = __esm({
|
|
|
2627
2719
|
...otherProps
|
|
2628
2720
|
} = props;
|
|
2629
2721
|
const { buttonProps } = useButton(props);
|
|
2630
|
-
otherProps.className = (0,
|
|
2722
|
+
otherProps.className = (0, import_dedupe20.default)(
|
|
2631
2723
|
"mobius",
|
|
2632
2724
|
"mobius-button",
|
|
2633
2725
|
`--variant-${variant}`,
|
|
@@ -2639,9 +2731,9 @@ var init_Button = __esm({
|
|
|
2639
2731
|
},
|
|
2640
2732
|
otherProps.className
|
|
2641
2733
|
);
|
|
2642
|
-
return /* @__PURE__ */ (0,
|
|
2643
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2644
|
-
isSuccess && !isLoading && /* @__PURE__ */ (0,
|
|
2734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Component, { ref, ...buttonProps, ...otherProps, children: [
|
|
2735
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Loading, { children }) : children,
|
|
2736
|
+
isSuccess && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Success, {})
|
|
2645
2737
|
] });
|
|
2646
2738
|
};
|
|
2647
2739
|
Button.displayName = "Button";
|
|
@@ -2657,13 +2749,13 @@ var init_Button2 = __esm({
|
|
|
2657
2749
|
});
|
|
2658
2750
|
|
|
2659
2751
|
// src/components/Checkbox/Checkbox.tsx
|
|
2660
|
-
var
|
|
2752
|
+
var import_react18, import_dedupe21, import_icons7, import_Checkbox, import_jsx_runtime25, Checkbox;
|
|
2661
2753
|
var init_Checkbox = __esm({
|
|
2662
2754
|
"src/components/Checkbox/Checkbox.tsx"() {
|
|
2663
2755
|
"use strict";
|
|
2664
2756
|
"use client";
|
|
2665
|
-
|
|
2666
|
-
|
|
2757
|
+
import_react18 = require("react");
|
|
2758
|
+
import_dedupe21 = __toESM(require("classnames/dedupe"));
|
|
2667
2759
|
import_icons7 = require("@simplybusiness/icons");
|
|
2668
2760
|
init_ErrorMessage2();
|
|
2669
2761
|
init_spaceDelimitedList();
|
|
@@ -2671,7 +2763,7 @@ var init_Checkbox = __esm({
|
|
|
2671
2763
|
init_Icon2();
|
|
2672
2764
|
init_Stack2();
|
|
2673
2765
|
import_Checkbox = require("@simplybusiness/mobius/src/components/Checkbox/Checkbox.css");
|
|
2674
|
-
|
|
2766
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2675
2767
|
Checkbox = ({ ref, ...props }) => {
|
|
2676
2768
|
const {
|
|
2677
2769
|
id,
|
|
@@ -2691,18 +2783,18 @@ var init_Checkbox = __esm({
|
|
|
2691
2783
|
["aria-describedby"]: ariaDescribedBy,
|
|
2692
2784
|
...rest
|
|
2693
2785
|
} = props;
|
|
2694
|
-
const [checked, setChecked] = (0,
|
|
2695
|
-
const fallbackRef = (0,
|
|
2786
|
+
const [checked, setChecked] = (0, import_react18.useState)(defaultSelected);
|
|
2787
|
+
const fallbackRef = (0, import_react18.useRef)(null);
|
|
2696
2788
|
const refObj = ref || fallbackRef;
|
|
2697
|
-
const inputId = (0,
|
|
2789
|
+
const inputId = (0, import_react18.useId)();
|
|
2698
2790
|
const isControlled = typeof selected === "boolean";
|
|
2699
|
-
(0,
|
|
2791
|
+
(0, import_react18.useEffect)(() => {
|
|
2700
2792
|
if (isControlled) {
|
|
2701
2793
|
setChecked(selected);
|
|
2702
2794
|
}
|
|
2703
2795
|
}, [selected, isControlled]);
|
|
2704
2796
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2705
|
-
const sharedClasses = (0,
|
|
2797
|
+
const sharedClasses = (0, import_dedupe21.default)(
|
|
2706
2798
|
{
|
|
2707
2799
|
"--is-disabled": isDisabled,
|
|
2708
2800
|
"--is-selected": checked,
|
|
@@ -2711,31 +2803,31 @@ var init_Checkbox = __esm({
|
|
|
2711
2803
|
},
|
|
2712
2804
|
validationClasses
|
|
2713
2805
|
);
|
|
2714
|
-
const wrapperClasses = (0,
|
|
2806
|
+
const wrapperClasses = (0, import_dedupe21.default)(
|
|
2715
2807
|
"mobius",
|
|
2716
2808
|
"mobius-checkbox",
|
|
2717
2809
|
sharedClasses,
|
|
2718
2810
|
className
|
|
2719
2811
|
);
|
|
2720
|
-
const labelClasses = (0,
|
|
2721
|
-
const inputClasses = (0,
|
|
2722
|
-
const iconClasses = (0,
|
|
2723
|
-
const errorMessageId = (0,
|
|
2812
|
+
const labelClasses = (0, import_dedupe21.default)("mobius-checkbox__label", sharedClasses);
|
|
2813
|
+
const inputClasses = (0, import_dedupe21.default)("mobius-checkbox__input", sharedClasses);
|
|
2814
|
+
const iconClasses = (0, import_dedupe21.default)("mobius-checkbox__icon", sharedClasses);
|
|
2815
|
+
const errorMessageId = (0, import_react18.useId)();
|
|
2724
2816
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2725
2817
|
const describedBy = spaceDelimitedList([
|
|
2726
2818
|
shouldErrorMessageShow,
|
|
2727
2819
|
ariaDescribedBy
|
|
2728
2820
|
]);
|
|
2729
|
-
const labelId = (0,
|
|
2821
|
+
const labelId = (0, import_react18.useId)();
|
|
2730
2822
|
const handleChange = (event) => {
|
|
2731
2823
|
setChecked(!checked);
|
|
2732
2824
|
if (onChange) {
|
|
2733
2825
|
onChange(event, isLastItem);
|
|
2734
2826
|
}
|
|
2735
2827
|
};
|
|
2736
|
-
return /* @__PURE__ */ (0,
|
|
2737
|
-
/* @__PURE__ */ (0,
|
|
2738
|
-
/* @__PURE__ */ (0,
|
|
2828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Stack, { gap: "xs", className: wrapperClasses, children: [
|
|
2829
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: labelClasses, children: [
|
|
2830
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2739
2831
|
"input",
|
|
2740
2832
|
{
|
|
2741
2833
|
"aria-describedby": describedBy,
|
|
@@ -2756,7 +2848,7 @@ var init_Checkbox = __esm({
|
|
|
2756
2848
|
...rest
|
|
2757
2849
|
}
|
|
2758
2850
|
),
|
|
2759
|
-
/* @__PURE__ */ (0,
|
|
2851
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2760
2852
|
Icon,
|
|
2761
2853
|
{
|
|
2762
2854
|
icon: checked ? import_icons7.squareTick : import_icons7.square,
|
|
@@ -2764,9 +2856,9 @@ var init_Checkbox = __esm({
|
|
|
2764
2856
|
className: iconClasses
|
|
2765
2857
|
}
|
|
2766
2858
|
),
|
|
2767
|
-
/* @__PURE__ */ (0,
|
|
2859
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { id: labelId, className: "mobius-checkbox__visible-label", children: label })
|
|
2768
2860
|
] }),
|
|
2769
|
-
/* @__PURE__ */ (0,
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2770
2862
|
] });
|
|
2771
2863
|
};
|
|
2772
2864
|
Checkbox.displayName = "Checkbox";
|
|
@@ -2774,20 +2866,20 @@ var init_Checkbox = __esm({
|
|
|
2774
2866
|
});
|
|
2775
2867
|
|
|
2776
2868
|
// src/components/Checkbox/CheckboxGroup.tsx
|
|
2777
|
-
var
|
|
2869
|
+
var import_dedupe22, import_react19, import_CheckboxGroup, import_jsx_runtime26, CheckboxGroup;
|
|
2778
2870
|
var init_CheckboxGroup = __esm({
|
|
2779
2871
|
"src/components/Checkbox/CheckboxGroup.tsx"() {
|
|
2780
2872
|
"use strict";
|
|
2781
2873
|
"use client";
|
|
2782
|
-
|
|
2783
|
-
|
|
2874
|
+
import_dedupe22 = __toESM(require("classnames/dedupe"));
|
|
2875
|
+
import_react19 = require("react");
|
|
2784
2876
|
init_hooks();
|
|
2785
2877
|
init_spaceDelimitedList();
|
|
2786
2878
|
init_ErrorMessage2();
|
|
2787
2879
|
init_Label2();
|
|
2788
2880
|
init_Checkbox();
|
|
2789
2881
|
import_CheckboxGroup = require("@simplybusiness/mobius/src/components/Checkbox/CheckboxGroup.css");
|
|
2790
|
-
|
|
2882
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2791
2883
|
CheckboxGroup = ({ ref, ...props }) => {
|
|
2792
2884
|
const {
|
|
2793
2885
|
label,
|
|
@@ -2805,10 +2897,10 @@ var init_CheckboxGroup = __esm({
|
|
|
2805
2897
|
lastItemDisables = false,
|
|
2806
2898
|
...rest
|
|
2807
2899
|
} = props;
|
|
2808
|
-
const [selected, setSelected] = (0,
|
|
2809
|
-
const isInitializedRef = (0,
|
|
2810
|
-
const prevDefaultValueRef = (0,
|
|
2811
|
-
(0,
|
|
2900
|
+
const [selected, setSelected] = (0, import_react19.useState)(defaultValue);
|
|
2901
|
+
const isInitializedRef = (0, import_react19.useRef)(false);
|
|
2902
|
+
const prevDefaultValueRef = (0, import_react19.useRef)(defaultValue);
|
|
2903
|
+
(0, import_react19.useEffect)(() => {
|
|
2812
2904
|
const hasChanged = defaultValue.length !== prevDefaultValueRef.current.length || defaultValue.some(
|
|
2813
2905
|
(val, index) => val !== prevDefaultValueRef.current[index]
|
|
2814
2906
|
);
|
|
@@ -2818,7 +2910,7 @@ var init_CheckboxGroup = __esm({
|
|
|
2818
2910
|
isInitializedRef.current = true;
|
|
2819
2911
|
}
|
|
2820
2912
|
}, [defaultValue]);
|
|
2821
|
-
const checkboxGroupClasses = (0,
|
|
2913
|
+
const checkboxGroupClasses = (0, import_dedupe22.default)(
|
|
2822
2914
|
"mobius",
|
|
2823
2915
|
"mobius-checkbox-group",
|
|
2824
2916
|
className,
|
|
@@ -2830,19 +2922,19 @@ var init_CheckboxGroup = __esm({
|
|
|
2830
2922
|
}
|
|
2831
2923
|
);
|
|
2832
2924
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2833
|
-
const labelClasses = (0,
|
|
2925
|
+
const labelClasses = (0, import_dedupe22.default)(
|
|
2834
2926
|
{
|
|
2835
2927
|
"--is-disabled": isDisabled
|
|
2836
2928
|
},
|
|
2837
2929
|
validationClasses
|
|
2838
2930
|
);
|
|
2839
|
-
const errorMessageId = (0,
|
|
2931
|
+
const errorMessageId = (0, import_react19.useId)();
|
|
2840
2932
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2841
2933
|
const describedBy = spaceDelimitedList([
|
|
2842
2934
|
shouldErrorMessageShow,
|
|
2843
2935
|
props["aria-describedby"]
|
|
2844
2936
|
]);
|
|
2845
|
-
const labelId = (0,
|
|
2937
|
+
const labelId = (0, import_react19.useId)();
|
|
2846
2938
|
const handleChange = (event, isLastItem = false) => {
|
|
2847
2939
|
const {
|
|
2848
2940
|
target: { value, checked }
|
|
@@ -2860,12 +2952,12 @@ var init_CheckboxGroup = __esm({
|
|
|
2860
2952
|
setSelected(newValue);
|
|
2861
2953
|
onChange?.(newValue);
|
|
2862
2954
|
};
|
|
2863
|
-
const childrenArray =
|
|
2955
|
+
const childrenArray = import_react19.Children.toArray(children);
|
|
2864
2956
|
const lastCheckbox = childrenArray.filter(
|
|
2865
|
-
(child) => (0,
|
|
2957
|
+
(child) => (0, import_react19.isValidElement)(child) && child.type === Checkbox
|
|
2866
2958
|
).pop();
|
|
2867
2959
|
const lastCheckboxIsChecked = lastCheckbox && selected.includes(lastCheckbox.props.value);
|
|
2868
|
-
return /* @__PURE__ */ (0,
|
|
2960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2869
2961
|
"div",
|
|
2870
2962
|
{
|
|
2871
2963
|
...rest,
|
|
@@ -2874,16 +2966,16 @@ var init_CheckboxGroup = __esm({
|
|
|
2874
2966
|
className: checkboxGroupClasses,
|
|
2875
2967
|
role: "group",
|
|
2876
2968
|
style: {
|
|
2877
|
-
"--checkbox-items-per-row": itemsPerRow ||
|
|
2969
|
+
"--checkbox-items-per-row": itemsPerRow || import_react19.Children.count(children)
|
|
2878
2970
|
},
|
|
2879
2971
|
children: [
|
|
2880
|
-
label && /* @__PURE__ */ (0,
|
|
2881
|
-
/* @__PURE__ */ (0,
|
|
2882
|
-
if ((0,
|
|
2972
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Label, { elementType: "span", id: labelId, className: labelClasses, children: label }),
|
|
2973
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mobius-checkbox-group__wrapper", children: childrenArray.map((child) => {
|
|
2974
|
+
if ((0, import_react19.isValidElement)(child)) {
|
|
2883
2975
|
const isLastItem = child === lastCheckbox;
|
|
2884
2976
|
const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
|
|
2885
2977
|
const childProps = child.props;
|
|
2886
|
-
return (0,
|
|
2978
|
+
return (0, import_react19.cloneElement)(
|
|
2887
2979
|
child,
|
|
2888
2980
|
{
|
|
2889
2981
|
isDisabled: isChildDisabled,
|
|
@@ -2899,7 +2991,7 @@ var init_CheckboxGroup = __esm({
|
|
|
2899
2991
|
}
|
|
2900
2992
|
return child;
|
|
2901
2993
|
}) }),
|
|
2902
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
2994
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2903
2995
|
]
|
|
2904
2996
|
}
|
|
2905
2997
|
);
|
|
@@ -2926,23 +3018,23 @@ var init_Checkbox2 = __esm({
|
|
|
2926
3018
|
});
|
|
2927
3019
|
|
|
2928
3020
|
// src/components/Container/Container.tsx
|
|
2929
|
-
var
|
|
3021
|
+
var import_dedupe23, import_Container, import_jsx_runtime27, Container;
|
|
2930
3022
|
var init_Container = __esm({
|
|
2931
3023
|
"src/components/Container/Container.tsx"() {
|
|
2932
3024
|
"use strict";
|
|
2933
|
-
|
|
3025
|
+
import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
2934
3026
|
init_utils();
|
|
2935
3027
|
import_Container = require("@simplybusiness/mobius/src/components/Container/Container.css");
|
|
2936
|
-
|
|
3028
|
+
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2937
3029
|
Container = ({ ref, ...props }) => {
|
|
2938
3030
|
const { elementType: Element = "div", size = "md", ...otherProps } = props;
|
|
2939
|
-
const classes = (0,
|
|
3031
|
+
const classes = (0, import_dedupe23.default)(
|
|
2940
3032
|
"mobius",
|
|
2941
3033
|
"mobius-container",
|
|
2942
3034
|
sizeClasses(size),
|
|
2943
3035
|
otherProps.className
|
|
2944
3036
|
);
|
|
2945
|
-
return /* @__PURE__ */ (0,
|
|
3037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
2946
3038
|
};
|
|
2947
3039
|
Container.displayName = "Container";
|
|
2948
3040
|
}
|
|
@@ -2995,17 +3087,17 @@ var init_validation = __esm({
|
|
|
2995
3087
|
});
|
|
2996
3088
|
|
|
2997
3089
|
// src/components/DateField/DateField.tsx
|
|
2998
|
-
var
|
|
3090
|
+
var import_dedupe24, import_react20, import_jsx_runtime28, MIN_MAX_ERROR, DateField;
|
|
2999
3091
|
var init_DateField = __esm({
|
|
3000
3092
|
"src/components/DateField/DateField.tsx"() {
|
|
3001
3093
|
"use strict";
|
|
3002
3094
|
"use client";
|
|
3003
|
-
|
|
3004
|
-
|
|
3095
|
+
import_dedupe24 = __toESM(require("classnames/dedupe"));
|
|
3096
|
+
import_react20 = require("react");
|
|
3005
3097
|
init_mergeRefs();
|
|
3006
3098
|
init_TextField2();
|
|
3007
3099
|
init_validation();
|
|
3008
|
-
|
|
3100
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3009
3101
|
MIN_MAX_ERROR = '"min" value should not be greater than "max" value.';
|
|
3010
3102
|
DateField = ({ ref, ...props }) => {
|
|
3011
3103
|
const {
|
|
@@ -3018,10 +3110,10 @@ var init_DateField = __esm({
|
|
|
3018
3110
|
value,
|
|
3019
3111
|
...otherProps
|
|
3020
3112
|
} = props;
|
|
3021
|
-
const [error3, setError] = (0,
|
|
3022
|
-
const [isInvalid, setIsInvalid] = (0,
|
|
3023
|
-
const localRef = (0,
|
|
3024
|
-
const classes = (0,
|
|
3113
|
+
const [error3, setError] = (0, import_react20.useState)(errorMessage);
|
|
3114
|
+
const [isInvalid, setIsInvalid] = (0, import_react20.useState)(void 0);
|
|
3115
|
+
const localRef = (0, import_react20.useRef)(null);
|
|
3116
|
+
const classes = (0, import_dedupe24.default)("mobius-date-field", className);
|
|
3025
3117
|
const formattedMin = min ? convertToDateFormat(min, format) : void 0;
|
|
3026
3118
|
const formattedMax = max ? convertToDateFormat(max, format) : void 0;
|
|
3027
3119
|
const formattedDefaultValue = defaultValue ? convertToDateFormat(defaultValue, format) : void 0;
|
|
@@ -3034,7 +3126,7 @@ var init_DateField = __esm({
|
|
|
3034
3126
|
setError(props.errorMessage);
|
|
3035
3127
|
setIsInvalid(false);
|
|
3036
3128
|
};
|
|
3037
|
-
(0,
|
|
3129
|
+
(0, import_react20.useEffect)(() => {
|
|
3038
3130
|
if (!isValidDate(min, format)) {
|
|
3039
3131
|
setInvalidState(`Invalid min date: ${min}`);
|
|
3040
3132
|
return;
|
|
@@ -3067,7 +3159,7 @@ var init_DateField = __esm({
|
|
|
3067
3159
|
validate();
|
|
3068
3160
|
otherProps.onBlur?.(event);
|
|
3069
3161
|
};
|
|
3070
|
-
return /* @__PURE__ */ (0,
|
|
3162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3071
3163
|
TextField,
|
|
3072
3164
|
{
|
|
3073
3165
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -3098,23 +3190,23 @@ var init_DateField2 = __esm({
|
|
|
3098
3190
|
});
|
|
3099
3191
|
|
|
3100
3192
|
// src/components/Drawer/Content.tsx
|
|
3101
|
-
var
|
|
3193
|
+
var import_jsx_runtime29, Content;
|
|
3102
3194
|
var init_Content = __esm({
|
|
3103
3195
|
"src/components/Drawer/Content.tsx"() {
|
|
3104
3196
|
"use strict";
|
|
3105
|
-
|
|
3106
|
-
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
3197
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3198
|
+
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { ref, ...otherProps, className: "mobius-drawer__content", children });
|
|
3107
3199
|
Content.displayName = "Content";
|
|
3108
3200
|
}
|
|
3109
3201
|
});
|
|
3110
3202
|
|
|
3111
3203
|
// src/components/Drawer/DrawerContext.tsx
|
|
3112
|
-
var
|
|
3204
|
+
var import_react21, DrawerContext;
|
|
3113
3205
|
var init_DrawerContext = __esm({
|
|
3114
3206
|
"src/components/Drawer/DrawerContext.tsx"() {
|
|
3115
3207
|
"use strict";
|
|
3116
|
-
|
|
3117
|
-
DrawerContext = (0,
|
|
3208
|
+
import_react21 = require("react");
|
|
3209
|
+
DrawerContext = (0, import_react21.createContext)({
|
|
3118
3210
|
onClose: () => {
|
|
3119
3211
|
},
|
|
3120
3212
|
closeLabel: void 0,
|
|
@@ -3124,19 +3216,19 @@ var init_DrawerContext = __esm({
|
|
|
3124
3216
|
});
|
|
3125
3217
|
|
|
3126
3218
|
// src/components/Drawer/Drawer.tsx
|
|
3127
|
-
var
|
|
3219
|
+
var import_dedupe25, import_react22, import_Drawer, import_jsx_runtime30, TRANSITION_CSS_VARIABLE, Drawer;
|
|
3128
3220
|
var init_Drawer = __esm({
|
|
3129
3221
|
"src/components/Drawer/Drawer.tsx"() {
|
|
3130
3222
|
"use strict";
|
|
3131
3223
|
"use client";
|
|
3132
|
-
|
|
3133
|
-
|
|
3224
|
+
import_dedupe25 = __toESM(require("classnames/dedupe"));
|
|
3225
|
+
import_react22 = require("react");
|
|
3134
3226
|
init_hooks();
|
|
3135
3227
|
init_utils();
|
|
3136
3228
|
init_VisuallyHidden2();
|
|
3137
3229
|
init_DrawerContext();
|
|
3138
3230
|
import_Drawer = require("@simplybusiness/mobius/src/components/Drawer/Drawer.css");
|
|
3139
|
-
|
|
3231
|
+
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3140
3232
|
TRANSITION_CSS_VARIABLE = "--drawer-transition-duration";
|
|
3141
3233
|
Drawer = ({ ref, ...props }) => {
|
|
3142
3234
|
const {
|
|
@@ -3149,8 +3241,8 @@ var init_Drawer = __esm({
|
|
|
3149
3241
|
onClose,
|
|
3150
3242
|
children
|
|
3151
3243
|
} = props;
|
|
3152
|
-
const dialogRef = (0,
|
|
3153
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3244
|
+
const dialogRef = (0, import_react22.useRef)(null);
|
|
3245
|
+
const [shouldTransition, setShouldTransition] = (0, import_react22.useState)(false);
|
|
3154
3246
|
const { close } = useDialog({
|
|
3155
3247
|
ref: dialogRef,
|
|
3156
3248
|
isOpen,
|
|
@@ -3161,9 +3253,9 @@ var init_Drawer = __esm({
|
|
|
3161
3253
|
CSSVariable: TRANSITION_CSS_VARIABLE
|
|
3162
3254
|
}
|
|
3163
3255
|
});
|
|
3164
|
-
const hiddenId = `dialog-screen-reader-announce-${(0,
|
|
3165
|
-
const headerId = `dialog-header-${(0,
|
|
3166
|
-
const dialogClasses = (0,
|
|
3256
|
+
const hiddenId = `dialog-screen-reader-announce-${(0, import_react22.useId)()}`;
|
|
3257
|
+
const headerId = `dialog-header-${(0, import_react22.useId)()}`;
|
|
3258
|
+
const dialogClasses = (0, import_dedupe25.default)(
|
|
3167
3259
|
"mobius",
|
|
3168
3260
|
"mobius-drawer",
|
|
3169
3261
|
`--${direction}`,
|
|
@@ -3172,10 +3264,10 @@ var init_Drawer = __esm({
|
|
|
3172
3264
|
"--should-transition": shouldTransition
|
|
3173
3265
|
}
|
|
3174
3266
|
);
|
|
3175
|
-
(0,
|
|
3267
|
+
(0, import_react22.useEffect)(() => {
|
|
3176
3268
|
setShouldTransition(supportsDialog());
|
|
3177
3269
|
}, []);
|
|
3178
|
-
const contextValue = (0,
|
|
3270
|
+
const contextValue = (0, import_react22.useMemo)(
|
|
3179
3271
|
() => ({
|
|
3180
3272
|
onClose: close,
|
|
3181
3273
|
closeLabel,
|
|
@@ -3183,18 +3275,18 @@ var init_Drawer = __esm({
|
|
|
3183
3275
|
}),
|
|
3184
3276
|
[close, closeLabel, headerId]
|
|
3185
3277
|
);
|
|
3186
|
-
return /* @__PURE__ */ (0,
|
|
3278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3187
3279
|
"dialog",
|
|
3188
3280
|
{
|
|
3189
|
-
id: (0,
|
|
3281
|
+
id: (0, import_react22.useId)(),
|
|
3190
3282
|
ref: mergeRefs([dialogRef, ref]),
|
|
3191
3283
|
onCancel: close,
|
|
3192
3284
|
className: dialogClasses,
|
|
3193
3285
|
"aria-describedby": hiddenId,
|
|
3194
3286
|
"aria-labelledby": headerId,
|
|
3195
3287
|
children: [
|
|
3196
|
-
/* @__PURE__ */ (0,
|
|
3197
|
-
/* @__PURE__ */ (0,
|
|
3288
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { id: hiddenId, children: announce }) }),
|
|
3289
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DrawerContext.Provider, { value: contextValue, children })
|
|
3198
3290
|
]
|
|
3199
3291
|
}
|
|
3200
3292
|
);
|
|
@@ -3204,21 +3296,21 @@ var init_Drawer = __esm({
|
|
|
3204
3296
|
});
|
|
3205
3297
|
|
|
3206
3298
|
// src/components/Drawer/useDrawer.ts
|
|
3207
|
-
var
|
|
3299
|
+
var import_react23, useDrawer;
|
|
3208
3300
|
var init_useDrawer = __esm({
|
|
3209
3301
|
"src/components/Drawer/useDrawer.ts"() {
|
|
3210
3302
|
"use strict";
|
|
3211
|
-
|
|
3303
|
+
import_react23 = require("react");
|
|
3212
3304
|
init_DrawerContext();
|
|
3213
3305
|
useDrawer = () => {
|
|
3214
|
-
const { onClose, closeLabel, headerId } = (0,
|
|
3306
|
+
const { onClose, closeLabel, headerId } = (0, import_react23.useContext)(DrawerContext);
|
|
3215
3307
|
return { onClose, closeLabel, headerId };
|
|
3216
3308
|
};
|
|
3217
3309
|
}
|
|
3218
3310
|
});
|
|
3219
3311
|
|
|
3220
3312
|
// src/components/Drawer/Header.tsx
|
|
3221
|
-
var import_icons8,
|
|
3313
|
+
var import_icons8, import_jsx_runtime31, Header;
|
|
3222
3314
|
var init_Header = __esm({
|
|
3223
3315
|
"src/components/Drawer/Header.tsx"() {
|
|
3224
3316
|
"use strict";
|
|
@@ -3226,12 +3318,12 @@ var init_Header = __esm({
|
|
|
3226
3318
|
init_Button2();
|
|
3227
3319
|
init_Icon2();
|
|
3228
3320
|
init_useDrawer();
|
|
3229
|
-
|
|
3321
|
+
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3230
3322
|
Header = ({ ref, children, ...otherProps }) => {
|
|
3231
3323
|
const { onClose, closeLabel, headerId } = useDrawer();
|
|
3232
|
-
return /* @__PURE__ */ (0,
|
|
3233
|
-
/* @__PURE__ */ (0,
|
|
3234
|
-
/* @__PURE__ */ (0,
|
|
3324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("header", { ref, ...otherProps, className: "mobius-drawer__header", children: [
|
|
3325
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", { id: headerId, children }),
|
|
3326
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3235
3327
|
Button,
|
|
3236
3328
|
{
|
|
3237
3329
|
"aria-label": "Close",
|
|
@@ -3240,7 +3332,7 @@ var init_Header = __esm({
|
|
|
3240
3332
|
className: "mobius-drawer__close",
|
|
3241
3333
|
size: "sm",
|
|
3242
3334
|
children: [
|
|
3243
|
-
/* @__PURE__ */ (0,
|
|
3335
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { icon: import_icons8.cross }),
|
|
3244
3336
|
" ",
|
|
3245
3337
|
closeLabel
|
|
3246
3338
|
]
|
|
@@ -3270,17 +3362,17 @@ var init_Drawer2 = __esm({
|
|
|
3270
3362
|
});
|
|
3271
3363
|
|
|
3272
3364
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
3273
|
-
var
|
|
3365
|
+
var import_react24, import_react_accessible_dropdown_menu_hook, import_dedupe26, import_DropdownMenu, import_jsx_runtime32, DropdownMenu;
|
|
3274
3366
|
var init_DropdownMenu = __esm({
|
|
3275
3367
|
"src/components/DropdownMenu/DropdownMenu.tsx"() {
|
|
3276
3368
|
"use strict";
|
|
3277
3369
|
"use client";
|
|
3278
|
-
|
|
3370
|
+
import_react24 = require("react");
|
|
3279
3371
|
import_react_accessible_dropdown_menu_hook = __toESM(require("react-accessible-dropdown-menu-hook"));
|
|
3280
|
-
|
|
3372
|
+
import_dedupe26 = __toESM(require("classnames/dedupe"));
|
|
3281
3373
|
init_Button2();
|
|
3282
3374
|
import_DropdownMenu = require("@simplybusiness/mobius/src/components/DropdownMenu/DropdownMenu.css");
|
|
3283
|
-
|
|
3375
|
+
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3284
3376
|
DropdownMenu = ({ ref, ...props }) => {
|
|
3285
3377
|
const {
|
|
3286
3378
|
elementType: Element = "nav",
|
|
@@ -3289,21 +3381,21 @@ var init_DropdownMenu = __esm({
|
|
|
3289
3381
|
children,
|
|
3290
3382
|
...otherProps
|
|
3291
3383
|
} = props;
|
|
3292
|
-
const [activeId, setActiveId] = (0,
|
|
3293
|
-
const numberOfItems =
|
|
3384
|
+
const [activeId, setActiveId] = (0, import_react24.useState)(null);
|
|
3385
|
+
const numberOfItems = import_react24.Children.count(children);
|
|
3294
3386
|
const {
|
|
3295
3387
|
buttonProps,
|
|
3296
3388
|
itemProps,
|
|
3297
3389
|
isOpen: open,
|
|
3298
3390
|
setIsOpen
|
|
3299
3391
|
} = (0, import_react_accessible_dropdown_menu_hook.default)(numberOfItems);
|
|
3300
|
-
const classes = (0,
|
|
3392
|
+
const classes = (0, import_dedupe26.default)(
|
|
3301
3393
|
"mobius",
|
|
3302
3394
|
"mobius-dropdown-menu",
|
|
3303
3395
|
otherProps.className
|
|
3304
3396
|
);
|
|
3305
|
-
const triggerClasses = (0,
|
|
3306
|
-
const listClasses = (0,
|
|
3397
|
+
const triggerClasses = (0, import_dedupe26.default)("mobius", "mobius-dropdown-menu__trigger");
|
|
3398
|
+
const listClasses = (0, import_dedupe26.default)("mobius", "mobius-dropdown-menu__list", {
|
|
3307
3399
|
"--is-open": open
|
|
3308
3400
|
});
|
|
3309
3401
|
const handleChildClick = ({ onClick }, index) => {
|
|
@@ -3313,16 +3405,16 @@ var init_DropdownMenu = __esm({
|
|
|
3313
3405
|
onClick();
|
|
3314
3406
|
}
|
|
3315
3407
|
};
|
|
3316
|
-
return /* @__PURE__ */ (0,
|
|
3317
|
-
trigger ? (0,
|
|
3408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Element, { ref, ...otherProps, className: classes, children: [
|
|
3409
|
+
trigger ? (0, import_react24.cloneElement)(trigger, {
|
|
3318
3410
|
className: triggerClasses,
|
|
3319
3411
|
open,
|
|
3320
3412
|
label,
|
|
3321
3413
|
...buttonProps
|
|
3322
|
-
}) : /* @__PURE__ */ (0,
|
|
3323
|
-
/* @__PURE__ */ (0,
|
|
3324
|
-
if ((0,
|
|
3325
|
-
return (0,
|
|
3414
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
3415
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: listClasses, role: "menu", children: import_react24.Children.map(children, (child, index) => {
|
|
3416
|
+
if ((0, import_react24.isValidElement)(child)) {
|
|
3417
|
+
return (0, import_react24.cloneElement)(child, {
|
|
3326
3418
|
onClick: () => handleChildClick(child.props, index),
|
|
3327
3419
|
active: index === activeId,
|
|
3328
3420
|
...itemProps[index]
|
|
@@ -3337,13 +3429,13 @@ var init_DropdownMenu = __esm({
|
|
|
3337
3429
|
});
|
|
3338
3430
|
|
|
3339
3431
|
// src/components/DropdownMenu/Item.tsx
|
|
3340
|
-
var
|
|
3432
|
+
var import_react25, import_dedupe27, import_jsx_runtime33, Item;
|
|
3341
3433
|
var init_Item = __esm({
|
|
3342
3434
|
"src/components/DropdownMenu/Item.tsx"() {
|
|
3343
3435
|
"use strict";
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3436
|
+
import_react25 = require("react");
|
|
3437
|
+
import_dedupe27 = __toESM(require("classnames/dedupe"));
|
|
3438
|
+
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3347
3439
|
Item = ({ ref, ...props }) => {
|
|
3348
3440
|
const {
|
|
3349
3441
|
elementType: Element = "li",
|
|
@@ -3352,26 +3444,26 @@ var init_Item = __esm({
|
|
|
3352
3444
|
children,
|
|
3353
3445
|
...otherProps
|
|
3354
3446
|
} = props;
|
|
3355
|
-
const classes = (0,
|
|
3447
|
+
const classes = (0, import_dedupe27.default)(
|
|
3356
3448
|
"mobius",
|
|
3357
3449
|
"mobius-dropdown-menu__item",
|
|
3358
3450
|
{ "--is-active": active },
|
|
3359
3451
|
otherProps.className
|
|
3360
3452
|
);
|
|
3361
|
-
return /* @__PURE__ */ (0,
|
|
3362
|
-
if ((0,
|
|
3363
|
-
const childClasses = (0,
|
|
3453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Element, { ref, onClick, ...otherProps, children: import_react25.Children.map(children, (child) => {
|
|
3454
|
+
if ((0, import_react25.isValidElement)(child)) {
|
|
3455
|
+
const childClasses = (0, import_dedupe27.default)(
|
|
3364
3456
|
child.props.className,
|
|
3365
3457
|
classes
|
|
3366
3458
|
);
|
|
3367
|
-
return (0,
|
|
3459
|
+
return (0, import_react25.cloneElement)(
|
|
3368
3460
|
child,
|
|
3369
3461
|
{
|
|
3370
3462
|
className: childClasses
|
|
3371
3463
|
}
|
|
3372
3464
|
);
|
|
3373
3465
|
}
|
|
3374
|
-
return /* @__PURE__ */ (0,
|
|
3466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: classes, children: child });
|
|
3375
3467
|
}) });
|
|
3376
3468
|
};
|
|
3377
3469
|
Item.displayName = "DropdownMenu.Item";
|
|
@@ -3396,23 +3488,23 @@ var init_DropdownMenu2 = __esm({
|
|
|
3396
3488
|
});
|
|
3397
3489
|
|
|
3398
3490
|
// src/components/Fieldset/Fieldset.tsx
|
|
3399
|
-
var
|
|
3491
|
+
var import_dedupe28, import_react26, import_Fieldset, import_jsx_runtime34, useFieldset, Fieldset;
|
|
3400
3492
|
var init_Fieldset = __esm({
|
|
3401
3493
|
"src/components/Fieldset/Fieldset.tsx"() {
|
|
3402
3494
|
"use strict";
|
|
3403
3495
|
"use client";
|
|
3404
|
-
|
|
3405
|
-
|
|
3496
|
+
import_dedupe28 = __toESM(require("classnames/dedupe"));
|
|
3497
|
+
import_react26 = require("react");
|
|
3406
3498
|
init_Flex2();
|
|
3407
3499
|
import_Fieldset = require("@simplybusiness/mobius/src/components/Fieldset/Fieldset.css");
|
|
3408
|
-
|
|
3500
|
+
import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3409
3501
|
useFieldset = (props) => {
|
|
3410
3502
|
const { legend } = props;
|
|
3411
3503
|
let legendProps = {};
|
|
3412
3504
|
let containerProps = {
|
|
3413
3505
|
role: "group"
|
|
3414
3506
|
};
|
|
3415
|
-
const legendId = (0,
|
|
3507
|
+
const legendId = (0, import_react26.useId)();
|
|
3416
3508
|
if (legend) {
|
|
3417
3509
|
legendProps = {
|
|
3418
3510
|
...legendProps,
|
|
@@ -3432,14 +3524,14 @@ var init_Fieldset = __esm({
|
|
|
3432
3524
|
const {
|
|
3433
3525
|
children,
|
|
3434
3526
|
legend,
|
|
3435
|
-
legendComponent = /* @__PURE__ */ (0,
|
|
3527
|
+
legendComponent = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("legend", {}),
|
|
3436
3528
|
...otherProps
|
|
3437
3529
|
} = props;
|
|
3438
3530
|
const { legendProps, containerProps } = useFieldset(props);
|
|
3439
|
-
const classes = (0,
|
|
3531
|
+
const classes = (0, import_dedupe28.default)("mobius", "mobius-fieldset", props.className);
|
|
3440
3532
|
legendProps.className = "mobius-fieldset__legend";
|
|
3441
|
-
return /* @__PURE__ */ (0,
|
|
3442
|
-
legend && (0,
|
|
3533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
3534
|
+
legend && (0, import_react26.cloneElement)(legendComponent, { ...legendProps }, [legend]),
|
|
3443
3535
|
children
|
|
3444
3536
|
] });
|
|
3445
3537
|
};
|
|
@@ -3456,13 +3548,13 @@ var init_Fieldset2 = __esm({
|
|
|
3456
3548
|
});
|
|
3457
3549
|
|
|
3458
3550
|
// src/components/Grid/Grid.tsx
|
|
3459
|
-
var
|
|
3551
|
+
var import_dedupe29, import_jsx_runtime35, Grid;
|
|
3460
3552
|
var init_Grid = __esm({
|
|
3461
3553
|
"src/components/Grid/Grid.tsx"() {
|
|
3462
3554
|
"use strict";
|
|
3463
|
-
|
|
3555
|
+
import_dedupe29 = __toESM(require("classnames/dedupe"));
|
|
3464
3556
|
init_utils();
|
|
3465
|
-
|
|
3557
|
+
import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3466
3558
|
Grid = ({ ref: _ref, ...props }) => {
|
|
3467
3559
|
const {
|
|
3468
3560
|
columns = 12,
|
|
@@ -3477,7 +3569,7 @@ var init_Grid = __esm({
|
|
|
3477
3569
|
style,
|
|
3478
3570
|
...rest
|
|
3479
3571
|
} = props;
|
|
3480
|
-
const classes = (0,
|
|
3572
|
+
const classes = (0, import_dedupe29.default)("mobius", "mobius-grid", className);
|
|
3481
3573
|
const styles = filterUndefinedProps({
|
|
3482
3574
|
boxSizing: "border-box",
|
|
3483
3575
|
display: "grid",
|
|
@@ -3491,22 +3583,22 @@ var init_Grid = __esm({
|
|
|
3491
3583
|
justifyItems,
|
|
3492
3584
|
...style
|
|
3493
3585
|
});
|
|
3494
|
-
return /* @__PURE__ */ (0,
|
|
3586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { style: styles, className: classes, ...rest });
|
|
3495
3587
|
};
|
|
3496
3588
|
Grid.displayName = "Grid";
|
|
3497
3589
|
}
|
|
3498
3590
|
});
|
|
3499
3591
|
|
|
3500
3592
|
// src/components/Grid/Item.tsx
|
|
3501
|
-
var
|
|
3593
|
+
var import_react27, import_dedupe30, import_jsx_runtime36, getBreakpointMap, DEFAULT_SPAN, GridItem;
|
|
3502
3594
|
var init_Item2 = __esm({
|
|
3503
3595
|
"src/components/Grid/Item.tsx"() {
|
|
3504
3596
|
"use strict";
|
|
3505
3597
|
"use client";
|
|
3506
|
-
|
|
3507
|
-
|
|
3598
|
+
import_react27 = require("react");
|
|
3599
|
+
import_dedupe30 = __toESM(require("classnames/dedupe"));
|
|
3508
3600
|
init_hooks();
|
|
3509
|
-
|
|
3601
|
+
import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3510
3602
|
getBreakpointMap = (config) => Object.entries(config).reduce(
|
|
3511
3603
|
(prev, [key, value]) => {
|
|
3512
3604
|
const previous = Object.values(prev);
|
|
@@ -3541,9 +3633,9 @@ var init_Item2 = __esm({
|
|
|
3541
3633
|
xl,
|
|
3542
3634
|
xxl
|
|
3543
3635
|
});
|
|
3544
|
-
const [responsiveSpan, setResponsiveSpan] = (0,
|
|
3545
|
-
const classes = (0,
|
|
3546
|
-
(0,
|
|
3636
|
+
const [responsiveSpan, setResponsiveSpan] = (0, import_react27.useState)();
|
|
3637
|
+
const classes = (0, import_dedupe30.default)("mobius-grid__item", className);
|
|
3638
|
+
(0, import_react27.useEffect)(() => {
|
|
3547
3639
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
3548
3640
|
}, [breakpointSize, breakpointMap]);
|
|
3549
3641
|
const styles = {
|
|
@@ -3551,7 +3643,7 @@ var init_Item2 = __esm({
|
|
|
3551
3643
|
alignSelf,
|
|
3552
3644
|
justifySelf
|
|
3553
3645
|
};
|
|
3554
|
-
return /* @__PURE__ */ (0,
|
|
3646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { style: { ...styles }, className: classes, ...rest });
|
|
3555
3647
|
};
|
|
3556
3648
|
GridItem.displayName = "GridItem";
|
|
3557
3649
|
}
|
|
@@ -3572,20 +3664,20 @@ var init_Grid2 = __esm({
|
|
|
3572
3664
|
});
|
|
3573
3665
|
|
|
3574
3666
|
// src/components/Image/Image.tsx
|
|
3575
|
-
var
|
|
3667
|
+
var import_dedupe31, import_jsx_runtime37, Image;
|
|
3576
3668
|
var init_Image = __esm({
|
|
3577
3669
|
"src/components/Image/Image.tsx"() {
|
|
3578
3670
|
"use strict";
|
|
3579
|
-
|
|
3580
|
-
|
|
3671
|
+
import_dedupe31 = __toESM(require("classnames/dedupe"));
|
|
3672
|
+
import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3581
3673
|
Image = ({
|
|
3582
3674
|
ref,
|
|
3583
3675
|
alt,
|
|
3584
3676
|
elementType: Component = "img",
|
|
3585
3677
|
...otherProps
|
|
3586
3678
|
}) => {
|
|
3587
|
-
const classes = (0,
|
|
3588
|
-
return /* @__PURE__ */ (0,
|
|
3679
|
+
const classes = (0, import_dedupe31.default)("mobius", "mobius-image", otherProps.className);
|
|
3680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Component, { alt, ref, ...otherProps, className: classes });
|
|
3589
3681
|
};
|
|
3590
3682
|
Image.displayName = "Image";
|
|
3591
3683
|
}
|
|
@@ -3600,13 +3692,13 @@ var init_Image2 = __esm({
|
|
|
3600
3692
|
});
|
|
3601
3693
|
|
|
3602
3694
|
// src/components/Link/Link.tsx
|
|
3603
|
-
var
|
|
3695
|
+
var import_dedupe32, import_Link, import_jsx_runtime38, Link;
|
|
3604
3696
|
var init_Link = __esm({
|
|
3605
3697
|
"src/components/Link/Link.tsx"() {
|
|
3606
3698
|
"use strict";
|
|
3607
|
-
|
|
3699
|
+
import_dedupe32 = __toESM(require("classnames/dedupe"));
|
|
3608
3700
|
import_Link = require("@simplybusiness/mobius/src/components/Link/Link.css");
|
|
3609
|
-
|
|
3701
|
+
import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3610
3702
|
Link = ({ ref, ...props }) => {
|
|
3611
3703
|
const {
|
|
3612
3704
|
isDisabled = false,
|
|
@@ -3620,7 +3712,7 @@ var init_Link = __esm({
|
|
|
3620
3712
|
pointerEvents: "none"
|
|
3621
3713
|
};
|
|
3622
3714
|
const styles = { ...style, ...isDisabled && disabledStyles };
|
|
3623
|
-
const classes = (0,
|
|
3715
|
+
const classes = (0, import_dedupe32.default)(
|
|
3624
3716
|
"mobius",
|
|
3625
3717
|
"mobius-link",
|
|
3626
3718
|
className,
|
|
@@ -3629,7 +3721,7 @@ var init_Link = __esm({
|
|
|
3629
3721
|
"--is-disabled": isDisabled
|
|
3630
3722
|
}
|
|
3631
3723
|
);
|
|
3632
|
-
return /* @__PURE__ */ (0,
|
|
3724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3633
3725
|
Component,
|
|
3634
3726
|
{
|
|
3635
3727
|
ref,
|
|
@@ -3664,16 +3756,16 @@ function LinkButton({
|
|
|
3664
3756
|
if (!href) {
|
|
3665
3757
|
throw new Error("LinkButton requires a href prop");
|
|
3666
3758
|
}
|
|
3667
|
-
const classes = (0,
|
|
3668
|
-
return /* @__PURE__ */ (0,
|
|
3759
|
+
const classes = (0, import_dedupe33.default)("mobius", "mobius-link-button", className);
|
|
3760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, { elementType, href, className: classes, ...rest, children });
|
|
3669
3761
|
}
|
|
3670
|
-
var
|
|
3762
|
+
var import_dedupe33, import_jsx_runtime39;
|
|
3671
3763
|
var init_LinkButton = __esm({
|
|
3672
3764
|
"src/components/LinkButton/LinkButton.tsx"() {
|
|
3673
3765
|
"use strict";
|
|
3674
|
-
|
|
3766
|
+
import_dedupe33 = __toESM(require("classnames/dedupe"));
|
|
3675
3767
|
init_Button2();
|
|
3676
|
-
|
|
3768
|
+
import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3677
3769
|
}
|
|
3678
3770
|
});
|
|
3679
3771
|
|
|
@@ -3686,14 +3778,14 @@ var init_LinkButton2 = __esm({
|
|
|
3686
3778
|
});
|
|
3687
3779
|
|
|
3688
3780
|
// src/components/List/List.tsx
|
|
3689
|
-
var
|
|
3781
|
+
var import_react28, import_dedupe34, import_List, import_jsx_runtime40, List;
|
|
3690
3782
|
var init_List = __esm({
|
|
3691
3783
|
"src/components/List/List.tsx"() {
|
|
3692
3784
|
"use strict";
|
|
3693
|
-
|
|
3694
|
-
|
|
3785
|
+
import_react28 = require("react");
|
|
3786
|
+
import_dedupe34 = __toESM(require("classnames/dedupe"));
|
|
3695
3787
|
import_List = require("@simplybusiness/mobius/src/components/List/List.css");
|
|
3696
|
-
|
|
3788
|
+
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3697
3789
|
List = ({ ref, ...props }) => {
|
|
3698
3790
|
const Component = props.isOrdered ? "ol" : "ul";
|
|
3699
3791
|
const { children, icon, ...otherProps } = props;
|
|
@@ -3702,7 +3794,7 @@ var init_List = __esm({
|
|
|
3702
3794
|
...restProps,
|
|
3703
3795
|
reversed: isReversed
|
|
3704
3796
|
};
|
|
3705
|
-
const classes = (0,
|
|
3797
|
+
const classes = (0, import_dedupe34.default)(
|
|
3706
3798
|
"mobius",
|
|
3707
3799
|
"mobius-list",
|
|
3708
3800
|
{
|
|
@@ -3711,9 +3803,9 @@ var init_List = __esm({
|
|
|
3711
3803
|
},
|
|
3712
3804
|
otherProps.className
|
|
3713
3805
|
);
|
|
3714
|
-
return /* @__PURE__ */ (0,
|
|
3715
|
-
if ((0,
|
|
3716
|
-
return (0,
|
|
3806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Component, { ref, ...mappedProps, className: classes, children: import_react28.Children.map(children, (child) => {
|
|
3807
|
+
if ((0, import_react28.isValidElement)(child)) {
|
|
3808
|
+
return (0, import_react28.cloneElement)(child, {
|
|
3717
3809
|
parentIcon: icon
|
|
3718
3810
|
});
|
|
3719
3811
|
}
|
|
@@ -3725,16 +3817,16 @@ var init_List = __esm({
|
|
|
3725
3817
|
});
|
|
3726
3818
|
|
|
3727
3819
|
// src/components/List/ListItem.tsx
|
|
3728
|
-
var
|
|
3820
|
+
var import_dedupe35, import_jsx_runtime41, ListItem;
|
|
3729
3821
|
var init_ListItem = __esm({
|
|
3730
3822
|
"src/components/List/ListItem.tsx"() {
|
|
3731
3823
|
"use strict";
|
|
3732
|
-
|
|
3733
|
-
|
|
3824
|
+
import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3825
|
+
import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3734
3826
|
ListItem = ({ ref, ...props }) => {
|
|
3735
3827
|
const { parentIcon, icon, children, ...otherProps } = props;
|
|
3736
3828
|
const iconContent = icon || parentIcon;
|
|
3737
|
-
const classes = (0,
|
|
3829
|
+
const classes = (0, import_dedupe35.default)(
|
|
3738
3830
|
"mobius",
|
|
3739
3831
|
"mobius-list__item",
|
|
3740
3832
|
{
|
|
@@ -3742,15 +3834,15 @@ var init_ListItem = __esm({
|
|
|
3742
3834
|
},
|
|
3743
3835
|
props.className
|
|
3744
3836
|
);
|
|
3745
|
-
const contentClasses = (0,
|
|
3746
|
-
const iconClasses = (0,
|
|
3837
|
+
const contentClasses = (0, import_dedupe35.default)("mobius", "mobius-list__item-content");
|
|
3838
|
+
const iconClasses = (0, import_dedupe35.default)("mobius", "mobius-list__icon");
|
|
3747
3839
|
if (iconContent) {
|
|
3748
|
-
return /* @__PURE__ */ (0,
|
|
3749
|
-
/* @__PURE__ */ (0,
|
|
3840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("li", { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: contentClasses, children: [
|
|
3841
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: iconClasses, children: iconContent }),
|
|
3750
3842
|
children
|
|
3751
3843
|
] }) });
|
|
3752
3844
|
}
|
|
3753
|
-
return /* @__PURE__ */ (0,
|
|
3845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("li", { ref, ...otherProps, className: classes, children });
|
|
3754
3846
|
};
|
|
3755
3847
|
ListItem.displayName = "ListItem";
|
|
3756
3848
|
}
|
|
@@ -3766,23 +3858,23 @@ var init_List2 = __esm({
|
|
|
3766
3858
|
});
|
|
3767
3859
|
|
|
3768
3860
|
// src/components/LoadingIndicator/LoadingIndicator.tsx
|
|
3769
|
-
var
|
|
3861
|
+
var import_dedupe36, import_icons9, import_LoadingIndicator, import_jsx_runtime42, LoadingIndicator;
|
|
3770
3862
|
var init_LoadingIndicator = __esm({
|
|
3771
3863
|
"src/components/LoadingIndicator/LoadingIndicator.tsx"() {
|
|
3772
3864
|
"use strict";
|
|
3773
|
-
|
|
3865
|
+
import_dedupe36 = __toESM(require("classnames/dedupe"));
|
|
3774
3866
|
import_icons9 = require("@simplybusiness/icons");
|
|
3775
3867
|
init_Icon2();
|
|
3776
3868
|
import_LoadingIndicator = require("@simplybusiness/mobius/src/components/LoadingIndicator/LoadingIndicator.css");
|
|
3777
|
-
|
|
3869
|
+
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3778
3870
|
LoadingIndicator = ({ ref, ...props }) => {
|
|
3779
3871
|
const { icon = import_icons9.loading, ...otherProps } = props;
|
|
3780
|
-
const classes = (0,
|
|
3872
|
+
const classes = (0, import_dedupe36.default)(
|
|
3781
3873
|
"mobius",
|
|
3782
3874
|
"mobius-loading-indicator",
|
|
3783
3875
|
otherProps.className
|
|
3784
3876
|
);
|
|
3785
|
-
return /* @__PURE__ */ (0,
|
|
3877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { icon, spin: true, ref, ...otherProps, className: classes });
|
|
3786
3878
|
};
|
|
3787
3879
|
LoadingIndicator.displayName = "LoadingIndicator";
|
|
3788
3880
|
}
|
|
@@ -3797,16 +3889,16 @@ var init_LoadingIndicator2 = __esm({
|
|
|
3797
3889
|
});
|
|
3798
3890
|
|
|
3799
3891
|
// src/components/Logo/Logo.tsx
|
|
3800
|
-
var
|
|
3892
|
+
var import_dedupe37, import_jsx_runtime43, Logo;
|
|
3801
3893
|
var init_Logo = __esm({
|
|
3802
3894
|
"src/components/Logo/Logo.tsx"() {
|
|
3803
3895
|
"use strict";
|
|
3804
|
-
|
|
3805
|
-
|
|
3896
|
+
import_dedupe37 = __toESM(require("classnames/dedupe"));
|
|
3897
|
+
import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3806
3898
|
Logo = ({ ref, ...props }) => {
|
|
3807
3899
|
const { className, width, height, ...otherProps } = props;
|
|
3808
|
-
const classes = (0,
|
|
3809
|
-
return /* @__PURE__ */ (0,
|
|
3900
|
+
const classes = (0, import_dedupe37.default)("mobius", "mobius-logo", className);
|
|
3901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3810
3902
|
"svg",
|
|
3811
3903
|
{
|
|
3812
3904
|
width,
|
|
@@ -3816,7 +3908,7 @@ var init_Logo = __esm({
|
|
|
3816
3908
|
viewBox: "0 0 144 37",
|
|
3817
3909
|
...otherProps,
|
|
3818
3910
|
children: [
|
|
3819
|
-
/* @__PURE__ */ (0,
|
|
3911
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3820
3912
|
"linearGradient",
|
|
3821
3913
|
{
|
|
3822
3914
|
id: "logo-gradient",
|
|
@@ -3825,27 +3917,27 @@ var init_Logo = __esm({
|
|
|
3825
3917
|
y1: "76.042%",
|
|
3826
3918
|
y2: "26.973%",
|
|
3827
3919
|
children: [
|
|
3828
|
-
/* @__PURE__ */ (0,
|
|
3829
|
-
/* @__PURE__ */ (0,
|
|
3920
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("stop", { stopColor: "#4632D8", offset: "0%" }),
|
|
3921
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("stop", { stopColor: "#9084E8", offset: "100%" })
|
|
3830
3922
|
]
|
|
3831
3923
|
}
|
|
3832
3924
|
) }),
|
|
3833
|
-
/* @__PURE__ */ (0,
|
|
3834
|
-
/* @__PURE__ */ (0,
|
|
3925
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("g", { children: [
|
|
3926
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3835
3927
|
"path",
|
|
3836
3928
|
{
|
|
3837
3929
|
fill: "#0E0A2B",
|
|
3838
3930
|
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"
|
|
3839
3931
|
}
|
|
3840
3932
|
),
|
|
3841
|
-
/* @__PURE__ */ (0,
|
|
3933
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3842
3934
|
"path",
|
|
3843
3935
|
{
|
|
3844
3936
|
fill: "url(#logo-gradient)",
|
|
3845
3937
|
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"
|
|
3846
3938
|
}
|
|
3847
3939
|
),
|
|
3848
|
-
/* @__PURE__ */ (0,
|
|
3940
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3849
3941
|
"path",
|
|
3850
3942
|
{
|
|
3851
3943
|
fill: "#0E0A2B",
|
|
@@ -3870,23 +3962,23 @@ var init_Logo2 = __esm({
|
|
|
3870
3962
|
});
|
|
3871
3963
|
|
|
3872
3964
|
// src/components/Modal/Content.tsx
|
|
3873
|
-
var
|
|
3965
|
+
var import_jsx_runtime44, Content2;
|
|
3874
3966
|
var init_Content2 = __esm({
|
|
3875
3967
|
"src/components/Modal/Content.tsx"() {
|
|
3876
3968
|
"use strict";
|
|
3877
|
-
|
|
3878
|
-
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
3969
|
+
import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3970
|
+
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { ref, ...otherProps, className: "mobius-modal__content", children });
|
|
3879
3971
|
Content2.displayName = "Content";
|
|
3880
3972
|
}
|
|
3881
3973
|
});
|
|
3882
3974
|
|
|
3883
3975
|
// src/components/Modal/ModalContext.tsx
|
|
3884
|
-
var
|
|
3976
|
+
var import_react29, ModalContext;
|
|
3885
3977
|
var init_ModalContext = __esm({
|
|
3886
3978
|
"src/components/Modal/ModalContext.tsx"() {
|
|
3887
3979
|
"use strict";
|
|
3888
|
-
|
|
3889
|
-
ModalContext = (0,
|
|
3980
|
+
import_react29 = require("react");
|
|
3981
|
+
ModalContext = (0, import_react29.createContext)({
|
|
3890
3982
|
onClose: () => {
|
|
3891
3983
|
},
|
|
3892
3984
|
closeLabel: void 0
|
|
@@ -3895,21 +3987,21 @@ var init_ModalContext = __esm({
|
|
|
3895
3987
|
});
|
|
3896
3988
|
|
|
3897
3989
|
// src/components/Modal/useModal.ts
|
|
3898
|
-
var
|
|
3990
|
+
var import_react30, useModal;
|
|
3899
3991
|
var init_useModal = __esm({
|
|
3900
3992
|
"src/components/Modal/useModal.ts"() {
|
|
3901
3993
|
"use strict";
|
|
3902
|
-
|
|
3994
|
+
import_react30 = require("react");
|
|
3903
3995
|
init_ModalContext();
|
|
3904
3996
|
useModal = () => {
|
|
3905
|
-
const { onClose, closeLabel } = (0,
|
|
3997
|
+
const { onClose, closeLabel } = (0, import_react30.useContext)(ModalContext);
|
|
3906
3998
|
return { onClose, closeLabel };
|
|
3907
3999
|
};
|
|
3908
4000
|
}
|
|
3909
4001
|
});
|
|
3910
4002
|
|
|
3911
4003
|
// src/components/Modal/Header.tsx
|
|
3912
|
-
var import_icons10,
|
|
4004
|
+
var import_icons10, import_jsx_runtime45, Header2;
|
|
3913
4005
|
var init_Header2 = __esm({
|
|
3914
4006
|
"src/components/Modal/Header.tsx"() {
|
|
3915
4007
|
"use strict";
|
|
@@ -3917,12 +4009,12 @@ var init_Header2 = __esm({
|
|
|
3917
4009
|
init_Button2();
|
|
3918
4010
|
init_Icon2();
|
|
3919
4011
|
init_useModal();
|
|
3920
|
-
|
|
4012
|
+
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3921
4013
|
Header2 = ({ ref, children, ...otherProps }) => {
|
|
3922
4014
|
const { onClose, closeLabel } = useModal();
|
|
3923
|
-
return /* @__PURE__ */ (0,
|
|
4015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("header", { ref, ...otherProps, className: "mobius-modal__header", children: [
|
|
3924
4016
|
children,
|
|
3925
|
-
/* @__PURE__ */ (0,
|
|
4017
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3926
4018
|
Button,
|
|
3927
4019
|
{
|
|
3928
4020
|
"aria-label": "Close",
|
|
@@ -3930,7 +4022,7 @@ var init_Header2 = __esm({
|
|
|
3930
4022
|
onPress: onClose,
|
|
3931
4023
|
className: "mobius-modal__close",
|
|
3932
4024
|
children: [
|
|
3933
|
-
/* @__PURE__ */ (0,
|
|
4025
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Icon, { icon: import_icons10.cross }),
|
|
3934
4026
|
" ",
|
|
3935
4027
|
closeLabel
|
|
3936
4028
|
]
|
|
@@ -3943,19 +4035,19 @@ var init_Header2 = __esm({
|
|
|
3943
4035
|
});
|
|
3944
4036
|
|
|
3945
4037
|
// src/components/Modal/Modal.tsx
|
|
3946
|
-
var
|
|
4038
|
+
var import_dedupe38, import_react31, import_Modal, import_jsx_runtime46, TRANSITION_CSS_VARIABLE2, Modal;
|
|
3947
4039
|
var init_Modal = __esm({
|
|
3948
4040
|
"src/components/Modal/Modal.tsx"() {
|
|
3949
4041
|
"use strict";
|
|
3950
4042
|
"use client";
|
|
3951
|
-
|
|
3952
|
-
|
|
4043
|
+
import_dedupe38 = __toESM(require("classnames/dedupe"));
|
|
4044
|
+
import_react31 = require("react");
|
|
3953
4045
|
init_hooks();
|
|
3954
4046
|
init_utils();
|
|
3955
4047
|
init_polyfill_tests();
|
|
3956
4048
|
init_ModalContext();
|
|
3957
4049
|
import_Modal = require("@simplybusiness/mobius/src/components/Modal/Modal.css");
|
|
3958
|
-
|
|
4050
|
+
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3959
4051
|
TRANSITION_CSS_VARIABLE2 = "--modal-transition-duration";
|
|
3960
4052
|
Modal = ({ ref, ...props }) => {
|
|
3961
4053
|
const {
|
|
@@ -3969,11 +4061,11 @@ var init_Modal = __esm({
|
|
|
3969
4061
|
animation,
|
|
3970
4062
|
...rest
|
|
3971
4063
|
} = props;
|
|
3972
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3973
|
-
(0,
|
|
4064
|
+
const [shouldTransition, setShouldTransition] = (0, import_react31.useState)(false);
|
|
4065
|
+
(0, import_react31.useEffect)(() => {
|
|
3974
4066
|
setShouldTransition(supportsDialog());
|
|
3975
4067
|
}, []);
|
|
3976
|
-
const dialogRef = (0,
|
|
4068
|
+
const dialogRef = (0, import_react31.useRef)(null);
|
|
3977
4069
|
const { close } = useDialog({
|
|
3978
4070
|
ref: dialogRef,
|
|
3979
4071
|
isOpen,
|
|
@@ -3984,7 +4076,7 @@ var init_Modal = __esm({
|
|
|
3984
4076
|
CSSVariable: TRANSITION_CSS_VARIABLE2
|
|
3985
4077
|
}
|
|
3986
4078
|
});
|
|
3987
|
-
const modalClasses = (0,
|
|
4079
|
+
const modalClasses = (0, import_dedupe38.default)(
|
|
3988
4080
|
"mobius",
|
|
3989
4081
|
"mobius-modal",
|
|
3990
4082
|
{
|
|
@@ -3997,21 +4089,21 @@ var init_Modal = __esm({
|
|
|
3997
4089
|
},
|
|
3998
4090
|
className
|
|
3999
4091
|
);
|
|
4000
|
-
const contextValue = (0,
|
|
4092
|
+
const contextValue = (0, import_react31.useMemo)(
|
|
4001
4093
|
() => ({
|
|
4002
4094
|
onClose: close,
|
|
4003
4095
|
closeLabel
|
|
4004
4096
|
}),
|
|
4005
4097
|
[close, closeLabel]
|
|
4006
4098
|
);
|
|
4007
|
-
return /* @__PURE__ */ (0,
|
|
4099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4008
4100
|
"dialog",
|
|
4009
4101
|
{
|
|
4010
4102
|
ref: mergeRefs([dialogRef, ref]),
|
|
4011
4103
|
onCancel: close,
|
|
4012
4104
|
className: modalClasses,
|
|
4013
4105
|
...rest,
|
|
4014
|
-
children: /* @__PURE__ */ (0,
|
|
4106
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ModalContext.Provider, { value: contextValue, children })
|
|
4015
4107
|
}
|
|
4016
4108
|
);
|
|
4017
4109
|
};
|
|
@@ -4037,16 +4129,16 @@ var init_Modal2 = __esm({
|
|
|
4037
4129
|
});
|
|
4038
4130
|
|
|
4039
4131
|
// src/components/NumberField/NumberField.tsx
|
|
4040
|
-
var
|
|
4132
|
+
var import_dedupe39, import_react32, import_NumberField, import_jsx_runtime47, NumberField;
|
|
4041
4133
|
var init_NumberField = __esm({
|
|
4042
4134
|
"src/components/NumberField/NumberField.tsx"() {
|
|
4043
4135
|
"use strict";
|
|
4044
4136
|
"use client";
|
|
4045
|
-
|
|
4046
|
-
|
|
4137
|
+
import_dedupe39 = __toESM(require("classnames/dedupe"));
|
|
4138
|
+
import_react32 = require("react");
|
|
4047
4139
|
init_TextField2();
|
|
4048
4140
|
import_NumberField = require("@simplybusiness/mobius/src/components/NumberField/NumberField.css");
|
|
4049
|
-
|
|
4141
|
+
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4050
4142
|
NumberField = ({ ref, ...props }) => {
|
|
4051
4143
|
const {
|
|
4052
4144
|
minValue,
|
|
@@ -4062,15 +4154,15 @@ var init_NumberField = __esm({
|
|
|
4062
4154
|
onBlur: customOnBlur,
|
|
4063
4155
|
...rest
|
|
4064
4156
|
} = otherProps;
|
|
4065
|
-
const focusedInputRef = (0,
|
|
4066
|
-
const wheelHandler = (0,
|
|
4067
|
-
(0,
|
|
4157
|
+
const focusedInputRef = (0, import_react32.useRef)(null);
|
|
4158
|
+
const wheelHandler = (0, import_react32.useCallback)((ev) => ev.preventDefault(), []);
|
|
4159
|
+
(0, import_react32.useEffect)(() => {
|
|
4068
4160
|
return () => {
|
|
4069
4161
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
4070
4162
|
focusedInputRef.current = null;
|
|
4071
4163
|
};
|
|
4072
4164
|
}, [wheelHandler]);
|
|
4073
|
-
const containerClasses = (0,
|
|
4165
|
+
const containerClasses = (0, import_dedupe39.default)("mobius-number-field", className, {
|
|
4074
4166
|
"--hide-spin-buttons": hideSpinButtons
|
|
4075
4167
|
});
|
|
4076
4168
|
const handleBeforeInput = (event) => {
|
|
@@ -4114,7 +4206,7 @@ var init_NumberField = __esm({
|
|
|
4114
4206
|
},
|
|
4115
4207
|
onBlur: (e) => handleBlur(e)
|
|
4116
4208
|
};
|
|
4117
|
-
return /* @__PURE__ */ (0,
|
|
4209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4118
4210
|
TextField,
|
|
4119
4211
|
{
|
|
4120
4212
|
...forwardedProps,
|
|
@@ -4142,18 +4234,18 @@ var init_NumberField2 = __esm({
|
|
|
4142
4234
|
});
|
|
4143
4235
|
|
|
4144
4236
|
// src/components/Option/Option.tsx
|
|
4145
|
-
var
|
|
4237
|
+
var import_jsx_runtime48, Option2;
|
|
4146
4238
|
var init_Option2 = __esm({
|
|
4147
4239
|
"src/components/Option/Option.tsx"() {
|
|
4148
4240
|
"use strict";
|
|
4149
|
-
|
|
4241
|
+
import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4150
4242
|
Option2 = ({ ref, ...props }) => {
|
|
4151
4243
|
const { isDisabled, ...rest } = props;
|
|
4152
4244
|
const mappedProps = {
|
|
4153
4245
|
...rest,
|
|
4154
4246
|
disabled: isDisabled
|
|
4155
4247
|
};
|
|
4156
|
-
return /* @__PURE__ */ (0,
|
|
4248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("option", { ...mappedProps, ref });
|
|
4157
4249
|
};
|
|
4158
4250
|
Option2.displayName = "Option";
|
|
4159
4251
|
}
|
|
@@ -4168,17 +4260,17 @@ var init_Option3 = __esm({
|
|
|
4168
4260
|
});
|
|
4169
4261
|
|
|
4170
4262
|
// src/components/PasswordField/ShowHideButton.tsx
|
|
4171
|
-
var import_icons11,
|
|
4263
|
+
var import_icons11, import_jsx_runtime49, ShowHideButton;
|
|
4172
4264
|
var init_ShowHideButton = __esm({
|
|
4173
4265
|
"src/components/PasswordField/ShowHideButton.tsx"() {
|
|
4174
4266
|
"use strict";
|
|
4175
4267
|
import_icons11 = require("@simplybusiness/icons");
|
|
4176
4268
|
init_src();
|
|
4177
|
-
|
|
4269
|
+
import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4178
4270
|
ShowHideButton = ({
|
|
4179
4271
|
show = false,
|
|
4180
4272
|
onClick
|
|
4181
|
-
}) => /* @__PURE__ */ (0,
|
|
4273
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4182
4274
|
"button",
|
|
4183
4275
|
{
|
|
4184
4276
|
className: "mobius-password-field__show-button",
|
|
@@ -4189,35 +4281,35 @@ var init_ShowHideButton = __esm({
|
|
|
4189
4281
|
},
|
|
4190
4282
|
"aria-label": `${show ? "Hide" : "Show"} password`,
|
|
4191
4283
|
"data-testid": "show-hide-button",
|
|
4192
|
-
children: /* @__PURE__ */ (0,
|
|
4284
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { icon: show ? import_icons11.eyeSlash : import_icons11.eye, "aria-hidden": "true" })
|
|
4193
4285
|
}
|
|
4194
4286
|
);
|
|
4195
4287
|
}
|
|
4196
4288
|
});
|
|
4197
4289
|
|
|
4198
4290
|
// src/components/PasswordField/PasswordField.tsx
|
|
4199
|
-
var
|
|
4291
|
+
var import_dedupe40, import_react33, import_PasswordField, import_jsx_runtime50, PasswordField;
|
|
4200
4292
|
var init_PasswordField = __esm({
|
|
4201
4293
|
"src/components/PasswordField/PasswordField.tsx"() {
|
|
4202
4294
|
"use strict";
|
|
4203
4295
|
"use client";
|
|
4204
|
-
|
|
4205
|
-
|
|
4296
|
+
import_dedupe40 = __toESM(require("classnames/dedupe"));
|
|
4297
|
+
import_react33 = require("react");
|
|
4206
4298
|
init_mergeRefs();
|
|
4207
4299
|
init_TextField2();
|
|
4208
4300
|
init_ShowHideButton();
|
|
4209
4301
|
import_PasswordField = require("@simplybusiness/mobius/src/components/PasswordField/PasswordField.css");
|
|
4210
|
-
|
|
4302
|
+
import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4211
4303
|
PasswordField = ({
|
|
4212
4304
|
ref,
|
|
4213
4305
|
className,
|
|
4214
4306
|
autoComplete = "current-password",
|
|
4215
4307
|
...props
|
|
4216
4308
|
}) => {
|
|
4217
|
-
const [show, setShow] = (0,
|
|
4309
|
+
const [show, setShow] = (0, import_react33.useState)(false);
|
|
4218
4310
|
const type = show ? "text" : "password";
|
|
4219
|
-
const classes = (0,
|
|
4220
|
-
const localRef = (0,
|
|
4311
|
+
const classes = (0, import_dedupe40.default)("mobius-password-field", className);
|
|
4312
|
+
const localRef = (0, import_react33.useRef)(null);
|
|
4221
4313
|
const handleShowHideButtonClick = () => {
|
|
4222
4314
|
const selectionStart = localRef.current?.selectionStart;
|
|
4223
4315
|
const selectionEnd = localRef.current?.selectionEnd;
|
|
@@ -4229,7 +4321,7 @@ var init_PasswordField = __esm({
|
|
|
4229
4321
|
}
|
|
4230
4322
|
});
|
|
4231
4323
|
};
|
|
4232
|
-
return /* @__PURE__ */ (0,
|
|
4324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4233
4325
|
TextField,
|
|
4234
4326
|
{
|
|
4235
4327
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -4237,7 +4329,7 @@ var init_PasswordField = __esm({
|
|
|
4237
4329
|
...props,
|
|
4238
4330
|
autoComplete,
|
|
4239
4331
|
type,
|
|
4240
|
-
suffixInside: /* @__PURE__ */ (0,
|
|
4332
|
+
suffixInside: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ShowHideButton, { onClick: handleShowHideButtonClick, show })
|
|
4241
4333
|
}
|
|
4242
4334
|
);
|
|
4243
4335
|
};
|
|
@@ -4254,39 +4346,39 @@ var init_PasswordField2 = __esm({
|
|
|
4254
4346
|
});
|
|
4255
4347
|
|
|
4256
4348
|
// src/components/Popover/Popover.tsx
|
|
4257
|
-
var
|
|
4349
|
+
var import_react34, import_icons12, import_dedupe41, import_react35, import_mobius_hooks6, import_Popover, import_jsx_runtime51, OFFSET_FROM_CONTENT_DEFAULT, Popover;
|
|
4258
4350
|
var init_Popover = __esm({
|
|
4259
4351
|
"src/components/Popover/Popover.tsx"() {
|
|
4260
4352
|
"use strict";
|
|
4261
|
-
|
|
4353
|
+
import_react34 = require("@floating-ui/react");
|
|
4262
4354
|
import_icons12 = require("@simplybusiness/icons");
|
|
4263
|
-
|
|
4264
|
-
|
|
4355
|
+
import_dedupe41 = __toESM(require("classnames/dedupe"));
|
|
4356
|
+
import_react35 = require("react");
|
|
4265
4357
|
import_mobius_hooks6 = require("@simplybusiness/mobius-hooks");
|
|
4266
4358
|
init_Button2();
|
|
4267
4359
|
init_Icon2();
|
|
4268
4360
|
import_Popover = require("@simplybusiness/mobius/src/components/Popover/Popover.css");
|
|
4269
|
-
|
|
4361
|
+
import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4270
4362
|
OFFSET_FROM_CONTENT_DEFAULT = 10;
|
|
4271
4363
|
Popover = (props) => {
|
|
4272
4364
|
const { trigger, children, onOpen, onClose, className } = props;
|
|
4273
|
-
const arrowRef = (0,
|
|
4274
|
-
const floatingContainerRef = (0,
|
|
4275
|
-
const [isOpen, setIsOpen] = (0,
|
|
4276
|
-
const { refs, floatingStyles, context } = (0,
|
|
4365
|
+
const arrowRef = (0, import_react35.useRef)(null);
|
|
4366
|
+
const floatingContainerRef = (0, import_react35.useRef)(null);
|
|
4367
|
+
const [isOpen, setIsOpen] = (0, import_react35.useState)(false);
|
|
4368
|
+
const { refs, floatingStyles, context } = (0, import_react34.useFloating)({
|
|
4277
4369
|
open: isOpen,
|
|
4278
4370
|
onOpenChange: setIsOpen,
|
|
4279
|
-
whileElementsMounted:
|
|
4371
|
+
whileElementsMounted: import_react34.autoUpdate,
|
|
4280
4372
|
middleware: [
|
|
4281
|
-
(0,
|
|
4373
|
+
(0, import_react34.arrow)({
|
|
4282
4374
|
element: arrowRef
|
|
4283
4375
|
}),
|
|
4284
|
-
(0,
|
|
4285
|
-
(0,
|
|
4286
|
-
(0,
|
|
4376
|
+
(0, import_react34.offset)(OFFSET_FROM_CONTENT_DEFAULT),
|
|
4377
|
+
(0, import_react34.shift)(),
|
|
4378
|
+
(0, import_react34.flip)()
|
|
4287
4379
|
]
|
|
4288
4380
|
});
|
|
4289
|
-
const dismiss = (0,
|
|
4381
|
+
const dismiss = (0, import_react34.useDismiss)(context, {
|
|
4290
4382
|
bubbles: true,
|
|
4291
4383
|
outsidePress: (event) => {
|
|
4292
4384
|
const toggle = refs.reference.current;
|
|
@@ -4297,20 +4389,20 @@ var init_Popover = __esm({
|
|
|
4297
4389
|
return true;
|
|
4298
4390
|
}
|
|
4299
4391
|
});
|
|
4300
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
4301
|
-
const containerClasses = (0,
|
|
4392
|
+
const { getReferenceProps, getFloatingProps } = (0, import_react34.useInteractions)([dismiss]);
|
|
4393
|
+
const containerClasses = (0, import_dedupe41.default)(
|
|
4302
4394
|
"mobius",
|
|
4303
4395
|
"mobius-popover__container",
|
|
4304
4396
|
className
|
|
4305
4397
|
);
|
|
4306
|
-
const setFloatingRef = (0,
|
|
4398
|
+
const setFloatingRef = (0, import_react35.useCallback)(
|
|
4307
4399
|
(node) => {
|
|
4308
4400
|
refs.setFloating(node);
|
|
4309
4401
|
floatingContainerRef.current = node;
|
|
4310
4402
|
},
|
|
4311
4403
|
[refs]
|
|
4312
4404
|
);
|
|
4313
|
-
(0,
|
|
4405
|
+
(0, import_react35.useEffect)(() => {
|
|
4314
4406
|
const el = floatingContainerRef.current;
|
|
4315
4407
|
if (!el) return;
|
|
4316
4408
|
const preventLabelActivation = (e) => {
|
|
@@ -4331,9 +4423,9 @@ var init_Popover = __esm({
|
|
|
4331
4423
|
setIsOpen(true);
|
|
4332
4424
|
onOpen?.();
|
|
4333
4425
|
};
|
|
4334
|
-
const triggerComponent = (0,
|
|
4426
|
+
const triggerComponent = (0, import_react35.cloneElement)(trigger, {
|
|
4335
4427
|
ref: refs.setReference,
|
|
4336
|
-
className: (0,
|
|
4428
|
+
className: (0, import_dedupe41.default)(
|
|
4337
4429
|
trigger.props.className,
|
|
4338
4430
|
"mobius-popover__toggle"
|
|
4339
4431
|
),
|
|
@@ -4347,9 +4439,9 @@ var init_Popover = __esm({
|
|
|
4347
4439
|
e.stopPropagation();
|
|
4348
4440
|
}
|
|
4349
4441
|
});
|
|
4350
|
-
return /* @__PURE__ */ (0,
|
|
4442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
4351
4443
|
triggerComponent,
|
|
4352
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4444
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
4353
4445
|
"div",
|
|
4354
4446
|
{
|
|
4355
4447
|
className: containerClasses,
|
|
@@ -4357,8 +4449,8 @@ var init_Popover = __esm({
|
|
|
4357
4449
|
style: floatingStyles,
|
|
4358
4450
|
...getFloatingProps(),
|
|
4359
4451
|
children: [
|
|
4360
|
-
/* @__PURE__ */ (0,
|
|
4361
|
-
/* @__PURE__ */ (0,
|
|
4452
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "mobius-popover", children: [
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("header", { className: "mobius-popover__header", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4362
4454
|
Button,
|
|
4363
4455
|
{
|
|
4364
4456
|
type: "button",
|
|
@@ -4366,7 +4458,7 @@ var init_Popover = __esm({
|
|
|
4366
4458
|
onClick: toggleVisibility,
|
|
4367
4459
|
"aria-label": "Close",
|
|
4368
4460
|
variant: "ghost",
|
|
4369
|
-
children: /* @__PURE__ */ (0,
|
|
4461
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4370
4462
|
Icon,
|
|
4371
4463
|
{
|
|
4372
4464
|
icon: import_icons12.cross,
|
|
@@ -4376,10 +4468,10 @@ var init_Popover = __esm({
|
|
|
4376
4468
|
)
|
|
4377
4469
|
}
|
|
4378
4470
|
) }),
|
|
4379
|
-
/* @__PURE__ */ (0,
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mobius-popover__body", children })
|
|
4380
4472
|
] }),
|
|
4381
|
-
/* @__PURE__ */ (0,
|
|
4382
|
-
|
|
4473
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4474
|
+
import_react34.FloatingArrow,
|
|
4383
4475
|
{
|
|
4384
4476
|
ref: arrowRef,
|
|
4385
4477
|
context,
|
|
@@ -4415,17 +4507,17 @@ function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
|
4415
4507
|
console.warn("Progress value is greater than maxValue");
|
|
4416
4508
|
}
|
|
4417
4509
|
}
|
|
4418
|
-
var
|
|
4510
|
+
var import_dedupe42, import_react36, import_Progress, import_jsx_runtime52, sanitizedValue, getLabelComponent, DEFAULT_VALUE, DEFAULT_MIN_VALUE, DEFAULT_MAX_VALUE, Progress;
|
|
4419
4511
|
var init_Progress = __esm({
|
|
4420
4512
|
"src/components/Progress/Progress.tsx"() {
|
|
4421
4513
|
"use strict";
|
|
4422
4514
|
"use client";
|
|
4423
|
-
|
|
4424
|
-
|
|
4515
|
+
import_dedupe42 = __toESM(require("classnames/dedupe"));
|
|
4516
|
+
import_react36 = require("react");
|
|
4425
4517
|
init_Label2();
|
|
4426
4518
|
init_VisuallyHidden2();
|
|
4427
4519
|
import_Progress = require("@simplybusiness/mobius/src/components/Progress/Progress.css");
|
|
4428
|
-
|
|
4520
|
+
import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4429
4521
|
sanitizedValue = (value, defaultValue) => {
|
|
4430
4522
|
if (value === void 0 || Number.isNaN(value)) {
|
|
4431
4523
|
return defaultValue;
|
|
@@ -4434,7 +4526,7 @@ var init_Progress = __esm({
|
|
|
4434
4526
|
};
|
|
4435
4527
|
getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
4436
4528
|
if (showLabel) {
|
|
4437
|
-
return /* @__PURE__ */ (0,
|
|
4529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4438
4530
|
Label,
|
|
4439
4531
|
{
|
|
4440
4532
|
id: progressLabelId,
|
|
@@ -4444,7 +4536,7 @@ var init_Progress = __esm({
|
|
|
4444
4536
|
}
|
|
4445
4537
|
);
|
|
4446
4538
|
}
|
|
4447
|
-
return /* @__PURE__ */ (0,
|
|
4539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4448
4540
|
Label,
|
|
4449
4541
|
{
|
|
4450
4542
|
id: progressLabelId,
|
|
@@ -4458,8 +4550,8 @@ var init_Progress = __esm({
|
|
|
4458
4550
|
DEFAULT_MIN_VALUE = 0;
|
|
4459
4551
|
DEFAULT_MAX_VALUE = 100;
|
|
4460
4552
|
Progress = ({ ref, ...props }) => {
|
|
4461
|
-
const progressId = (0,
|
|
4462
|
-
const progressLabelId = (0,
|
|
4553
|
+
const progressId = (0, import_react36.useId)();
|
|
4554
|
+
const progressLabelId = (0, import_react36.useId)();
|
|
4463
4555
|
const {
|
|
4464
4556
|
id,
|
|
4465
4557
|
label,
|
|
@@ -4484,7 +4576,7 @@ var init_Progress = __esm({
|
|
|
4484
4576
|
100
|
|
4485
4577
|
);
|
|
4486
4578
|
const barWidth = `${percentage}%`;
|
|
4487
|
-
const classes = (0,
|
|
4579
|
+
const classes = (0, import_dedupe42.default)("mobius", "mobius-progress", className, {
|
|
4488
4580
|
"--is-primary": variant === "primary",
|
|
4489
4581
|
"--is-secondary": variant === "secondary"
|
|
4490
4582
|
});
|
|
@@ -4494,7 +4586,7 @@ var init_Progress = __esm({
|
|
|
4494
4586
|
progressBarProps["aria-valuenow"] = value.toString();
|
|
4495
4587
|
progressBarProps["aria-valuetext"] = valueFormatter instanceof Function ? valueFormatter(value, minValue, maxValue) : barWidth;
|
|
4496
4588
|
const labelComponent = getLabelComponent(label, progressLabelId, showLabel);
|
|
4497
|
-
return /* @__PURE__ */ (0,
|
|
4589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
4498
4590
|
"div",
|
|
4499
4591
|
{
|
|
4500
4592
|
id: id || progressId,
|
|
@@ -4505,8 +4597,8 @@ var init_Progress = __esm({
|
|
|
4505
4597
|
"aria-labelledby": progressLabelId,
|
|
4506
4598
|
children: [
|
|
4507
4599
|
labelComponent,
|
|
4508
|
-
/* @__PURE__ */ (0,
|
|
4509
|
-
showValueLabel && /* @__PURE__ */ (0,
|
|
4600
|
+
/* @__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 } }) }),
|
|
4601
|
+
showValueLabel && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
|
|
4510
4602
|
]
|
|
4511
4603
|
}
|
|
4512
4604
|
);
|
|
@@ -4524,17 +4616,17 @@ var init_Progress2 = __esm({
|
|
|
4524
4616
|
});
|
|
4525
4617
|
|
|
4526
4618
|
// src/components/Radio/Radio.tsx
|
|
4527
|
-
var
|
|
4619
|
+
var import_dedupe43, import_react37, import_Radio, import_jsx_runtime53, Radio;
|
|
4528
4620
|
var init_Radio = __esm({
|
|
4529
4621
|
"src/components/Radio/Radio.tsx"() {
|
|
4530
4622
|
"use strict";
|
|
4531
4623
|
"use client";
|
|
4532
|
-
|
|
4533
|
-
|
|
4624
|
+
import_dedupe43 = __toESM(require("classnames/dedupe"));
|
|
4625
|
+
import_react37 = require("react");
|
|
4534
4626
|
init_ErrorMessage2();
|
|
4535
4627
|
init_Label2();
|
|
4536
4628
|
import_Radio = require("@simplybusiness/mobius/src/components/Radio/Radio.css");
|
|
4537
|
-
|
|
4629
|
+
import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4538
4630
|
Radio = ({ ref, ...props }) => {
|
|
4539
4631
|
const {
|
|
4540
4632
|
children,
|
|
@@ -4558,19 +4650,19 @@ var init_Radio = __esm({
|
|
|
4558
4650
|
const isMultiline = label && children;
|
|
4559
4651
|
const isControlled = selected !== void 0;
|
|
4560
4652
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
4561
|
-
const contentRef = (0,
|
|
4562
|
-
const prevOverflowRef = (0,
|
|
4653
|
+
const contentRef = (0, import_react37.useRef)(null);
|
|
4654
|
+
const prevOverflowRef = (0, import_react37.useRef)({
|
|
4563
4655
|
vertical: false,
|
|
4564
4656
|
horizontal: false
|
|
4565
4657
|
});
|
|
4566
|
-
const hasIconFirst = (0,
|
|
4567
|
-
if (!children ||
|
|
4568
|
-
const firstChild =
|
|
4569
|
-
if (!(0,
|
|
4658
|
+
const hasIconFirst = (0, import_react37.useMemo)(() => {
|
|
4659
|
+
if (!children || import_react37.Children.count(children) === 0) return false;
|
|
4660
|
+
const firstChild = import_react37.Children.toArray(children)[0];
|
|
4661
|
+
if (!(0, import_react37.isValidElement)(firstChild)) return false;
|
|
4570
4662
|
const props2 = firstChild.props;
|
|
4571
4663
|
return "icon" in props2 && props2.icon !== void 0;
|
|
4572
4664
|
}, [children]);
|
|
4573
|
-
(0,
|
|
4665
|
+
(0, import_react37.useLayoutEffect)(() => {
|
|
4574
4666
|
if (!contentRef.current || !onOverflow) return;
|
|
4575
4667
|
if (orientation === "vertical") {
|
|
4576
4668
|
return;
|
|
@@ -4599,13 +4691,13 @@ var init_Radio = __esm({
|
|
|
4599
4691
|
"--is-multiline": !!isMultiline,
|
|
4600
4692
|
"--is-required": isRequired
|
|
4601
4693
|
};
|
|
4602
|
-
const containerClasses = (0,
|
|
4694
|
+
const containerClasses = (0, import_dedupe43.default)(
|
|
4603
4695
|
"mobius-radio__label",
|
|
4604
4696
|
radioClasses,
|
|
4605
4697
|
className,
|
|
4606
4698
|
{ "--has-icon-first": hasIconFirst }
|
|
4607
4699
|
);
|
|
4608
|
-
const inputClasses = (0,
|
|
4700
|
+
const inputClasses = (0, import_dedupe43.default)("mobius-radio__input", radioClasses);
|
|
4609
4701
|
const { "aria-describedby": _ariaDescribedBy, ...rest } = otherProps;
|
|
4610
4702
|
const handleChange = (event) => {
|
|
4611
4703
|
if (setSelected) {
|
|
@@ -4619,9 +4711,9 @@ var init_Radio = __esm({
|
|
|
4619
4711
|
onChange(adaptedEvent);
|
|
4620
4712
|
}
|
|
4621
4713
|
};
|
|
4622
|
-
return /* @__PURE__ */ (0,
|
|
4623
|
-
/* @__PURE__ */ (0,
|
|
4624
|
-
/* @__PURE__ */ (0,
|
|
4714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
4715
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Label, { className: containerClasses, children: [
|
|
4716
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4625
4717
|
"input",
|
|
4626
4718
|
{
|
|
4627
4719
|
"aria-describedby": otherProps["aria-describedby"],
|
|
@@ -4638,12 +4730,12 @@ var init_Radio = __esm({
|
|
|
4638
4730
|
...rest
|
|
4639
4731
|
}
|
|
4640
4732
|
),
|
|
4641
|
-
isMultiline ? /* @__PURE__ */ (0,
|
|
4642
|
-
/* @__PURE__ */ (0,
|
|
4643
|
-
/* @__PURE__ */ (0,
|
|
4644
|
-
] }) : /* @__PURE__ */ (0,
|
|
4733
|
+
isMultiline ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { ref: contentRef, className: "mobius-radio__content--multiline", children: [
|
|
4734
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mobius-radio__content-first-line", children: label }),
|
|
4735
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mobius-radio__extra-content", children })
|
|
4736
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { ref: contentRef, className: "mobius-radio__content", children: label || children })
|
|
4645
4737
|
] }),
|
|
4646
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
4738
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorMessage, { errorMessage })
|
|
4647
4739
|
] });
|
|
4648
4740
|
};
|
|
4649
4741
|
Radio.displayName = "Radio";
|
|
@@ -4651,19 +4743,19 @@ var init_Radio = __esm({
|
|
|
4651
4743
|
});
|
|
4652
4744
|
|
|
4653
4745
|
// src/components/Radio/RadioGroup.tsx
|
|
4654
|
-
var
|
|
4746
|
+
var import_dedupe44, import_react38, import_jsx_runtime54, getDefaultVal, RadioGroup;
|
|
4655
4747
|
var init_RadioGroup = __esm({
|
|
4656
4748
|
"src/components/Radio/RadioGroup.tsx"() {
|
|
4657
4749
|
"use strict";
|
|
4658
4750
|
"use client";
|
|
4659
|
-
|
|
4660
|
-
|
|
4751
|
+
import_dedupe44 = __toESM(require("classnames/dedupe"));
|
|
4752
|
+
import_react38 = require("react");
|
|
4661
4753
|
init_hooks();
|
|
4662
4754
|
init_spaceDelimitedList();
|
|
4663
4755
|
init_ErrorMessage2();
|
|
4664
4756
|
init_Label2();
|
|
4665
4757
|
init_Stack2();
|
|
4666
|
-
|
|
4758
|
+
import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4667
4759
|
getDefaultVal = (children, defaultValue) => {
|
|
4668
4760
|
if (Array.isArray(children) && defaultValue) {
|
|
4669
4761
|
const option = children?.find((item) => item.props.value === defaultValue);
|
|
@@ -4691,15 +4783,15 @@ var init_RadioGroup = __esm({
|
|
|
4691
4783
|
...rest
|
|
4692
4784
|
} = props;
|
|
4693
4785
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
4694
|
-
const [selected, setSelected] = (0,
|
|
4695
|
-
const overflowsRef = (0,
|
|
4696
|
-
const [hasOverflow, setHasOverflow] = (0,
|
|
4697
|
-
(0,
|
|
4786
|
+
const [selected, setSelected] = (0, import_react38.useState)(defaultSelected);
|
|
4787
|
+
const overflowsRef = (0, import_react38.useRef)({});
|
|
4788
|
+
const [hasOverflow, setHasOverflow] = (0, import_react38.useState)(false);
|
|
4789
|
+
(0, import_react38.useEffect)(() => {
|
|
4698
4790
|
if (value !== void 0) {
|
|
4699
4791
|
setSelected(value);
|
|
4700
4792
|
}
|
|
4701
4793
|
}, [value]);
|
|
4702
|
-
const handleOverflow = (0,
|
|
4794
|
+
const handleOverflow = (0, import_react38.useCallback)(
|
|
4703
4795
|
(radioValue, overflow) => {
|
|
4704
4796
|
overflowsRef.current = {
|
|
4705
4797
|
...overflowsRef.current,
|
|
@@ -4723,26 +4815,26 @@ var init_RadioGroup = __esm({
|
|
|
4723
4815
|
[`--is-${effectiveOrientation}`]: true,
|
|
4724
4816
|
[className || ""]: true
|
|
4725
4817
|
};
|
|
4726
|
-
const radioGroupClasses = (0,
|
|
4818
|
+
const radioGroupClasses = (0, import_dedupe44.default)(
|
|
4727
4819
|
"mobius",
|
|
4728
4820
|
"mobius-radio-group",
|
|
4729
4821
|
radioClasses,
|
|
4730
4822
|
validationClasses
|
|
4731
4823
|
);
|
|
4732
|
-
const radioWrapperClasses = (0,
|
|
4824
|
+
const radioWrapperClasses = (0, import_dedupe44.default)("mobius-radio__wrapper", {
|
|
4733
4825
|
[`--is-${effectiveOrientation}`]: true
|
|
4734
4826
|
});
|
|
4735
|
-
const labelClasses = (0,
|
|
4736
|
-
const errorMessageId = (0,
|
|
4737
|
-
const defaultNameAttrId = (0,
|
|
4827
|
+
const labelClasses = (0, import_dedupe44.default)(radioClasses, validationClasses);
|
|
4828
|
+
const errorMessageId = (0, import_react38.useId)();
|
|
4829
|
+
const defaultNameAttrId = (0, import_react38.useId)();
|
|
4738
4830
|
const nameAttribute = name || defaultNameAttrId;
|
|
4739
4831
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4740
4832
|
const describedBy = spaceDelimitedList([
|
|
4741
4833
|
shouldErrorMessageShow,
|
|
4742
4834
|
props["aria-describedby"]
|
|
4743
4835
|
]);
|
|
4744
|
-
const labelId = (0,
|
|
4745
|
-
return /* @__PURE__ */ (0,
|
|
4836
|
+
const labelId = (0, import_react38.useId)();
|
|
4837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4746
4838
|
"div",
|
|
4747
4839
|
{
|
|
4748
4840
|
...rest,
|
|
@@ -4758,12 +4850,12 @@ var init_RadioGroup = __esm({
|
|
|
4758
4850
|
ref,
|
|
4759
4851
|
className: radioGroupClasses,
|
|
4760
4852
|
role: "radiogroup",
|
|
4761
|
-
children: /* @__PURE__ */ (0,
|
|
4762
|
-
label && /* @__PURE__ */ (0,
|
|
4763
|
-
/* @__PURE__ */ (0,
|
|
4764
|
-
if ((0,
|
|
4853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Stack, { gap: "xs", children: [
|
|
4854
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
4855
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: radioWrapperClasses, children: import_react38.Children.map(children, (child) => {
|
|
4856
|
+
if ((0, import_react38.isValidElement)(child)) {
|
|
4765
4857
|
const childValue = child.props.value;
|
|
4766
|
-
return (0,
|
|
4858
|
+
return (0, import_react38.cloneElement)(
|
|
4767
4859
|
child,
|
|
4768
4860
|
{
|
|
4769
4861
|
orientation: effectiveOrientation,
|
|
@@ -4781,7 +4873,7 @@ var init_RadioGroup = __esm({
|
|
|
4781
4873
|
}
|
|
4782
4874
|
return child;
|
|
4783
4875
|
}) }),
|
|
4784
|
-
/* @__PURE__ */ (0,
|
|
4876
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4785
4877
|
] })
|
|
4786
4878
|
}
|
|
4787
4879
|
);
|
|
@@ -4800,47 +4892,47 @@ var init_Radio2 = __esm({
|
|
|
4800
4892
|
});
|
|
4801
4893
|
|
|
4802
4894
|
// src/components/Segment/SegmentGroup.tsx
|
|
4803
|
-
var
|
|
4895
|
+
var import_dedupe45, import_jsx_runtime55, SegmentGroup;
|
|
4804
4896
|
var init_SegmentGroup = __esm({
|
|
4805
4897
|
"src/components/Segment/SegmentGroup.tsx"() {
|
|
4806
4898
|
"use strict";
|
|
4807
|
-
|
|
4808
|
-
|
|
4899
|
+
import_dedupe45 = __toESM(require("classnames/dedupe"));
|
|
4900
|
+
import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4809
4901
|
SegmentGroup = (props) => {
|
|
4810
4902
|
const { children, horizontal, gap, className, ...rest } = props;
|
|
4811
4903
|
const gapClass = gap ? `gap-${gap}` : "";
|
|
4812
|
-
const classes = (0,
|
|
4904
|
+
const classes = (0, import_dedupe45.default)(
|
|
4813
4905
|
"mobius",
|
|
4814
4906
|
"mobius-segment-group",
|
|
4815
4907
|
className,
|
|
4816
4908
|
{ "--is-horizontal": horizontal },
|
|
4817
4909
|
gapClass
|
|
4818
4910
|
);
|
|
4819
|
-
return /* @__PURE__ */ (0,
|
|
4911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: classes, ...rest, children });
|
|
4820
4912
|
};
|
|
4821
4913
|
SegmentGroup.displayName = "SegmentGroup";
|
|
4822
4914
|
}
|
|
4823
4915
|
});
|
|
4824
4916
|
|
|
4825
4917
|
// src/components/Segment/Segment.tsx
|
|
4826
|
-
var
|
|
4918
|
+
var import_dedupe46, import_Segment, import_jsx_runtime56, Segment;
|
|
4827
4919
|
var init_Segment = __esm({
|
|
4828
4920
|
"src/components/Segment/Segment.tsx"() {
|
|
4829
4921
|
"use strict";
|
|
4830
|
-
|
|
4922
|
+
import_dedupe46 = __toESM(require("classnames/dedupe"));
|
|
4831
4923
|
import_Segment = require("@simplybusiness/mobius/src/components/Segment/Segment.css");
|
|
4832
|
-
|
|
4924
|
+
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4833
4925
|
Segment = (props) => {
|
|
4834
4926
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
4835
|
-
const classes = (0,
|
|
4927
|
+
const classes = (0, import_dedupe46.default)(
|
|
4836
4928
|
"mobius",
|
|
4837
4929
|
"mobius-segment",
|
|
4838
4930
|
colour,
|
|
4839
4931
|
{ inverted },
|
|
4840
4932
|
className
|
|
4841
4933
|
);
|
|
4842
|
-
return /* @__PURE__ */ (0,
|
|
4843
|
-
heading && /* @__PURE__ */ (0,
|
|
4934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: classes, ...rest, children: [
|
|
4935
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "mobius-segment__heading", children: heading }),
|
|
4844
4936
|
children
|
|
4845
4937
|
] });
|
|
4846
4938
|
};
|
|
@@ -4858,14 +4950,14 @@ var init_Segment2 = __esm({
|
|
|
4858
4950
|
});
|
|
4859
4951
|
|
|
4860
4952
|
// src/components/Select/Select.tsx
|
|
4861
|
-
var import_icons13,
|
|
4953
|
+
var import_icons13, import_dedupe47, import_react39, import_Select, import_jsx_runtime57, Select;
|
|
4862
4954
|
var init_Select = __esm({
|
|
4863
4955
|
"src/components/Select/Select.tsx"() {
|
|
4864
4956
|
"use strict";
|
|
4865
4957
|
"use client";
|
|
4866
4958
|
import_icons13 = require("@simplybusiness/icons");
|
|
4867
|
-
|
|
4868
|
-
|
|
4959
|
+
import_dedupe47 = __toESM(require("classnames/dedupe"));
|
|
4960
|
+
import_react39 = require("react");
|
|
4869
4961
|
init_hooks();
|
|
4870
4962
|
init_useLabel2();
|
|
4871
4963
|
init_spaceDelimitedList();
|
|
@@ -4874,7 +4966,7 @@ var init_Select = __esm({
|
|
|
4874
4966
|
init_Label2();
|
|
4875
4967
|
init_Stack2();
|
|
4876
4968
|
import_Select = require("@simplybusiness/mobius/src/components/Select/Select.css");
|
|
4877
|
-
|
|
4969
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4878
4970
|
Select = ({ ref, ...props }) => {
|
|
4879
4971
|
const {
|
|
4880
4972
|
label,
|
|
@@ -4895,24 +4987,24 @@ var init_Select = __esm({
|
|
|
4895
4987
|
"--is-required": typeof isRequired === "boolean" && isRequired,
|
|
4896
4988
|
"--is-optional": typeof isRequired === "boolean" && !isRequired
|
|
4897
4989
|
};
|
|
4898
|
-
const sharedClasses = (0,
|
|
4899
|
-
const wrapperClasses = (0,
|
|
4990
|
+
const sharedClasses = (0, import_dedupe47.default)(validationClasses, stateClasses);
|
|
4991
|
+
const wrapperClasses = (0, import_dedupe47.default)(
|
|
4900
4992
|
"mobius-select__wrapper",
|
|
4901
4993
|
sharedClasses,
|
|
4902
4994
|
otherProps.className
|
|
4903
4995
|
);
|
|
4904
|
-
const selectClasses = (0,
|
|
4996
|
+
const selectClasses = (0, import_dedupe47.default)(
|
|
4905
4997
|
"mobius-select",
|
|
4906
4998
|
sharedClasses,
|
|
4907
4999
|
otherProps.className
|
|
4908
5000
|
);
|
|
4909
|
-
const labelClasses = (0,
|
|
5001
|
+
const labelClasses = (0, import_dedupe47.default)(
|
|
4910
5002
|
"mobius-label",
|
|
4911
5003
|
sharedClasses,
|
|
4912
5004
|
otherProps.className
|
|
4913
5005
|
);
|
|
4914
|
-
const iconClasses = (0,
|
|
4915
|
-
const errorMessageId = (0,
|
|
5006
|
+
const iconClasses = (0, import_dedupe47.default)("mobius-select__icon", sharedClasses);
|
|
5007
|
+
const errorMessageId = (0, import_react39.useId)();
|
|
4916
5008
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4917
5009
|
const describedBy = spaceDelimitedList([
|
|
4918
5010
|
shouldErrorMessageShow,
|
|
@@ -4923,10 +5015,10 @@ var init_Select = __esm({
|
|
|
4923
5015
|
onChange(e);
|
|
4924
5016
|
}
|
|
4925
5017
|
};
|
|
4926
|
-
return /* @__PURE__ */ (0,
|
|
4927
|
-
label && /* @__PURE__ */ (0,
|
|
4928
|
-
/* @__PURE__ */ (0,
|
|
4929
|
-
/* @__PURE__ */ (0,
|
|
5018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
|
|
5019
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
5020
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: wrapperClasses, children: [
|
|
5021
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4930
5022
|
"select",
|
|
4931
5023
|
{
|
|
4932
5024
|
...otherProps,
|
|
@@ -4942,9 +5034,9 @@ var init_Select = __esm({
|
|
|
4942
5034
|
onChange: handleChange
|
|
4943
5035
|
}
|
|
4944
5036
|
),
|
|
4945
|
-
/* @__PURE__ */ (0,
|
|
5037
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { icon: import_icons13.chevronDown }) })
|
|
4946
5038
|
] }),
|
|
4947
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
5039
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4948
5040
|
] });
|
|
4949
5041
|
};
|
|
4950
5042
|
Select.displayName = "Select";
|
|
@@ -4966,27 +5058,27 @@ function numberFormatter(value, formatOptions, locale = navigator.languages?.[0]
|
|
|
4966
5058
|
}
|
|
4967
5059
|
return new Intl.NumberFormat(locale, formatOptions).format(+(value || 0));
|
|
4968
5060
|
}
|
|
4969
|
-
var
|
|
5061
|
+
var import_react40;
|
|
4970
5062
|
var init_helpers = __esm({
|
|
4971
5063
|
"src/components/Slider/helpers.ts"() {
|
|
4972
5064
|
"use strict";
|
|
4973
|
-
|
|
5065
|
+
import_react40 = require("react");
|
|
4974
5066
|
}
|
|
4975
5067
|
});
|
|
4976
5068
|
|
|
4977
5069
|
// src/components/Slider/Slider.tsx
|
|
4978
|
-
var
|
|
5070
|
+
var import_dedupe48, import_react41, import_Slider, import_jsx_runtime58, Slider;
|
|
4979
5071
|
var init_Slider = __esm({
|
|
4980
5072
|
"src/components/Slider/Slider.tsx"() {
|
|
4981
5073
|
"use strict";
|
|
4982
5074
|
"use client";
|
|
4983
|
-
|
|
4984
|
-
|
|
5075
|
+
import_dedupe48 = __toESM(require("classnames/dedupe"));
|
|
5076
|
+
import_react41 = require("react");
|
|
4985
5077
|
init_hooks();
|
|
4986
5078
|
init_Label2();
|
|
4987
5079
|
init_helpers();
|
|
4988
5080
|
import_Slider = require("@simplybusiness/mobius/src/components/Slider/Slider.css");
|
|
4989
|
-
|
|
5081
|
+
import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4990
5082
|
Slider = (props) => {
|
|
4991
5083
|
const {
|
|
4992
5084
|
id,
|
|
@@ -5007,11 +5099,11 @@ var init_Slider = __esm({
|
|
|
5007
5099
|
formatOptions,
|
|
5008
5100
|
isDisabled = false
|
|
5009
5101
|
} = props;
|
|
5010
|
-
const trackRef = (0,
|
|
5011
|
-
const [currentValue, setCurrentValue] = (0,
|
|
5102
|
+
const trackRef = (0, import_react41.useRef)(null);
|
|
5103
|
+
const [currentValue, setCurrentValue] = (0, import_react41.useState)(
|
|
5012
5104
|
value || defaultValue || 0
|
|
5013
5105
|
);
|
|
5014
|
-
const [isDragging, setIsDraggging] = (0,
|
|
5106
|
+
const [isDragging, setIsDraggging] = (0, import_react41.useState)(false);
|
|
5015
5107
|
const { labelProps, fieldProps } = useLabel({
|
|
5016
5108
|
id,
|
|
5017
5109
|
label,
|
|
@@ -5019,7 +5111,7 @@ var init_Slider = __esm({
|
|
|
5019
5111
|
"aria-labelledby": ariaLabelledBy
|
|
5020
5112
|
});
|
|
5021
5113
|
const formattedValue = numberFormatter(currentValue, formatOptions);
|
|
5022
|
-
const classes = (0,
|
|
5114
|
+
const classes = (0, import_dedupe48.default)("mobius", "mobius-slider", className, {
|
|
5023
5115
|
"--is-disabled": isDisabled,
|
|
5024
5116
|
"--is-primary": variant === "primary",
|
|
5025
5117
|
"--is-secondary": variant === "secondary",
|
|
@@ -5041,12 +5133,12 @@ var init_Slider = __esm({
|
|
|
5041
5133
|
onChangeEnd(currentValue);
|
|
5042
5134
|
}
|
|
5043
5135
|
};
|
|
5044
|
-
return /* @__PURE__ */ (0,
|
|
5045
|
-
/* @__PURE__ */ (0,
|
|
5046
|
-
label && /* @__PURE__ */ (0,
|
|
5047
|
-
label && /* @__PURE__ */ (0,
|
|
5136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: classes, children: [
|
|
5137
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "mobius-slider__label-wrapper", children: [
|
|
5138
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Label, { ...labelProps, children: label }),
|
|
5139
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("output", { style: { flex: "1 0 auto", textAlign: "end" }, children: formattedValue })
|
|
5048
5140
|
] }),
|
|
5049
|
-
/* @__PURE__ */ (0,
|
|
5141
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { ref: trackRef, className: "mobius-slider__track-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5050
5142
|
"input",
|
|
5051
5143
|
{
|
|
5052
5144
|
className: "mobius-slider__track",
|
|
@@ -5065,9 +5157,9 @@ var init_Slider = __esm({
|
|
|
5065
5157
|
...fieldProps
|
|
5066
5158
|
}
|
|
5067
5159
|
) }),
|
|
5068
|
-
/* @__PURE__ */ (0,
|
|
5069
|
-
/* @__PURE__ */ (0,
|
|
5070
|
-
/* @__PURE__ */ (0,
|
|
5160
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "mobius-slider__labels", children: [
|
|
5161
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "mobius-slider__min-label", "data-testid": "min-label", children: minLabel }),
|
|
5162
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "mobius-slider__max-label", "data-testid": "max-label", children: maxLabel })
|
|
5071
5163
|
] })
|
|
5072
5164
|
] });
|
|
5073
5165
|
};
|
|
@@ -5083,19 +5175,19 @@ var init_Slider2 = __esm({
|
|
|
5083
5175
|
});
|
|
5084
5176
|
|
|
5085
5177
|
// src/components/SVG/SVG.tsx
|
|
5086
|
-
var
|
|
5178
|
+
var import_react42, import_dedupe49, import_jsx_runtime59, SVG;
|
|
5087
5179
|
var init_SVG = __esm({
|
|
5088
5180
|
"src/components/SVG/SVG.tsx"() {
|
|
5089
5181
|
"use strict";
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5182
|
+
import_react42 = require("react");
|
|
5183
|
+
import_dedupe49 = __toESM(require("classnames/dedupe"));
|
|
5184
|
+
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5093
5185
|
SVG = ({ ref, ...props }) => {
|
|
5094
5186
|
const { children, className, ...otherProps } = props;
|
|
5095
|
-
const classes = (0,
|
|
5096
|
-
const svgNode =
|
|
5187
|
+
const classes = (0, import_dedupe49.default)("mobius", "mobius-svg", className);
|
|
5188
|
+
const svgNode = import_react42.Children.only(children);
|
|
5097
5189
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
5098
|
-
return /* @__PURE__ */ (0,
|
|
5190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5099
5191
|
"svg",
|
|
5100
5192
|
{
|
|
5101
5193
|
viewBox,
|
|
@@ -5120,16 +5212,16 @@ var init_SVG2 = __esm({
|
|
|
5120
5212
|
});
|
|
5121
5213
|
|
|
5122
5214
|
// src/components/Switch/Switch.tsx
|
|
5123
|
-
var
|
|
5215
|
+
var import_react43, import_dedupe50, import_Switch, import_jsx_runtime60, Switch;
|
|
5124
5216
|
var init_Switch = __esm({
|
|
5125
5217
|
"src/components/Switch/Switch.tsx"() {
|
|
5126
5218
|
"use strict";
|
|
5127
5219
|
"use client";
|
|
5128
|
-
|
|
5129
|
-
|
|
5220
|
+
import_react43 = require("react");
|
|
5221
|
+
import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
5130
5222
|
init_VisuallyHidden2();
|
|
5131
5223
|
import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
|
|
5132
|
-
|
|
5224
|
+
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5133
5225
|
Switch = ({ ref, ...props }) => {
|
|
5134
5226
|
const {
|
|
5135
5227
|
checked = false,
|
|
@@ -5138,11 +5230,11 @@ var init_Switch = __esm({
|
|
|
5138
5230
|
isDisabled = false,
|
|
5139
5231
|
...otherProps
|
|
5140
5232
|
} = props;
|
|
5141
|
-
const [enabled, setEnabled] = (0,
|
|
5142
|
-
(0,
|
|
5233
|
+
const [enabled, setEnabled] = (0, import_react43.useState)(checked);
|
|
5234
|
+
(0, import_react43.useEffect)(() => {
|
|
5143
5235
|
setEnabled(checked);
|
|
5144
5236
|
}, [checked]);
|
|
5145
|
-
const classes = (0,
|
|
5237
|
+
const classes = (0, import_dedupe50.default)(
|
|
5146
5238
|
"mobius",
|
|
5147
5239
|
"mobius-switch",
|
|
5148
5240
|
{
|
|
@@ -5157,9 +5249,9 @@ var init_Switch = __esm({
|
|
|
5157
5249
|
onChange(event);
|
|
5158
5250
|
}
|
|
5159
5251
|
};
|
|
5160
|
-
return /* @__PURE__ */ (0,
|
|
5161
|
-
/* @__PURE__ */ (0,
|
|
5162
|
-
/* @__PURE__ */ (0,
|
|
5252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("label", { ref, className: classes, children: [
|
|
5253
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { children: enabled ? "On" : "Off" }) }),
|
|
5254
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5163
5255
|
"input",
|
|
5164
5256
|
{
|
|
5165
5257
|
type: "checkbox",
|
|
@@ -5170,7 +5262,7 @@ var init_Switch = __esm({
|
|
|
5170
5262
|
...otherProps
|
|
5171
5263
|
}
|
|
5172
5264
|
),
|
|
5173
|
-
/* @__PURE__ */ (0,
|
|
5265
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "mobius-switch__slider" })
|
|
5174
5266
|
] });
|
|
5175
5267
|
};
|
|
5176
5268
|
Switch.displayName = "Switch";
|
|
@@ -5186,114 +5278,114 @@ var init_Switch2 = __esm({
|
|
|
5186
5278
|
});
|
|
5187
5279
|
|
|
5188
5280
|
// src/components/Table/Table.tsx
|
|
5189
|
-
var
|
|
5281
|
+
var import_dedupe51, import_Table, import_jsx_runtime61, Table;
|
|
5190
5282
|
var init_Table = __esm({
|
|
5191
5283
|
"src/components/Table/Table.tsx"() {
|
|
5192
5284
|
"use strict";
|
|
5193
|
-
|
|
5285
|
+
import_dedupe51 = __toESM(require("classnames/dedupe"));
|
|
5194
5286
|
import_Table = require("@simplybusiness/mobius/src/components/Table/Table.css");
|
|
5195
|
-
|
|
5287
|
+
import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5196
5288
|
Table = ({ ref, ...props }) => {
|
|
5197
|
-
const classes = (0,
|
|
5198
|
-
return /* @__PURE__ */ (0,
|
|
5289
|
+
const classes = (0, import_dedupe51.default)("mobius", "mobius-table", props.className);
|
|
5290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("table", { ref, ...props, className: classes });
|
|
5199
5291
|
};
|
|
5200
5292
|
Table.displayName = "Table";
|
|
5201
5293
|
}
|
|
5202
5294
|
});
|
|
5203
5295
|
|
|
5204
5296
|
// src/components/Table/Head.tsx
|
|
5205
|
-
var
|
|
5297
|
+
var import_dedupe52, import_jsx_runtime62, Head;
|
|
5206
5298
|
var init_Head = __esm({
|
|
5207
5299
|
"src/components/Table/Head.tsx"() {
|
|
5208
5300
|
"use strict";
|
|
5209
|
-
|
|
5210
|
-
|
|
5301
|
+
import_dedupe52 = __toESM(require("classnames/dedupe"));
|
|
5302
|
+
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5211
5303
|
Head = ({ ref, ...props }) => {
|
|
5212
|
-
const classes = (0,
|
|
5213
|
-
return /* @__PURE__ */ (0,
|
|
5304
|
+
const classes = (0, import_dedupe52.default)("mobius", "mobius-table__head", props.className);
|
|
5305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("thead", { ref, ...props, className: classes });
|
|
5214
5306
|
};
|
|
5215
5307
|
Head.displayName = "Table.Head";
|
|
5216
5308
|
}
|
|
5217
5309
|
});
|
|
5218
5310
|
|
|
5219
5311
|
// src/components/Table/Body.tsx
|
|
5220
|
-
var
|
|
5312
|
+
var import_dedupe53, import_jsx_runtime63, Body;
|
|
5221
5313
|
var init_Body = __esm({
|
|
5222
5314
|
"src/components/Table/Body.tsx"() {
|
|
5223
5315
|
"use strict";
|
|
5224
|
-
|
|
5225
|
-
|
|
5316
|
+
import_dedupe53 = __toESM(require("classnames/dedupe"));
|
|
5317
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5226
5318
|
Body = ({ ref, ...props }) => {
|
|
5227
|
-
const classes = (0,
|
|
5228
|
-
return /* @__PURE__ */ (0,
|
|
5319
|
+
const classes = (0, import_dedupe53.default)("mobius", "mobius-table__body", props.className);
|
|
5320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("tbody", { ref, ...props, className: classes });
|
|
5229
5321
|
};
|
|
5230
5322
|
Body.displayName = "Table.Body";
|
|
5231
5323
|
}
|
|
5232
5324
|
});
|
|
5233
5325
|
|
|
5234
5326
|
// src/components/Table/Foot.tsx
|
|
5235
|
-
var
|
|
5327
|
+
var import_dedupe54, import_jsx_runtime64, Foot;
|
|
5236
5328
|
var init_Foot = __esm({
|
|
5237
5329
|
"src/components/Table/Foot.tsx"() {
|
|
5238
5330
|
"use strict";
|
|
5239
|
-
|
|
5240
|
-
|
|
5331
|
+
import_dedupe54 = __toESM(require("classnames/dedupe"));
|
|
5332
|
+
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5241
5333
|
Foot = ({ ref, ...props }) => {
|
|
5242
|
-
const classes = (0,
|
|
5243
|
-
return /* @__PURE__ */ (0,
|
|
5334
|
+
const classes = (0, import_dedupe54.default)("mobius", "mobius-table__foot", props.className);
|
|
5335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("tfoot", { ref, ...props, className: classes });
|
|
5244
5336
|
};
|
|
5245
5337
|
Foot.displayName = "Table.Foot";
|
|
5246
5338
|
}
|
|
5247
5339
|
});
|
|
5248
5340
|
|
|
5249
5341
|
// src/components/Table/Row.tsx
|
|
5250
|
-
var
|
|
5342
|
+
var import_dedupe55, import_jsx_runtime65, Row;
|
|
5251
5343
|
var init_Row = __esm({
|
|
5252
5344
|
"src/components/Table/Row.tsx"() {
|
|
5253
5345
|
"use strict";
|
|
5254
|
-
|
|
5255
|
-
|
|
5346
|
+
import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
5347
|
+
import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5256
5348
|
Row = ({ ref, ...props }) => {
|
|
5257
|
-
const classes = (0,
|
|
5258
|
-
return /* @__PURE__ */ (0,
|
|
5349
|
+
const classes = (0, import_dedupe55.default)("mobius", "mobius-table__row", props.className);
|
|
5350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("tr", { ref, ...props, className: classes });
|
|
5259
5351
|
};
|
|
5260
5352
|
Row.displayName = "Table.Row";
|
|
5261
5353
|
}
|
|
5262
5354
|
});
|
|
5263
5355
|
|
|
5264
5356
|
// src/components/Table/HeaderCell.tsx
|
|
5265
|
-
var
|
|
5357
|
+
var import_dedupe56, import_jsx_runtime66, HeaderCell;
|
|
5266
5358
|
var init_HeaderCell = __esm({
|
|
5267
5359
|
"src/components/Table/HeaderCell.tsx"() {
|
|
5268
5360
|
"use strict";
|
|
5269
|
-
|
|
5270
|
-
|
|
5361
|
+
import_dedupe56 = __toESM(require("classnames/dedupe"));
|
|
5362
|
+
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5271
5363
|
HeaderCell = ({ ref, ...props }) => {
|
|
5272
|
-
const classes = (0,
|
|
5364
|
+
const classes = (0, import_dedupe56.default)(
|
|
5273
5365
|
"mobius",
|
|
5274
5366
|
"mobius-table__head-cell",
|
|
5275
5367
|
props.className
|
|
5276
5368
|
);
|
|
5277
|
-
return /* @__PURE__ */ (0,
|
|
5369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("th", { ...props, ref, className: classes });
|
|
5278
5370
|
};
|
|
5279
5371
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
5280
5372
|
}
|
|
5281
5373
|
});
|
|
5282
5374
|
|
|
5283
5375
|
// src/components/Table/Cell.tsx
|
|
5284
|
-
var
|
|
5376
|
+
var import_dedupe57, import_jsx_runtime67, Cell;
|
|
5285
5377
|
var init_Cell = __esm({
|
|
5286
5378
|
"src/components/Table/Cell.tsx"() {
|
|
5287
5379
|
"use strict";
|
|
5288
|
-
|
|
5289
|
-
|
|
5380
|
+
import_dedupe57 = __toESM(require("classnames/dedupe"));
|
|
5381
|
+
import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5290
5382
|
Cell = ({ ref, ...props }) => {
|
|
5291
|
-
const classes = (0,
|
|
5383
|
+
const classes = (0, import_dedupe57.default)(
|
|
5292
5384
|
"mobius",
|
|
5293
5385
|
"mobius-table__body-cell",
|
|
5294
5386
|
props.className
|
|
5295
5387
|
);
|
|
5296
|
-
return /* @__PURE__ */ (0,
|
|
5388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("td", { ref, ...props, className: classes });
|
|
5297
5389
|
};
|
|
5298
5390
|
Cell.displayName = "Table.Cell";
|
|
5299
5391
|
}
|
|
@@ -5323,37 +5415,6 @@ var init_Table2 = __esm({
|
|
|
5323
5415
|
}
|
|
5324
5416
|
});
|
|
5325
5417
|
|
|
5326
|
-
// src/components/Text/Text.tsx
|
|
5327
|
-
var import_dedupe57, import_Text, import_jsx_runtime66, getElementType, Text;
|
|
5328
|
-
var init_Text = __esm({
|
|
5329
|
-
"src/components/Text/Text.tsx"() {
|
|
5330
|
-
"use strict";
|
|
5331
|
-
import_dedupe57 = __toESM(require("classnames/dedupe"));
|
|
5332
|
-
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
5333
|
-
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5334
|
-
getElementType = (variant, elementType) => {
|
|
5335
|
-
if (variant) {
|
|
5336
|
-
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
5337
|
-
}
|
|
5338
|
-
return elementType || "p";
|
|
5339
|
-
};
|
|
5340
|
-
Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
5341
|
-
const { variant, className, spacing, ...otherProps } = props;
|
|
5342
|
-
const elementType = getElementType(variant, Component);
|
|
5343
|
-
const variantType = variant || elementType;
|
|
5344
|
-
const classes = (0, import_dedupe57.default)(
|
|
5345
|
-
"mobius",
|
|
5346
|
-
"mobius-text",
|
|
5347
|
-
{ [`--is-${variantType}`]: variantType },
|
|
5348
|
-
{ [`--has-line-height-${spacing}`]: spacing },
|
|
5349
|
-
className
|
|
5350
|
-
);
|
|
5351
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
5352
|
-
};
|
|
5353
|
-
Text.displayName = "Text";
|
|
5354
|
-
}
|
|
5355
|
-
});
|
|
5356
|
-
|
|
5357
5418
|
// src/components/Text/index.tsx
|
|
5358
5419
|
var init_Text2 = __esm({
|
|
5359
5420
|
"src/components/Text/index.tsx"() {
|
|
@@ -5363,12 +5424,12 @@ var init_Text2 = __esm({
|
|
|
5363
5424
|
});
|
|
5364
5425
|
|
|
5365
5426
|
// src/components/TextAreaInput/TextAreaInput.tsx
|
|
5366
|
-
var import_dedupe58,
|
|
5427
|
+
var import_dedupe58, import_jsx_runtime68, TextAreaInput;
|
|
5367
5428
|
var init_TextAreaInput = __esm({
|
|
5368
5429
|
"src/components/TextAreaInput/TextAreaInput.tsx"() {
|
|
5369
5430
|
"use strict";
|
|
5370
5431
|
import_dedupe58 = __toESM(require("classnames/dedupe"));
|
|
5371
|
-
|
|
5432
|
+
import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5372
5433
|
TextAreaInput = ({ ref, ...props }) => {
|
|
5373
5434
|
const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
|
|
5374
5435
|
const classes = (0, import_dedupe58.default)(
|
|
@@ -5381,7 +5442,7 @@ var init_TextAreaInput = __esm({
|
|
|
5381
5442
|
},
|
|
5382
5443
|
otherProps.className
|
|
5383
5444
|
);
|
|
5384
|
-
return /* @__PURE__ */ (0,
|
|
5445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5385
5446
|
"textarea",
|
|
5386
5447
|
{
|
|
5387
5448
|
ref,
|
|
@@ -5405,7 +5466,7 @@ var init_TextAreaInput2 = __esm({
|
|
|
5405
5466
|
});
|
|
5406
5467
|
|
|
5407
5468
|
// src/components/TextArea/TextArea.tsx
|
|
5408
|
-
var import_dedupe59, import_TextArea,
|
|
5469
|
+
var import_dedupe59, import_TextArea, import_jsx_runtime69, TextArea;
|
|
5409
5470
|
var init_TextArea = __esm({
|
|
5410
5471
|
"src/components/TextArea/TextArea.tsx"() {
|
|
5411
5472
|
"use strict";
|
|
@@ -5417,7 +5478,7 @@ var init_TextArea = __esm({
|
|
|
5417
5478
|
init_Stack2();
|
|
5418
5479
|
init_TextAreaInput2();
|
|
5419
5480
|
import_TextArea = require("@simplybusiness/mobius/src/components/TextArea/TextArea.css");
|
|
5420
|
-
|
|
5481
|
+
import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5421
5482
|
TextArea = ({ ref, ...props }) => {
|
|
5422
5483
|
const {
|
|
5423
5484
|
isDisabled,
|
|
@@ -5437,9 +5498,9 @@ var init_TextArea = __esm({
|
|
|
5437
5498
|
},
|
|
5438
5499
|
validationClasses
|
|
5439
5500
|
);
|
|
5440
|
-
return /* @__PURE__ */ (0,
|
|
5441
|
-
label && /* @__PURE__ */ (0,
|
|
5442
|
-
/* @__PURE__ */ (0,
|
|
5501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Stack, { className: classes, gap: "xs", children: [
|
|
5502
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Label, { ...labelProps, className: labelClasses, children: props.label }),
|
|
5503
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5443
5504
|
TextAreaInput,
|
|
5444
5505
|
{
|
|
5445
5506
|
...otherProps,
|
|
@@ -5450,7 +5511,7 @@ var init_TextArea = __esm({
|
|
|
5450
5511
|
"aria-invalid": errorMessage != null
|
|
5451
5512
|
}
|
|
5452
5513
|
),
|
|
5453
|
-
/* @__PURE__ */ (0,
|
|
5514
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
5454
5515
|
] });
|
|
5455
5516
|
};
|
|
5456
5517
|
TextArea.displayName = "TextArea";
|
|
@@ -5465,53 +5526,6 @@ var init_TextArea2 = __esm({
|
|
|
5465
5526
|
}
|
|
5466
5527
|
});
|
|
5467
5528
|
|
|
5468
|
-
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
5469
|
-
var import_react43, import_jsx_runtime69, isHTML, TextOrHTML;
|
|
5470
|
-
var init_TextOrHTML = __esm({
|
|
5471
|
-
"src/components/TextOrHTML/TextOrHTML.tsx"() {
|
|
5472
|
-
"use strict";
|
|
5473
|
-
import_react43 = require("react");
|
|
5474
|
-
init_Text();
|
|
5475
|
-
import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5476
|
-
isHTML = (text) => /^\s*<[a-z]/i.test(text);
|
|
5477
|
-
TextOrHTML = ({
|
|
5478
|
-
ref,
|
|
5479
|
-
text,
|
|
5480
|
-
htmlClassName,
|
|
5481
|
-
htmlElementType,
|
|
5482
|
-
textWrapper = false,
|
|
5483
|
-
autoDetect = false,
|
|
5484
|
-
...textProps
|
|
5485
|
-
}) => {
|
|
5486
|
-
const textIsHTML = autoDetect && isHTML(text);
|
|
5487
|
-
const shouldWrapInText = autoDetect ? textWrapper || !textIsHTML : textWrapper;
|
|
5488
|
-
const resolvedElementType = htmlElementType ?? (textIsHTML ? "div" : "span");
|
|
5489
|
-
const DangerousComponent = resolvedElementType;
|
|
5490
|
-
const dangerousHTML = (0, import_react43.useMemo)(() => ({ __html: text }), [text]);
|
|
5491
|
-
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5492
|
-
DangerousComponent,
|
|
5493
|
-
{
|
|
5494
|
-
className: htmlClassName,
|
|
5495
|
-
dangerouslySetInnerHTML: dangerousHTML
|
|
5496
|
-
}
|
|
5497
|
-
);
|
|
5498
|
-
if (shouldWrapInText) {
|
|
5499
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
5500
|
-
}
|
|
5501
|
-
return dangerousElement;
|
|
5502
|
-
};
|
|
5503
|
-
TextOrHTML.displayName = "TextOrHTML";
|
|
5504
|
-
}
|
|
5505
|
-
});
|
|
5506
|
-
|
|
5507
|
-
// src/components/TextOrHTML/index.tsx
|
|
5508
|
-
var init_TextOrHTML2 = __esm({
|
|
5509
|
-
"src/components/TextOrHTML/index.tsx"() {
|
|
5510
|
-
"use strict";
|
|
5511
|
-
init_TextOrHTML();
|
|
5512
|
-
}
|
|
5513
|
-
});
|
|
5514
|
-
|
|
5515
5529
|
// src/components/Title/Title.tsx
|
|
5516
5530
|
var import_dedupe60, import_Title, import_jsx_runtime70, Title;
|
|
5517
5531
|
var init_Title = __esm({
|