@simplybusiness/mobius 10.1.0 → 10.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/components/AddressLookup/AddressLookup.js +536 -526
- package/dist/cjs/components/AddressLookup/AddressLookup.js.map +4 -4
- package/dist/cjs/components/AddressLookup/index.js +536 -526
- package/dist/cjs/components/AddressLookup/index.js.map +4 -4
- package/dist/cjs/components/Alert/Alert.js +79 -11
- package/dist/cjs/components/Alert/Alert.js.map +4 -4
- package/dist/cjs/components/Alert/index.js +79 -11
- package/dist/cjs/components/Alert/index.js.map +4 -4
- package/dist/cjs/components/Checkbox/Checkbox.js +502 -492
- package/dist/cjs/components/Checkbox/Checkbox.js.map +4 -4
- package/dist/cjs/components/Checkbox/CheckboxGroup.js +502 -492
- package/dist/cjs/components/Checkbox/CheckboxGroup.js.map +4 -4
- package/dist/cjs/components/Checkbox/index.js +481 -471
- package/dist/cjs/components/Checkbox/index.js.map +4 -4
- package/dist/cjs/components/Combobox/Combobox.js +536 -526
- package/dist/cjs/components/Combobox/Combobox.js.map +4 -4
- package/dist/cjs/components/Combobox/index.js +536 -526
- package/dist/cjs/components/Combobox/index.js.map +4 -4
- package/dist/cjs/components/DateField/DateField.js +523 -513
- package/dist/cjs/components/DateField/DateField.js.map +4 -4
- package/dist/cjs/components/DateField/index.js +523 -513
- package/dist/cjs/components/DateField/index.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js +523 -513
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/index.js +523 -513
- package/dist/cjs/components/ErrorMessage/index.js.map +4 -4
- package/dist/cjs/components/ExpandableText/ExpandableText.js +523 -513
- package/dist/cjs/components/ExpandableText/ExpandableText.js.map +4 -4
- package/dist/cjs/components/ExpandableText/index.js +523 -513
- package/dist/cjs/components/ExpandableText/index.js.map +4 -4
- package/dist/cjs/components/MaskedField/MaskedField.js +533 -523
- package/dist/cjs/components/MaskedField/MaskedField.js.map +4 -4
- package/dist/cjs/components/MaskedField/index.js +533 -523
- package/dist/cjs/components/MaskedField/index.js.map +4 -4
- package/dist/cjs/components/NumberField/NumberField.js +524 -514
- package/dist/cjs/components/NumberField/NumberField.js.map +4 -4
- package/dist/cjs/components/NumberField/index.js +524 -514
- package/dist/cjs/components/NumberField/index.js.map +4 -4
- package/dist/cjs/components/PasswordField/PasswordField.js +520 -510
- package/dist/cjs/components/PasswordField/PasswordField.js.map +4 -4
- package/dist/cjs/components/PasswordField/ShowHideButton.js +519 -509
- package/dist/cjs/components/PasswordField/ShowHideButton.js.map +4 -4
- package/dist/cjs/components/PasswordField/index.js +520 -510
- package/dist/cjs/components/PasswordField/index.js.map +4 -4
- package/dist/cjs/components/Radio/Radio.js +502 -492
- package/dist/cjs/components/Radio/Radio.js.map +4 -4
- package/dist/cjs/components/Radio/RadioGroup.js +501 -491
- package/dist/cjs/components/Radio/RadioGroup.js.map +4 -4
- package/dist/cjs/components/Radio/index.js +480 -470
- package/dist/cjs/components/Radio/index.js.map +4 -4
- package/dist/cjs/components/Select/Select.js +507 -497
- package/dist/cjs/components/Select/Select.js.map +4 -4
- package/dist/cjs/components/Select/index.js +507 -497
- package/dist/cjs/components/Select/index.js.map +4 -4
- package/dist/cjs/components/TextArea/TextArea.js +517 -507
- package/dist/cjs/components/TextArea/TextArea.js.map +4 -4
- package/dist/cjs/components/TextArea/index.js +517 -507
- package/dist/cjs/components/TextArea/index.js.map +4 -4
- package/dist/cjs/components/TextField/TextField.js +533 -523
- package/dist/cjs/components/TextField/TextField.js.map +4 -4
- package/dist/cjs/components/TextField/index.js +533 -523
- package/dist/cjs/components/TextField/index.js.map +4 -4
- package/dist/cjs/components/index.js +563 -553
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/index.js +563 -553
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/meta.json +1340 -1273
- package/dist/esm/{chunk-FTSJNY4J.js → chunk-N5WGQAHM.js} +14 -2
- package/dist/esm/chunk-N5WGQAHM.js.map +7 -0
- package/dist/esm/{chunk-C4BILMFX.js → chunk-PB2OICEB.js} +1 -1
- package/dist/esm/components/AddressLookup/AddressLookup.js +2 -2
- package/dist/esm/components/AddressLookup/index.js +2 -2
- package/dist/esm/components/Alert/Alert.js +4 -1
- package/dist/esm/components/Alert/index.js +4 -1
- package/dist/esm/components/Checkbox/Checkbox.js +2 -2
- package/dist/esm/components/Checkbox/CheckboxGroup.js +2 -2
- package/dist/esm/components/Checkbox/index.js +2 -2
- package/dist/esm/components/Combobox/Combobox.js +2 -2
- package/dist/esm/components/Combobox/index.js +2 -2
- package/dist/esm/components/DateField/DateField.js +2 -2
- package/dist/esm/components/DateField/index.js +2 -2
- package/dist/esm/components/ErrorMessage/ErrorMessage.js +2 -2
- package/dist/esm/components/ErrorMessage/index.js +2 -2
- package/dist/esm/components/ExpandableText/ExpandableText.js +2 -2
- package/dist/esm/components/ExpandableText/index.js +2 -2
- package/dist/esm/components/MaskedField/MaskedField.js +2 -2
- package/dist/esm/components/MaskedField/index.js +2 -2
- package/dist/esm/components/NumberField/NumberField.js +2 -2
- package/dist/esm/components/NumberField/index.js +2 -2
- package/dist/esm/components/PasswordField/PasswordField.js +2 -2
- package/dist/esm/components/PasswordField/ShowHideButton.js +2 -2
- package/dist/esm/components/PasswordField/index.js +2 -2
- package/dist/esm/components/Radio/Radio.js +2 -2
- package/dist/esm/components/Radio/RadioGroup.js +2 -2
- package/dist/esm/components/Radio/index.js +2 -2
- package/dist/esm/components/Select/Select.js +2 -2
- package/dist/esm/components/Select/index.js +2 -2
- package/dist/esm/components/TextArea/TextArea.js +2 -2
- package/dist/esm/components/TextArea/index.js +2 -2
- package/dist/esm/components/TextField/TextField.js +2 -2
- package/dist/esm/components/TextField/index.js +2 -2
- package/dist/esm/components/index.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/meta.json +160 -127
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/Alert/Alert.tsx +10 -1
- package/src/components/Button/Button.css +44 -14
- package/dist/esm/chunk-FTSJNY4J.js.map +0 -7
- /package/dist/esm/{chunk-C4BILMFX.js.map → chunk-PB2OICEB.js.map} +0 -0
|
@@ -2196,19 +2196,98 @@ var init_AddressLookup2 = __esm({
|
|
|
2196
2196
|
}
|
|
2197
2197
|
});
|
|
2198
2198
|
|
|
2199
|
+
// src/components/Text/Text.tsx
|
|
2200
|
+
var import_dedupe14, import_Text, import_jsx_runtime15, getElementType, Text;
|
|
2201
|
+
var init_Text = __esm({
|
|
2202
|
+
"src/components/Text/Text.tsx"() {
|
|
2203
|
+
"use strict";
|
|
2204
|
+
import_dedupe14 = __toESM(require("classnames/dedupe"));
|
|
2205
|
+
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
2206
|
+
import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2207
|
+
getElementType = (variant, elementType) => {
|
|
2208
|
+
if (variant) {
|
|
2209
|
+
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
2210
|
+
}
|
|
2211
|
+
return elementType || "p";
|
|
2212
|
+
};
|
|
2213
|
+
Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
2214
|
+
const { variant, className, spacing, ...otherProps } = props;
|
|
2215
|
+
const elementType = getElementType(variant, Component);
|
|
2216
|
+
const variantType = variant || elementType;
|
|
2217
|
+
const classes = (0, import_dedupe14.default)(
|
|
2218
|
+
"mobius",
|
|
2219
|
+
"mobius-text",
|
|
2220
|
+
{ [`--is-${variantType}`]: variantType },
|
|
2221
|
+
{ [`--has-line-height-${spacing}`]: spacing },
|
|
2222
|
+
className
|
|
2223
|
+
);
|
|
2224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
2225
|
+
};
|
|
2226
|
+
Text.displayName = "Text";
|
|
2227
|
+
}
|
|
2228
|
+
});
|
|
2229
|
+
|
|
2230
|
+
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
2231
|
+
var import_react15, import_jsx_runtime16, isHTML, TextOrHTML;
|
|
2232
|
+
var init_TextOrHTML = __esm({
|
|
2233
|
+
"src/components/TextOrHTML/TextOrHTML.tsx"() {
|
|
2234
|
+
"use strict";
|
|
2235
|
+
import_react15 = require("react");
|
|
2236
|
+
init_Text();
|
|
2237
|
+
import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2238
|
+
isHTML = (text) => /^\s*<[a-z]/i.test(text);
|
|
2239
|
+
TextOrHTML = ({
|
|
2240
|
+
ref,
|
|
2241
|
+
text,
|
|
2242
|
+
htmlClassName,
|
|
2243
|
+
htmlElementType,
|
|
2244
|
+
textWrapper = false,
|
|
2245
|
+
autoDetect = false,
|
|
2246
|
+
...textProps
|
|
2247
|
+
}) => {
|
|
2248
|
+
const textIsHTML = autoDetect && isHTML(text);
|
|
2249
|
+
const shouldWrapInText = autoDetect ? textWrapper || !textIsHTML : textWrapper;
|
|
2250
|
+
const resolvedElementType = htmlElementType ?? (textIsHTML ? "div" : "span");
|
|
2251
|
+
const DangerousComponent = resolvedElementType;
|
|
2252
|
+
const dangerousHTML = (0, import_react15.useMemo)(() => ({ __html: text }), [text]);
|
|
2253
|
+
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2254
|
+
DangerousComponent,
|
|
2255
|
+
{
|
|
2256
|
+
className: htmlClassName,
|
|
2257
|
+
dangerouslySetInnerHTML: dangerousHTML
|
|
2258
|
+
}
|
|
2259
|
+
);
|
|
2260
|
+
if (shouldWrapInText) {
|
|
2261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
2262
|
+
}
|
|
2263
|
+
return dangerousElement;
|
|
2264
|
+
};
|
|
2265
|
+
TextOrHTML.displayName = "TextOrHTML";
|
|
2266
|
+
}
|
|
2267
|
+
});
|
|
2268
|
+
|
|
2269
|
+
// src/components/TextOrHTML/index.tsx
|
|
2270
|
+
var init_TextOrHTML2 = __esm({
|
|
2271
|
+
"src/components/TextOrHTML/index.tsx"() {
|
|
2272
|
+
"use strict";
|
|
2273
|
+
init_TextOrHTML();
|
|
2274
|
+
}
|
|
2275
|
+
});
|
|
2276
|
+
|
|
2199
2277
|
// src/components/Alert/Alert.tsx
|
|
2200
2278
|
function isAlertVariant(value) {
|
|
2201
2279
|
return value === "info" || value === "success" || value === "warning" || value === "error";
|
|
2202
2280
|
}
|
|
2203
|
-
var import_icons3,
|
|
2281
|
+
var import_icons3, import_dedupe15, import_Alert, import_jsx_runtime17, Alert;
|
|
2204
2282
|
var init_Alert = __esm({
|
|
2205
2283
|
"src/components/Alert/Alert.tsx"() {
|
|
2206
2284
|
"use strict";
|
|
2207
2285
|
import_icons3 = require("@simplybusiness/icons");
|
|
2208
|
-
|
|
2286
|
+
import_dedupe15 = __toESM(require("classnames/dedupe"));
|
|
2209
2287
|
init_Icon2();
|
|
2288
|
+
init_TextOrHTML2();
|
|
2210
2289
|
import_Alert = require("@simplybusiness/mobius/src/components/Alert/Alert.css");
|
|
2211
|
-
|
|
2290
|
+
import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2212
2291
|
Alert = ({ ref, ...props }) => {
|
|
2213
2292
|
const {
|
|
2214
2293
|
elementType: Element = "div",
|
|
@@ -2221,7 +2300,7 @@ var init_Alert = __esm({
|
|
|
2221
2300
|
if (!show) return null;
|
|
2222
2301
|
const variant = variantProp && isAlertVariant(variantProp) ? variantProp : "info";
|
|
2223
2302
|
const colorValue = variant === "success" ? `var(--color-valid)` : `var(--color-${variant})`;
|
|
2224
|
-
const classes = (0,
|
|
2303
|
+
const classes = (0, import_dedupe15.default)(
|
|
2225
2304
|
"mobius",
|
|
2226
2305
|
"mobius-alert",
|
|
2227
2306
|
{
|
|
@@ -2239,14 +2318,23 @@ var init_Alert = __esm({
|
|
|
2239
2318
|
warning: import_icons3.warning,
|
|
2240
2319
|
error: import_icons3.error
|
|
2241
2320
|
};
|
|
2242
|
-
const headerClasses = (0,
|
|
2243
|
-
const iconClasses = (0,
|
|
2244
|
-
const contentClasses = (0,
|
|
2245
|
-
return /* @__PURE__ */ (0,
|
|
2246
|
-
/* @__PURE__ */ (0,
|
|
2247
|
-
/* @__PURE__ */ (0,
|
|
2248
|
-
header && /* @__PURE__ */ (0,
|
|
2249
|
-
|
|
2321
|
+
const headerClasses = (0, import_dedupe15.default)("mobius", "mobius-alert__header");
|
|
2322
|
+
const iconClasses = (0, import_dedupe15.default)("mobius", "mobius-alert__icon");
|
|
2323
|
+
const contentClasses = (0, import_dedupe15.default)("mobius", "mobius-alert__content");
|
|
2324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Element, { ref, role: "alert", ...otherProps, className: classes, children: [
|
|
2325
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { icon: icon[variant], color: colorValue }) }),
|
|
2326
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
2327
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2328
|
+
TextOrHTML,
|
|
2329
|
+
{
|
|
2330
|
+
autoDetect: true,
|
|
2331
|
+
htmlElementType: "span",
|
|
2332
|
+
className: headerClasses,
|
|
2333
|
+
htmlClassName: headerClasses,
|
|
2334
|
+
text: header
|
|
2335
|
+
}
|
|
2336
|
+
),
|
|
2337
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: contentClasses, children })
|
|
2250
2338
|
] })
|
|
2251
2339
|
] });
|
|
2252
2340
|
};
|
|
@@ -2263,14 +2351,14 @@ var init_Alert2 = __esm({
|
|
|
2263
2351
|
});
|
|
2264
2352
|
|
|
2265
2353
|
// src/components/Box/Box.tsx
|
|
2266
|
-
var
|
|
2354
|
+
var import_dedupe16, import_Box, import_jsx_runtime18, Box;
|
|
2267
2355
|
var init_Box = __esm({
|
|
2268
2356
|
"src/components/Box/Box.tsx"() {
|
|
2269
2357
|
"use strict";
|
|
2270
|
-
|
|
2358
|
+
import_dedupe16 = __toESM(require("classnames/dedupe"));
|
|
2271
2359
|
init_utils();
|
|
2272
2360
|
import_Box = require("@simplybusiness/mobius/src/components/Box/Box.css");
|
|
2273
|
-
|
|
2361
|
+
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2274
2362
|
Box = ({ ref, ...props }) => {
|
|
2275
2363
|
const {
|
|
2276
2364
|
elementType: Element = "div",
|
|
@@ -2296,7 +2384,7 @@ var init_Box = __esm({
|
|
|
2296
2384
|
style,
|
|
2297
2385
|
...otherProps
|
|
2298
2386
|
} = props;
|
|
2299
|
-
const classes = (0,
|
|
2387
|
+
const classes = (0, import_dedupe16.default)("mobius", "mobius-box", otherProps.className);
|
|
2300
2388
|
const styleProps = filterUndefinedProps({
|
|
2301
2389
|
padding: getSpacingValue(padding),
|
|
2302
2390
|
paddingInline: getSpacingValue(paddingInline || paddingX),
|
|
@@ -2313,7 +2401,7 @@ var init_Box = __esm({
|
|
|
2313
2401
|
height,
|
|
2314
2402
|
...style
|
|
2315
2403
|
});
|
|
2316
|
-
return /* @__PURE__ */ (0,
|
|
2404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Element, { ref, style: styleProps, ...otherProps, className: classes });
|
|
2317
2405
|
};
|
|
2318
2406
|
Box.displayName = "Box";
|
|
2319
2407
|
}
|
|
@@ -2328,27 +2416,27 @@ var init_Box2 = __esm({
|
|
|
2328
2416
|
});
|
|
2329
2417
|
|
|
2330
2418
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
2331
|
-
var
|
|
2419
|
+
var import_react16, import_dedupe17, import_Breadcrumbs, import_jsx_runtime19, Breadcrumbs;
|
|
2332
2420
|
var init_Breadcrumbs = __esm({
|
|
2333
2421
|
"src/components/Breadcrumbs/Breadcrumbs.tsx"() {
|
|
2334
2422
|
"use strict";
|
|
2335
2423
|
"use client";
|
|
2336
|
-
|
|
2337
|
-
|
|
2424
|
+
import_react16 = require("react");
|
|
2425
|
+
import_dedupe17 = __toESM(require("classnames/dedupe"));
|
|
2338
2426
|
import_Breadcrumbs = require("@simplybusiness/mobius/src/components/Breadcrumbs/Breadcrumbs.css");
|
|
2339
|
-
|
|
2427
|
+
import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2340
2428
|
Breadcrumbs = ({ ref, ...props }) => {
|
|
2341
2429
|
const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
|
|
2342
2430
|
const { navProps } = { navProps: { "aria-label": ariaLabel } };
|
|
2343
2431
|
const { children, ...otherProps } = props;
|
|
2344
|
-
const childArray =
|
|
2345
|
-
const classes = (0,
|
|
2432
|
+
const childArray = import_react16.Children.toArray(children);
|
|
2433
|
+
const classes = (0, import_dedupe17.default)(
|
|
2346
2434
|
"mobius",
|
|
2347
2435
|
"mobius-breadcrumb",
|
|
2348
2436
|
otherProps.className
|
|
2349
2437
|
);
|
|
2350
|
-
return /* @__PURE__ */ (0,
|
|
2351
|
-
(child, i) => (0,
|
|
2438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { children: childArray.map(
|
|
2439
|
+
(child, i) => (0, import_react16.cloneElement)(
|
|
2352
2440
|
child,
|
|
2353
2441
|
{
|
|
2354
2442
|
key: i,
|
|
@@ -2362,22 +2450,22 @@ var init_Breadcrumbs = __esm({
|
|
|
2362
2450
|
});
|
|
2363
2451
|
|
|
2364
2452
|
// src/components/Breadcrumbs/BreadcrumbItem.tsx
|
|
2365
|
-
var
|
|
2453
|
+
var import_react17, import_dedupe18, import_jsx_runtime20, BreadcrumbItem;
|
|
2366
2454
|
var init_BreadcrumbItem = __esm({
|
|
2367
2455
|
"src/components/Breadcrumbs/BreadcrumbItem.tsx"() {
|
|
2368
2456
|
"use strict";
|
|
2369
2457
|
"use client";
|
|
2370
|
-
|
|
2371
|
-
|
|
2458
|
+
import_react17 = require("react");
|
|
2459
|
+
import_dedupe18 = __toESM(require("classnames/dedupe"));
|
|
2372
2460
|
init_Box2();
|
|
2373
|
-
|
|
2461
|
+
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2374
2462
|
BreadcrumbItem = ({ ref, ...props }) => {
|
|
2375
2463
|
const {
|
|
2376
2464
|
isDisabled = false,
|
|
2377
2465
|
isCurrent = false,
|
|
2378
2466
|
"aria-current": ariaCurrent = "page",
|
|
2379
2467
|
children,
|
|
2380
|
-
separator = /* @__PURE__ */ (0,
|
|
2468
|
+
separator = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box, { className: "mobius-breadcrumb__separator", "aria-hidden": "true", children: ">" }),
|
|
2381
2469
|
...otherProps
|
|
2382
2470
|
} = props;
|
|
2383
2471
|
const { itemProps } = {
|
|
@@ -2387,14 +2475,14 @@ var init_BreadcrumbItem = __esm({
|
|
|
2387
2475
|
...otherProps
|
|
2388
2476
|
}
|
|
2389
2477
|
};
|
|
2390
|
-
const classes = (0,
|
|
2478
|
+
const classes = (0, import_dedupe18.default)(
|
|
2391
2479
|
"mobius",
|
|
2392
2480
|
"mobius-breadcrumb__item",
|
|
2393
2481
|
props.className
|
|
2394
2482
|
);
|
|
2395
|
-
const child = typeof children === "string" ? /* @__PURE__ */ (0,
|
|
2396
|
-
return /* @__PURE__ */ (0,
|
|
2397
|
-
(0,
|
|
2483
|
+
const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { ...itemProps, children }) : import_react17.Children.only(children);
|
|
2484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("li", { className: classes, children: [
|
|
2485
|
+
(0, import_react17.cloneElement)(child, {
|
|
2398
2486
|
...child.props,
|
|
2399
2487
|
...itemProps,
|
|
2400
2488
|
ref
|
|
@@ -2416,19 +2504,19 @@ var init_Breadcrumbs2 = __esm({
|
|
|
2416
2504
|
});
|
|
2417
2505
|
|
|
2418
2506
|
// src/components/Button/Loading.tsx
|
|
2419
|
-
var import_icons4,
|
|
2507
|
+
var import_icons4, import_jsx_runtime21, Loading;
|
|
2420
2508
|
var init_Loading = __esm({
|
|
2421
2509
|
"src/components/Button/Loading.tsx"() {
|
|
2422
2510
|
"use strict";
|
|
2423
2511
|
import_icons4 = require("@simplybusiness/icons");
|
|
2424
2512
|
init_Icon2();
|
|
2425
2513
|
init_VisuallyHidden2();
|
|
2426
|
-
|
|
2514
|
+
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2427
2515
|
Loading = (props) => {
|
|
2428
2516
|
const { children } = props;
|
|
2429
|
-
return /* @__PURE__ */ (0,
|
|
2430
|
-
/* @__PURE__ */ (0,
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2518
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { icon: import_icons4.loading, spin: true, size: "md" }) }),
|
|
2519
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(VisuallyHidden, { className: "mobius-button__loading-text", children: "Loading" }),
|
|
2432
2520
|
children
|
|
2433
2521
|
] });
|
|
2434
2522
|
};
|
|
@@ -2436,33 +2524,33 @@ var init_Loading = __esm({
|
|
|
2436
2524
|
});
|
|
2437
2525
|
|
|
2438
2526
|
// src/components/Button/Success.tsx
|
|
2439
|
-
var import_icons5,
|
|
2527
|
+
var import_icons5, import_jsx_runtime22, Success;
|
|
2440
2528
|
var init_Success = __esm({
|
|
2441
2529
|
"src/components/Button/Success.tsx"() {
|
|
2442
2530
|
"use strict";
|
|
2443
2531
|
import_icons5 = require("@simplybusiness/icons");
|
|
2444
2532
|
init_Icon2();
|
|
2445
2533
|
init_VisuallyHidden2();
|
|
2446
|
-
|
|
2447
|
-
Success = () => /* @__PURE__ */ (0,
|
|
2448
|
-
/* @__PURE__ */ (0,
|
|
2449
|
-
/* @__PURE__ */ (0,
|
|
2534
|
+
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2535
|
+
Success = () => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
2536
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { icon: import_icons5.tick, size: "md" }) }),
|
|
2537
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VisuallyHidden, { className: "mobius-button__success-text", children: "Success" })
|
|
2450
2538
|
] });
|
|
2451
2539
|
}
|
|
2452
2540
|
});
|
|
2453
2541
|
|
|
2454
2542
|
// src/components/Button/Button.tsx
|
|
2455
|
-
var
|
|
2543
|
+
var import_dedupe19, import_Button, import_jsx_runtime23, Button;
|
|
2456
2544
|
var init_Button = __esm({
|
|
2457
2545
|
"src/components/Button/Button.tsx"() {
|
|
2458
2546
|
"use strict";
|
|
2459
2547
|
"use client";
|
|
2460
|
-
|
|
2548
|
+
import_dedupe19 = __toESM(require("classnames/dedupe"));
|
|
2461
2549
|
init_Loading();
|
|
2462
2550
|
init_useButton2();
|
|
2463
2551
|
init_Success();
|
|
2464
2552
|
import_Button = require("@simplybusiness/mobius/src/components/Button/Button.css");
|
|
2465
|
-
|
|
2553
|
+
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2466
2554
|
Button = ({ ref, ...props }) => {
|
|
2467
2555
|
const {
|
|
2468
2556
|
children,
|
|
@@ -2477,7 +2565,7 @@ var init_Button = __esm({
|
|
|
2477
2565
|
...otherProps
|
|
2478
2566
|
} = props;
|
|
2479
2567
|
const { buttonProps } = useButton(props);
|
|
2480
|
-
otherProps.className = (0,
|
|
2568
|
+
otherProps.className = (0, import_dedupe19.default)(
|
|
2481
2569
|
"mobius",
|
|
2482
2570
|
"mobius-button",
|
|
2483
2571
|
`--variant-${variant}`,
|
|
@@ -2489,9 +2577,9 @@ var init_Button = __esm({
|
|
|
2489
2577
|
},
|
|
2490
2578
|
otherProps.className
|
|
2491
2579
|
);
|
|
2492
|
-
return /* @__PURE__ */ (0,
|
|
2493
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2494
|
-
isSuccess && !isLoading && /* @__PURE__ */ (0,
|
|
2580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Component, { ref, ...buttonProps, ...otherProps, children: [
|
|
2581
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loading, { children }) : children,
|
|
2582
|
+
isSuccess && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Success, {})
|
|
2495
2583
|
] });
|
|
2496
2584
|
};
|
|
2497
2585
|
Button.displayName = "Button";
|
|
@@ -2507,20 +2595,20 @@ var init_Button2 = __esm({
|
|
|
2507
2595
|
});
|
|
2508
2596
|
|
|
2509
2597
|
// src/components/Checkbox/CheckboxGroup.tsx
|
|
2510
|
-
var
|
|
2598
|
+
var import_dedupe20, import_react18, import_CheckboxGroup, import_jsx_runtime24, CheckboxGroup;
|
|
2511
2599
|
var init_CheckboxGroup = __esm({
|
|
2512
2600
|
"src/components/Checkbox/CheckboxGroup.tsx"() {
|
|
2513
2601
|
"use strict";
|
|
2514
2602
|
"use client";
|
|
2515
|
-
|
|
2516
|
-
|
|
2603
|
+
import_dedupe20 = __toESM(require("classnames/dedupe"));
|
|
2604
|
+
import_react18 = require("react");
|
|
2517
2605
|
init_hooks();
|
|
2518
2606
|
init_spaceDelimitedList();
|
|
2519
2607
|
init_ErrorMessage2();
|
|
2520
2608
|
init_Label2();
|
|
2521
2609
|
init_Checkbox2();
|
|
2522
2610
|
import_CheckboxGroup = require("@simplybusiness/mobius/src/components/Checkbox/CheckboxGroup.css");
|
|
2523
|
-
|
|
2611
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2524
2612
|
CheckboxGroup = ({ ref, ...props }) => {
|
|
2525
2613
|
const {
|
|
2526
2614
|
label,
|
|
@@ -2538,10 +2626,10 @@ var init_CheckboxGroup = __esm({
|
|
|
2538
2626
|
lastItemDisables = false,
|
|
2539
2627
|
...rest
|
|
2540
2628
|
} = props;
|
|
2541
|
-
const [selected, setSelected] = (0,
|
|
2542
|
-
const isInitializedRef = (0,
|
|
2543
|
-
const prevDefaultValueRef = (0,
|
|
2544
|
-
(0,
|
|
2629
|
+
const [selected, setSelected] = (0, import_react18.useState)(defaultValue);
|
|
2630
|
+
const isInitializedRef = (0, import_react18.useRef)(false);
|
|
2631
|
+
const prevDefaultValueRef = (0, import_react18.useRef)(defaultValue);
|
|
2632
|
+
(0, import_react18.useEffect)(() => {
|
|
2545
2633
|
const hasChanged = defaultValue.length !== prevDefaultValueRef.current.length || defaultValue.some(
|
|
2546
2634
|
(val, index) => val !== prevDefaultValueRef.current[index]
|
|
2547
2635
|
);
|
|
@@ -2551,7 +2639,7 @@ var init_CheckboxGroup = __esm({
|
|
|
2551
2639
|
isInitializedRef.current = true;
|
|
2552
2640
|
}
|
|
2553
2641
|
}, [defaultValue]);
|
|
2554
|
-
const checkboxGroupClasses = (0,
|
|
2642
|
+
const checkboxGroupClasses = (0, import_dedupe20.default)(
|
|
2555
2643
|
"mobius",
|
|
2556
2644
|
"mobius-checkbox-group",
|
|
2557
2645
|
className,
|
|
@@ -2563,19 +2651,19 @@ var init_CheckboxGroup = __esm({
|
|
|
2563
2651
|
}
|
|
2564
2652
|
);
|
|
2565
2653
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2566
|
-
const labelClasses = (0,
|
|
2654
|
+
const labelClasses = (0, import_dedupe20.default)(
|
|
2567
2655
|
{
|
|
2568
2656
|
"--is-disabled": isDisabled
|
|
2569
2657
|
},
|
|
2570
2658
|
validationClasses
|
|
2571
2659
|
);
|
|
2572
|
-
const errorMessageId = (0,
|
|
2660
|
+
const errorMessageId = (0, import_react18.useId)();
|
|
2573
2661
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2574
2662
|
const describedBy = spaceDelimitedList([
|
|
2575
2663
|
shouldErrorMessageShow,
|
|
2576
2664
|
props["aria-describedby"]
|
|
2577
2665
|
]);
|
|
2578
|
-
const labelId = (0,
|
|
2666
|
+
const labelId = (0, import_react18.useId)();
|
|
2579
2667
|
const handleChange = (event, isLastItem = false) => {
|
|
2580
2668
|
const {
|
|
2581
2669
|
target: { value, checked }
|
|
@@ -2593,12 +2681,12 @@ var init_CheckboxGroup = __esm({
|
|
|
2593
2681
|
setSelected(newValue);
|
|
2594
2682
|
onChange?.(newValue);
|
|
2595
2683
|
};
|
|
2596
|
-
const childrenArray =
|
|
2684
|
+
const childrenArray = import_react18.Children.toArray(children);
|
|
2597
2685
|
const lastCheckbox = childrenArray.filter(
|
|
2598
|
-
(child) => (0,
|
|
2686
|
+
(child) => (0, import_react18.isValidElement)(child) && child.type === Checkbox
|
|
2599
2687
|
).pop();
|
|
2600
2688
|
const lastCheckboxIsChecked = lastCheckbox && selected.includes(lastCheckbox.props.value);
|
|
2601
|
-
return /* @__PURE__ */ (0,
|
|
2689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2602
2690
|
"div",
|
|
2603
2691
|
{
|
|
2604
2692
|
...rest,
|
|
@@ -2607,16 +2695,16 @@ var init_CheckboxGroup = __esm({
|
|
|
2607
2695
|
className: checkboxGroupClasses,
|
|
2608
2696
|
role: "group",
|
|
2609
2697
|
style: {
|
|
2610
|
-
"--checkbox-items-per-row": itemsPerRow ||
|
|
2698
|
+
"--checkbox-items-per-row": itemsPerRow || import_react18.Children.count(children)
|
|
2611
2699
|
},
|
|
2612
2700
|
children: [
|
|
2613
|
-
label && /* @__PURE__ */ (0,
|
|
2614
|
-
/* @__PURE__ */ (0,
|
|
2615
|
-
if ((0,
|
|
2701
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Label, { elementType: "span", id: labelId, className: labelClasses, children: label }),
|
|
2702
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mobius-checkbox-group__wrapper", children: childrenArray.map((child) => {
|
|
2703
|
+
if ((0, import_react18.isValidElement)(child)) {
|
|
2616
2704
|
const isLastItem = child === lastCheckbox;
|
|
2617
2705
|
const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
|
|
2618
2706
|
const childProps = child.props;
|
|
2619
|
-
return (0,
|
|
2707
|
+
return (0, import_react18.cloneElement)(
|
|
2620
2708
|
child,
|
|
2621
2709
|
{
|
|
2622
2710
|
isDisabled: isChildDisabled,
|
|
@@ -2632,7 +2720,7 @@ var init_CheckboxGroup = __esm({
|
|
|
2632
2720
|
}
|
|
2633
2721
|
return child;
|
|
2634
2722
|
}) }),
|
|
2635
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
2723
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2636
2724
|
]
|
|
2637
2725
|
}
|
|
2638
2726
|
);
|
|
@@ -2659,23 +2747,23 @@ var init_Checkbox = __esm({
|
|
|
2659
2747
|
});
|
|
2660
2748
|
|
|
2661
2749
|
// src/components/Container/Container.tsx
|
|
2662
|
-
var
|
|
2750
|
+
var import_dedupe21, import_Container, import_jsx_runtime25, Container;
|
|
2663
2751
|
var init_Container = __esm({
|
|
2664
2752
|
"src/components/Container/Container.tsx"() {
|
|
2665
2753
|
"use strict";
|
|
2666
|
-
|
|
2754
|
+
import_dedupe21 = __toESM(require("classnames/dedupe"));
|
|
2667
2755
|
init_utils();
|
|
2668
2756
|
import_Container = require("@simplybusiness/mobius/src/components/Container/Container.css");
|
|
2669
|
-
|
|
2757
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2670
2758
|
Container = ({ ref, ...props }) => {
|
|
2671
2759
|
const { elementType: Element = "div", size = "md", ...otherProps } = props;
|
|
2672
|
-
const classes = (0,
|
|
2760
|
+
const classes = (0, import_dedupe21.default)(
|
|
2673
2761
|
"mobius",
|
|
2674
2762
|
"mobius-container",
|
|
2675
2763
|
sizeClasses(size),
|
|
2676
2764
|
otherProps.className
|
|
2677
2765
|
);
|
|
2678
|
-
return /* @__PURE__ */ (0,
|
|
2766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
2679
2767
|
};
|
|
2680
2768
|
Container.displayName = "Container";
|
|
2681
2769
|
}
|
|
@@ -2728,17 +2816,17 @@ var init_validation = __esm({
|
|
|
2728
2816
|
});
|
|
2729
2817
|
|
|
2730
2818
|
// src/components/DateField/DateField.tsx
|
|
2731
|
-
var
|
|
2819
|
+
var import_dedupe22, import_react19, import_jsx_runtime26, MIN_MAX_ERROR, DateField;
|
|
2732
2820
|
var init_DateField = __esm({
|
|
2733
2821
|
"src/components/DateField/DateField.tsx"() {
|
|
2734
2822
|
"use strict";
|
|
2735
2823
|
"use client";
|
|
2736
|
-
|
|
2737
|
-
|
|
2824
|
+
import_dedupe22 = __toESM(require("classnames/dedupe"));
|
|
2825
|
+
import_react19 = require("react");
|
|
2738
2826
|
init_mergeRefs();
|
|
2739
2827
|
init_TextField2();
|
|
2740
2828
|
init_validation();
|
|
2741
|
-
|
|
2829
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2742
2830
|
MIN_MAX_ERROR = '"min" value should not be greater than "max" value.';
|
|
2743
2831
|
DateField = ({ ref, ...props }) => {
|
|
2744
2832
|
const {
|
|
@@ -2751,10 +2839,10 @@ var init_DateField = __esm({
|
|
|
2751
2839
|
value,
|
|
2752
2840
|
...otherProps
|
|
2753
2841
|
} = props;
|
|
2754
|
-
const [error3, setError] = (0,
|
|
2755
|
-
const [isInvalid, setIsInvalid] = (0,
|
|
2756
|
-
const localRef = (0,
|
|
2757
|
-
const classes = (0,
|
|
2842
|
+
const [error3, setError] = (0, import_react19.useState)(errorMessage);
|
|
2843
|
+
const [isInvalid, setIsInvalid] = (0, import_react19.useState)(void 0);
|
|
2844
|
+
const localRef = (0, import_react19.useRef)(null);
|
|
2845
|
+
const classes = (0, import_dedupe22.default)("mobius-date-field", className);
|
|
2758
2846
|
const formattedMin = min ? convertToDateFormat(min, format) : void 0;
|
|
2759
2847
|
const formattedMax = max ? convertToDateFormat(max, format) : void 0;
|
|
2760
2848
|
const formattedDefaultValue = defaultValue ? convertToDateFormat(defaultValue, format) : void 0;
|
|
@@ -2767,7 +2855,7 @@ var init_DateField = __esm({
|
|
|
2767
2855
|
setError(props.errorMessage);
|
|
2768
2856
|
setIsInvalid(false);
|
|
2769
2857
|
};
|
|
2770
|
-
(0,
|
|
2858
|
+
(0, import_react19.useEffect)(() => {
|
|
2771
2859
|
if (!isValidDate(min, format)) {
|
|
2772
2860
|
setInvalidState(`Invalid min date: ${min}`);
|
|
2773
2861
|
return;
|
|
@@ -2800,7 +2888,7 @@ var init_DateField = __esm({
|
|
|
2800
2888
|
validate();
|
|
2801
2889
|
otherProps.onBlur?.(event);
|
|
2802
2890
|
};
|
|
2803
|
-
return /* @__PURE__ */ (0,
|
|
2891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2804
2892
|
TextField,
|
|
2805
2893
|
{
|
|
2806
2894
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -2831,23 +2919,23 @@ var init_DateField2 = __esm({
|
|
|
2831
2919
|
});
|
|
2832
2920
|
|
|
2833
2921
|
// src/components/Drawer/Content.tsx
|
|
2834
|
-
var
|
|
2922
|
+
var import_jsx_runtime27, Content;
|
|
2835
2923
|
var init_Content = __esm({
|
|
2836
2924
|
"src/components/Drawer/Content.tsx"() {
|
|
2837
2925
|
"use strict";
|
|
2838
|
-
|
|
2839
|
-
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
2926
|
+
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2927
|
+
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, ...otherProps, className: "mobius-drawer__content", children });
|
|
2840
2928
|
Content.displayName = "Content";
|
|
2841
2929
|
}
|
|
2842
2930
|
});
|
|
2843
2931
|
|
|
2844
2932
|
// src/components/Drawer/DrawerContext.tsx
|
|
2845
|
-
var
|
|
2933
|
+
var import_react20, DrawerContext;
|
|
2846
2934
|
var init_DrawerContext = __esm({
|
|
2847
2935
|
"src/components/Drawer/DrawerContext.tsx"() {
|
|
2848
2936
|
"use strict";
|
|
2849
|
-
|
|
2850
|
-
DrawerContext = (0,
|
|
2937
|
+
import_react20 = require("react");
|
|
2938
|
+
DrawerContext = (0, import_react20.createContext)({
|
|
2851
2939
|
onClose: () => {
|
|
2852
2940
|
},
|
|
2853
2941
|
closeLabel: void 0,
|
|
@@ -2857,19 +2945,19 @@ var init_DrawerContext = __esm({
|
|
|
2857
2945
|
});
|
|
2858
2946
|
|
|
2859
2947
|
// src/components/Drawer/Drawer.tsx
|
|
2860
|
-
var
|
|
2948
|
+
var import_dedupe23, import_react21, import_Drawer, import_jsx_runtime28, TRANSITION_CSS_VARIABLE, Drawer;
|
|
2861
2949
|
var init_Drawer = __esm({
|
|
2862
2950
|
"src/components/Drawer/Drawer.tsx"() {
|
|
2863
2951
|
"use strict";
|
|
2864
2952
|
"use client";
|
|
2865
|
-
|
|
2866
|
-
|
|
2953
|
+
import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
2954
|
+
import_react21 = require("react");
|
|
2867
2955
|
init_hooks();
|
|
2868
2956
|
init_utils();
|
|
2869
2957
|
init_VisuallyHidden2();
|
|
2870
2958
|
init_DrawerContext();
|
|
2871
2959
|
import_Drawer = require("@simplybusiness/mobius/src/components/Drawer/Drawer.css");
|
|
2872
|
-
|
|
2960
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2873
2961
|
TRANSITION_CSS_VARIABLE = "--drawer-transition-duration";
|
|
2874
2962
|
Drawer = ({ ref, ...props }) => {
|
|
2875
2963
|
const {
|
|
@@ -2882,8 +2970,8 @@ var init_Drawer = __esm({
|
|
|
2882
2970
|
onClose,
|
|
2883
2971
|
children
|
|
2884
2972
|
} = props;
|
|
2885
|
-
const dialogRef = (0,
|
|
2886
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
2973
|
+
const dialogRef = (0, import_react21.useRef)(null);
|
|
2974
|
+
const [shouldTransition, setShouldTransition] = (0, import_react21.useState)(false);
|
|
2887
2975
|
const { close } = useDialog({
|
|
2888
2976
|
ref: dialogRef,
|
|
2889
2977
|
isOpen,
|
|
@@ -2894,9 +2982,9 @@ var init_Drawer = __esm({
|
|
|
2894
2982
|
CSSVariable: TRANSITION_CSS_VARIABLE
|
|
2895
2983
|
}
|
|
2896
2984
|
});
|
|
2897
|
-
const hiddenId = `dialog-screen-reader-announce-${(0,
|
|
2898
|
-
const headerId = `dialog-header-${(0,
|
|
2899
|
-
const dialogClasses = (0,
|
|
2985
|
+
const hiddenId = `dialog-screen-reader-announce-${(0, import_react21.useId)()}`;
|
|
2986
|
+
const headerId = `dialog-header-${(0, import_react21.useId)()}`;
|
|
2987
|
+
const dialogClasses = (0, import_dedupe23.default)(
|
|
2900
2988
|
"mobius",
|
|
2901
2989
|
"mobius-drawer",
|
|
2902
2990
|
`--${direction}`,
|
|
@@ -2905,10 +2993,10 @@ var init_Drawer = __esm({
|
|
|
2905
2993
|
"--should-transition": shouldTransition
|
|
2906
2994
|
}
|
|
2907
2995
|
);
|
|
2908
|
-
(0,
|
|
2996
|
+
(0, import_react21.useEffect)(() => {
|
|
2909
2997
|
setShouldTransition(supportsDialog());
|
|
2910
2998
|
}, []);
|
|
2911
|
-
const contextValue = (0,
|
|
2999
|
+
const contextValue = (0, import_react21.useMemo)(
|
|
2912
3000
|
() => ({
|
|
2913
3001
|
onClose: close,
|
|
2914
3002
|
closeLabel,
|
|
@@ -2916,18 +3004,18 @@ var init_Drawer = __esm({
|
|
|
2916
3004
|
}),
|
|
2917
3005
|
[close, closeLabel, headerId]
|
|
2918
3006
|
);
|
|
2919
|
-
return /* @__PURE__ */ (0,
|
|
3007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2920
3008
|
"dialog",
|
|
2921
3009
|
{
|
|
2922
|
-
id: (0,
|
|
3010
|
+
id: (0, import_react21.useId)(),
|
|
2923
3011
|
ref: mergeRefs([dialogRef, ref]),
|
|
2924
3012
|
onCancel: close,
|
|
2925
3013
|
className: dialogClasses,
|
|
2926
3014
|
"aria-describedby": hiddenId,
|
|
2927
3015
|
"aria-labelledby": headerId,
|
|
2928
3016
|
children: [
|
|
2929
|
-
/* @__PURE__ */ (0,
|
|
2930
|
-
/* @__PURE__ */ (0,
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { id: hiddenId, children: announce }) }),
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DrawerContext.Provider, { value: contextValue, children })
|
|
2931
3019
|
]
|
|
2932
3020
|
}
|
|
2933
3021
|
);
|
|
@@ -2937,21 +3025,21 @@ var init_Drawer = __esm({
|
|
|
2937
3025
|
});
|
|
2938
3026
|
|
|
2939
3027
|
// src/components/Drawer/useDrawer.ts
|
|
2940
|
-
var
|
|
3028
|
+
var import_react22, useDrawer;
|
|
2941
3029
|
var init_useDrawer = __esm({
|
|
2942
3030
|
"src/components/Drawer/useDrawer.ts"() {
|
|
2943
3031
|
"use strict";
|
|
2944
|
-
|
|
3032
|
+
import_react22 = require("react");
|
|
2945
3033
|
init_DrawerContext();
|
|
2946
3034
|
useDrawer = () => {
|
|
2947
|
-
const { onClose, closeLabel, headerId } = (0,
|
|
3035
|
+
const { onClose, closeLabel, headerId } = (0, import_react22.useContext)(DrawerContext);
|
|
2948
3036
|
return { onClose, closeLabel, headerId };
|
|
2949
3037
|
};
|
|
2950
3038
|
}
|
|
2951
3039
|
});
|
|
2952
3040
|
|
|
2953
3041
|
// src/components/Drawer/Header.tsx
|
|
2954
|
-
var import_icons6,
|
|
3042
|
+
var import_icons6, import_jsx_runtime29, Header;
|
|
2955
3043
|
var init_Header = __esm({
|
|
2956
3044
|
"src/components/Drawer/Header.tsx"() {
|
|
2957
3045
|
"use strict";
|
|
@@ -2959,12 +3047,12 @@ var init_Header = __esm({
|
|
|
2959
3047
|
init_Button2();
|
|
2960
3048
|
init_Icon2();
|
|
2961
3049
|
init_useDrawer();
|
|
2962
|
-
|
|
3050
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2963
3051
|
Header = ({ ref, children, ...otherProps }) => {
|
|
2964
3052
|
const { onClose, closeLabel, headerId } = useDrawer();
|
|
2965
|
-
return /* @__PURE__ */ (0,
|
|
2966
|
-
/* @__PURE__ */ (0,
|
|
2967
|
-
/* @__PURE__ */ (0,
|
|
3053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("header", { ref, ...otherProps, className: "mobius-drawer__header", children: [
|
|
3054
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h2", { id: headerId, children }),
|
|
3055
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2968
3056
|
Button,
|
|
2969
3057
|
{
|
|
2970
3058
|
"aria-label": "Close",
|
|
@@ -2973,7 +3061,7 @@ var init_Header = __esm({
|
|
|
2973
3061
|
className: "mobius-drawer__close",
|
|
2974
3062
|
size: "sm",
|
|
2975
3063
|
children: [
|
|
2976
|
-
/* @__PURE__ */ (0,
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { icon: import_icons6.cross }),
|
|
2977
3065
|
" ",
|
|
2978
3066
|
closeLabel
|
|
2979
3067
|
]
|
|
@@ -3002,17 +3090,17 @@ var init_Drawer2 = __esm({
|
|
|
3002
3090
|
});
|
|
3003
3091
|
|
|
3004
3092
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
3005
|
-
var
|
|
3093
|
+
var import_react23, import_react_accessible_dropdown_menu_hook, import_dedupe24, import_DropdownMenu, import_jsx_runtime30, DropdownMenu;
|
|
3006
3094
|
var init_DropdownMenu = __esm({
|
|
3007
3095
|
"src/components/DropdownMenu/DropdownMenu.tsx"() {
|
|
3008
3096
|
"use strict";
|
|
3009
3097
|
"use client";
|
|
3010
|
-
|
|
3098
|
+
import_react23 = require("react");
|
|
3011
3099
|
import_react_accessible_dropdown_menu_hook = __toESM(require("react-accessible-dropdown-menu-hook"));
|
|
3012
|
-
|
|
3100
|
+
import_dedupe24 = __toESM(require("classnames/dedupe"));
|
|
3013
3101
|
init_Button2();
|
|
3014
3102
|
import_DropdownMenu = require("@simplybusiness/mobius/src/components/DropdownMenu/DropdownMenu.css");
|
|
3015
|
-
|
|
3103
|
+
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3016
3104
|
DropdownMenu = ({ ref, ...props }) => {
|
|
3017
3105
|
const {
|
|
3018
3106
|
elementType: Element = "nav",
|
|
@@ -3021,21 +3109,21 @@ var init_DropdownMenu = __esm({
|
|
|
3021
3109
|
children,
|
|
3022
3110
|
...otherProps
|
|
3023
3111
|
} = props;
|
|
3024
|
-
const [activeId, setActiveId] = (0,
|
|
3025
|
-
const numberOfItems =
|
|
3112
|
+
const [activeId, setActiveId] = (0, import_react23.useState)(null);
|
|
3113
|
+
const numberOfItems = import_react23.Children.count(children);
|
|
3026
3114
|
const {
|
|
3027
3115
|
buttonProps,
|
|
3028
3116
|
itemProps,
|
|
3029
3117
|
isOpen: open,
|
|
3030
3118
|
setIsOpen
|
|
3031
3119
|
} = (0, import_react_accessible_dropdown_menu_hook.default)(numberOfItems);
|
|
3032
|
-
const classes = (0,
|
|
3120
|
+
const classes = (0, import_dedupe24.default)(
|
|
3033
3121
|
"mobius",
|
|
3034
3122
|
"mobius-dropdown-menu",
|
|
3035
3123
|
otherProps.className
|
|
3036
3124
|
);
|
|
3037
|
-
const triggerClasses = (0,
|
|
3038
|
-
const listClasses = (0,
|
|
3125
|
+
const triggerClasses = (0, import_dedupe24.default)("mobius", "mobius-dropdown-menu__trigger");
|
|
3126
|
+
const listClasses = (0, import_dedupe24.default)("mobius", "mobius-dropdown-menu__list", {
|
|
3039
3127
|
"--is-open": open
|
|
3040
3128
|
});
|
|
3041
3129
|
const handleChildClick = ({ onClick }, index) => {
|
|
@@ -3045,16 +3133,16 @@ var init_DropdownMenu = __esm({
|
|
|
3045
3133
|
onClick();
|
|
3046
3134
|
}
|
|
3047
3135
|
};
|
|
3048
|
-
return /* @__PURE__ */ (0,
|
|
3049
|
-
trigger ? (0,
|
|
3136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Element, { ref, ...otherProps, className: classes, children: [
|
|
3137
|
+
trigger ? (0, import_react23.cloneElement)(trigger, {
|
|
3050
3138
|
className: triggerClasses,
|
|
3051
3139
|
open,
|
|
3052
3140
|
label,
|
|
3053
3141
|
...buttonProps
|
|
3054
|
-
}) : /* @__PURE__ */ (0,
|
|
3055
|
-
/* @__PURE__ */ (0,
|
|
3056
|
-
if ((0,
|
|
3057
|
-
return (0,
|
|
3142
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
3143
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ul", { className: listClasses, role: "menu", children: import_react23.Children.map(children, (child, index) => {
|
|
3144
|
+
if ((0, import_react23.isValidElement)(child)) {
|
|
3145
|
+
return (0, import_react23.cloneElement)(child, {
|
|
3058
3146
|
onClick: () => handleChildClick(child.props, index),
|
|
3059
3147
|
active: index === activeId,
|
|
3060
3148
|
...itemProps[index]
|
|
@@ -3069,13 +3157,13 @@ var init_DropdownMenu = __esm({
|
|
|
3069
3157
|
});
|
|
3070
3158
|
|
|
3071
3159
|
// src/components/DropdownMenu/Item.tsx
|
|
3072
|
-
var
|
|
3160
|
+
var import_react24, import_dedupe25, import_jsx_runtime31, Item;
|
|
3073
3161
|
var init_Item = __esm({
|
|
3074
3162
|
"src/components/DropdownMenu/Item.tsx"() {
|
|
3075
3163
|
"use strict";
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3164
|
+
import_react24 = require("react");
|
|
3165
|
+
import_dedupe25 = __toESM(require("classnames/dedupe"));
|
|
3166
|
+
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3079
3167
|
Item = ({ ref, ...props }) => {
|
|
3080
3168
|
const {
|
|
3081
3169
|
elementType: Element = "li",
|
|
@@ -3084,26 +3172,26 @@ var init_Item = __esm({
|
|
|
3084
3172
|
children,
|
|
3085
3173
|
...otherProps
|
|
3086
3174
|
} = props;
|
|
3087
|
-
const classes = (0,
|
|
3175
|
+
const classes = (0, import_dedupe25.default)(
|
|
3088
3176
|
"mobius",
|
|
3089
3177
|
"mobius-dropdown-menu__item",
|
|
3090
3178
|
{ "--is-active": active },
|
|
3091
3179
|
otherProps.className
|
|
3092
3180
|
);
|
|
3093
|
-
return /* @__PURE__ */ (0,
|
|
3094
|
-
if ((0,
|
|
3095
|
-
const childClasses = (0,
|
|
3181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Element, { ref, onClick, ...otherProps, children: import_react24.Children.map(children, (child) => {
|
|
3182
|
+
if ((0, import_react24.isValidElement)(child)) {
|
|
3183
|
+
const childClasses = (0, import_dedupe25.default)(
|
|
3096
3184
|
child.props.className,
|
|
3097
3185
|
classes
|
|
3098
3186
|
);
|
|
3099
|
-
return (0,
|
|
3187
|
+
return (0, import_react24.cloneElement)(
|
|
3100
3188
|
child,
|
|
3101
3189
|
{
|
|
3102
3190
|
className: childClasses
|
|
3103
3191
|
}
|
|
3104
3192
|
);
|
|
3105
3193
|
}
|
|
3106
|
-
return /* @__PURE__ */ (0,
|
|
3194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: classes, children: child });
|
|
3107
3195
|
}) });
|
|
3108
3196
|
};
|
|
3109
3197
|
Item.displayName = "DropdownMenu.Item";
|
|
@@ -3128,23 +3216,23 @@ var init_DropdownMenu2 = __esm({
|
|
|
3128
3216
|
});
|
|
3129
3217
|
|
|
3130
3218
|
// src/components/Fieldset/Fieldset.tsx
|
|
3131
|
-
var
|
|
3219
|
+
var import_dedupe26, import_react25, import_Fieldset, import_jsx_runtime32, useFieldset, Fieldset;
|
|
3132
3220
|
var init_Fieldset = __esm({
|
|
3133
3221
|
"src/components/Fieldset/Fieldset.tsx"() {
|
|
3134
3222
|
"use strict";
|
|
3135
3223
|
"use client";
|
|
3136
|
-
|
|
3137
|
-
|
|
3224
|
+
import_dedupe26 = __toESM(require("classnames/dedupe"));
|
|
3225
|
+
import_react25 = require("react");
|
|
3138
3226
|
init_Flex2();
|
|
3139
3227
|
import_Fieldset = require("@simplybusiness/mobius/src/components/Fieldset/Fieldset.css");
|
|
3140
|
-
|
|
3228
|
+
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3141
3229
|
useFieldset = (props) => {
|
|
3142
3230
|
const { legend } = props;
|
|
3143
3231
|
let legendProps = {};
|
|
3144
3232
|
let containerProps = {
|
|
3145
3233
|
role: "group"
|
|
3146
3234
|
};
|
|
3147
|
-
const legendId = (0,
|
|
3235
|
+
const legendId = (0, import_react25.useId)();
|
|
3148
3236
|
if (legend) {
|
|
3149
3237
|
legendProps = {
|
|
3150
3238
|
...legendProps,
|
|
@@ -3164,14 +3252,14 @@ var init_Fieldset = __esm({
|
|
|
3164
3252
|
const {
|
|
3165
3253
|
children,
|
|
3166
3254
|
legend,
|
|
3167
|
-
legendComponent = /* @__PURE__ */ (0,
|
|
3255
|
+
legendComponent = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("legend", {}),
|
|
3168
3256
|
...otherProps
|
|
3169
3257
|
} = props;
|
|
3170
3258
|
const { legendProps, containerProps } = useFieldset(props);
|
|
3171
|
-
const classes = (0,
|
|
3259
|
+
const classes = (0, import_dedupe26.default)("mobius", "mobius-fieldset", props.className);
|
|
3172
3260
|
legendProps.className = "mobius-fieldset__legend";
|
|
3173
|
-
return /* @__PURE__ */ (0,
|
|
3174
|
-
legend && (0,
|
|
3261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
3262
|
+
legend && (0, import_react25.cloneElement)(legendComponent, { ...legendProps }, [legend]),
|
|
3175
3263
|
children
|
|
3176
3264
|
] });
|
|
3177
3265
|
};
|
|
@@ -3188,13 +3276,13 @@ var init_Fieldset2 = __esm({
|
|
|
3188
3276
|
});
|
|
3189
3277
|
|
|
3190
3278
|
// src/components/Grid/Grid.tsx
|
|
3191
|
-
var
|
|
3279
|
+
var import_dedupe27, import_jsx_runtime33, Grid;
|
|
3192
3280
|
var init_Grid = __esm({
|
|
3193
3281
|
"src/components/Grid/Grid.tsx"() {
|
|
3194
3282
|
"use strict";
|
|
3195
|
-
|
|
3283
|
+
import_dedupe27 = __toESM(require("classnames/dedupe"));
|
|
3196
3284
|
init_utils();
|
|
3197
|
-
|
|
3285
|
+
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3198
3286
|
Grid = ({ ref: _ref, ...props }) => {
|
|
3199
3287
|
const {
|
|
3200
3288
|
columns = 12,
|
|
@@ -3209,7 +3297,7 @@ var init_Grid = __esm({
|
|
|
3209
3297
|
style,
|
|
3210
3298
|
...rest
|
|
3211
3299
|
} = props;
|
|
3212
|
-
const classes = (0,
|
|
3300
|
+
const classes = (0, import_dedupe27.default)("mobius", "mobius-grid", className);
|
|
3213
3301
|
const styles = filterUndefinedProps({
|
|
3214
3302
|
boxSizing: "border-box",
|
|
3215
3303
|
display: "grid",
|
|
@@ -3223,22 +3311,22 @@ var init_Grid = __esm({
|
|
|
3223
3311
|
justifyItems,
|
|
3224
3312
|
...style
|
|
3225
3313
|
});
|
|
3226
|
-
return /* @__PURE__ */ (0,
|
|
3314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: styles, className: classes, ...rest });
|
|
3227
3315
|
};
|
|
3228
3316
|
Grid.displayName = "Grid";
|
|
3229
3317
|
}
|
|
3230
3318
|
});
|
|
3231
3319
|
|
|
3232
3320
|
// src/components/Grid/Item.tsx
|
|
3233
|
-
var
|
|
3321
|
+
var import_react26, import_dedupe28, import_jsx_runtime34, getBreakpointMap, DEFAULT_SPAN, GridItem;
|
|
3234
3322
|
var init_Item2 = __esm({
|
|
3235
3323
|
"src/components/Grid/Item.tsx"() {
|
|
3236
3324
|
"use strict";
|
|
3237
3325
|
"use client";
|
|
3238
|
-
|
|
3239
|
-
|
|
3326
|
+
import_react26 = require("react");
|
|
3327
|
+
import_dedupe28 = __toESM(require("classnames/dedupe"));
|
|
3240
3328
|
init_hooks();
|
|
3241
|
-
|
|
3329
|
+
import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3242
3330
|
getBreakpointMap = (config) => Object.entries(config).reduce(
|
|
3243
3331
|
(prev, [key, value]) => {
|
|
3244
3332
|
const previous = Object.values(prev);
|
|
@@ -3273,9 +3361,9 @@ var init_Item2 = __esm({
|
|
|
3273
3361
|
xl,
|
|
3274
3362
|
xxl
|
|
3275
3363
|
});
|
|
3276
|
-
const [responsiveSpan, setResponsiveSpan] = (0,
|
|
3277
|
-
const classes = (0,
|
|
3278
|
-
(0,
|
|
3364
|
+
const [responsiveSpan, setResponsiveSpan] = (0, import_react26.useState)();
|
|
3365
|
+
const classes = (0, import_dedupe28.default)("mobius-grid__item", className);
|
|
3366
|
+
(0, import_react26.useEffect)(() => {
|
|
3279
3367
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
3280
3368
|
}, [breakpointSize, breakpointMap]);
|
|
3281
3369
|
const styles = {
|
|
@@ -3283,7 +3371,7 @@ var init_Item2 = __esm({
|
|
|
3283
3371
|
alignSelf,
|
|
3284
3372
|
justifySelf
|
|
3285
3373
|
};
|
|
3286
|
-
return /* @__PURE__ */ (0,
|
|
3374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { style: { ...styles }, className: classes, ...rest });
|
|
3287
3375
|
};
|
|
3288
3376
|
GridItem.displayName = "GridItem";
|
|
3289
3377
|
}
|
|
@@ -3304,20 +3392,20 @@ var init_Grid2 = __esm({
|
|
|
3304
3392
|
});
|
|
3305
3393
|
|
|
3306
3394
|
// src/components/Image/Image.tsx
|
|
3307
|
-
var
|
|
3395
|
+
var import_dedupe29, import_jsx_runtime35, Image;
|
|
3308
3396
|
var init_Image = __esm({
|
|
3309
3397
|
"src/components/Image/Image.tsx"() {
|
|
3310
3398
|
"use strict";
|
|
3311
|
-
|
|
3312
|
-
|
|
3399
|
+
import_dedupe29 = __toESM(require("classnames/dedupe"));
|
|
3400
|
+
import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3313
3401
|
Image = ({
|
|
3314
3402
|
ref,
|
|
3315
3403
|
alt,
|
|
3316
3404
|
elementType: Component = "img",
|
|
3317
3405
|
...otherProps
|
|
3318
3406
|
}) => {
|
|
3319
|
-
const classes = (0,
|
|
3320
|
-
return /* @__PURE__ */ (0,
|
|
3407
|
+
const classes = (0, import_dedupe29.default)("mobius", "mobius-image", otherProps.className);
|
|
3408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Component, { alt, ref, ...otherProps, className: classes });
|
|
3321
3409
|
};
|
|
3322
3410
|
Image.displayName = "Image";
|
|
3323
3411
|
}
|
|
@@ -3332,13 +3420,13 @@ var init_Image2 = __esm({
|
|
|
3332
3420
|
});
|
|
3333
3421
|
|
|
3334
3422
|
// src/components/Link/Link.tsx
|
|
3335
|
-
var
|
|
3423
|
+
var import_dedupe30, import_Link, import_jsx_runtime36, Link;
|
|
3336
3424
|
var init_Link = __esm({
|
|
3337
3425
|
"src/components/Link/Link.tsx"() {
|
|
3338
3426
|
"use strict";
|
|
3339
|
-
|
|
3427
|
+
import_dedupe30 = __toESM(require("classnames/dedupe"));
|
|
3340
3428
|
import_Link = require("@simplybusiness/mobius/src/components/Link/Link.css");
|
|
3341
|
-
|
|
3429
|
+
import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3342
3430
|
Link = ({ ref, ...props }) => {
|
|
3343
3431
|
const {
|
|
3344
3432
|
isDisabled = false,
|
|
@@ -3352,7 +3440,7 @@ var init_Link = __esm({
|
|
|
3352
3440
|
pointerEvents: "none"
|
|
3353
3441
|
};
|
|
3354
3442
|
const styles = { ...style, ...isDisabled && disabledStyles };
|
|
3355
|
-
const classes = (0,
|
|
3443
|
+
const classes = (0, import_dedupe30.default)(
|
|
3356
3444
|
"mobius",
|
|
3357
3445
|
"mobius-link",
|
|
3358
3446
|
className,
|
|
@@ -3361,7 +3449,7 @@ var init_Link = __esm({
|
|
|
3361
3449
|
"--is-disabled": isDisabled
|
|
3362
3450
|
}
|
|
3363
3451
|
);
|
|
3364
|
-
return /* @__PURE__ */ (0,
|
|
3452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3365
3453
|
Component,
|
|
3366
3454
|
{
|
|
3367
3455
|
ref,
|
|
@@ -3386,12 +3474,12 @@ var init_Link2 = __esm({
|
|
|
3386
3474
|
});
|
|
3387
3475
|
|
|
3388
3476
|
// src/components/LinkButton/LinkButton.tsx
|
|
3389
|
-
var
|
|
3477
|
+
var import_dedupe31, import_jsx_runtime37;
|
|
3390
3478
|
var init_LinkButton = __esm({
|
|
3391
3479
|
"src/components/LinkButton/LinkButton.tsx"() {
|
|
3392
3480
|
"use strict";
|
|
3393
|
-
|
|
3394
|
-
|
|
3481
|
+
import_dedupe31 = __toESM(require("classnames/dedupe"));
|
|
3482
|
+
import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3395
3483
|
}
|
|
3396
3484
|
});
|
|
3397
3485
|
|
|
@@ -3404,14 +3492,14 @@ var init_LinkButton2 = __esm({
|
|
|
3404
3492
|
});
|
|
3405
3493
|
|
|
3406
3494
|
// src/components/List/List.tsx
|
|
3407
|
-
var
|
|
3495
|
+
var import_react27, import_dedupe32, import_List, import_jsx_runtime38, List;
|
|
3408
3496
|
var init_List = __esm({
|
|
3409
3497
|
"src/components/List/List.tsx"() {
|
|
3410
3498
|
"use strict";
|
|
3411
|
-
|
|
3412
|
-
|
|
3499
|
+
import_react27 = require("react");
|
|
3500
|
+
import_dedupe32 = __toESM(require("classnames/dedupe"));
|
|
3413
3501
|
import_List = require("@simplybusiness/mobius/src/components/List/List.css");
|
|
3414
|
-
|
|
3502
|
+
import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3415
3503
|
List = ({ ref, ...props }) => {
|
|
3416
3504
|
const Component = props.isOrdered ? "ol" : "ul";
|
|
3417
3505
|
const { children, icon, ...otherProps } = props;
|
|
@@ -3420,7 +3508,7 @@ var init_List = __esm({
|
|
|
3420
3508
|
...restProps,
|
|
3421
3509
|
reversed: isReversed
|
|
3422
3510
|
};
|
|
3423
|
-
const classes = (0,
|
|
3511
|
+
const classes = (0, import_dedupe32.default)(
|
|
3424
3512
|
"mobius",
|
|
3425
3513
|
"mobius-list",
|
|
3426
3514
|
{
|
|
@@ -3429,9 +3517,9 @@ var init_List = __esm({
|
|
|
3429
3517
|
},
|
|
3430
3518
|
otherProps.className
|
|
3431
3519
|
);
|
|
3432
|
-
return /* @__PURE__ */ (0,
|
|
3433
|
-
if ((0,
|
|
3434
|
-
return (0,
|
|
3520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Component, { ref, ...mappedProps, className: classes, children: import_react27.Children.map(children, (child) => {
|
|
3521
|
+
if ((0, import_react27.isValidElement)(child)) {
|
|
3522
|
+
return (0, import_react27.cloneElement)(child, {
|
|
3435
3523
|
parentIcon: icon
|
|
3436
3524
|
});
|
|
3437
3525
|
}
|
|
@@ -3443,16 +3531,16 @@ var init_List = __esm({
|
|
|
3443
3531
|
});
|
|
3444
3532
|
|
|
3445
3533
|
// src/components/List/ListItem.tsx
|
|
3446
|
-
var
|
|
3534
|
+
var import_dedupe33, import_jsx_runtime39, ListItem;
|
|
3447
3535
|
var init_ListItem = __esm({
|
|
3448
3536
|
"src/components/List/ListItem.tsx"() {
|
|
3449
3537
|
"use strict";
|
|
3450
|
-
|
|
3451
|
-
|
|
3538
|
+
import_dedupe33 = __toESM(require("classnames/dedupe"));
|
|
3539
|
+
import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3452
3540
|
ListItem = ({ ref, ...props }) => {
|
|
3453
3541
|
const { parentIcon, icon, children, ...otherProps } = props;
|
|
3454
3542
|
const iconContent = icon || parentIcon;
|
|
3455
|
-
const classes = (0,
|
|
3543
|
+
const classes = (0, import_dedupe33.default)(
|
|
3456
3544
|
"mobius",
|
|
3457
3545
|
"mobius-list__item",
|
|
3458
3546
|
{
|
|
@@ -3460,15 +3548,15 @@ var init_ListItem = __esm({
|
|
|
3460
3548
|
},
|
|
3461
3549
|
props.className
|
|
3462
3550
|
);
|
|
3463
|
-
const contentClasses = (0,
|
|
3464
|
-
const iconClasses = (0,
|
|
3551
|
+
const contentClasses = (0, import_dedupe33.default)("mobius", "mobius-list__item-content");
|
|
3552
|
+
const iconClasses = (0, import_dedupe33.default)("mobius", "mobius-list__icon");
|
|
3465
3553
|
if (iconContent) {
|
|
3466
|
-
return /* @__PURE__ */ (0,
|
|
3467
|
-
/* @__PURE__ */ (0,
|
|
3554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: contentClasses, children: [
|
|
3555
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: iconClasses, children: iconContent }),
|
|
3468
3556
|
children
|
|
3469
3557
|
] }) });
|
|
3470
3558
|
}
|
|
3471
|
-
return /* @__PURE__ */ (0,
|
|
3559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { ref, ...otherProps, className: classes, children });
|
|
3472
3560
|
};
|
|
3473
3561
|
ListItem.displayName = "ListItem";
|
|
3474
3562
|
}
|
|
@@ -3484,23 +3572,23 @@ var init_List2 = __esm({
|
|
|
3484
3572
|
});
|
|
3485
3573
|
|
|
3486
3574
|
// src/components/LoadingIndicator/LoadingIndicator.tsx
|
|
3487
|
-
var
|
|
3575
|
+
var import_dedupe34, import_icons7, import_LoadingIndicator, import_jsx_runtime40, LoadingIndicator;
|
|
3488
3576
|
var init_LoadingIndicator = __esm({
|
|
3489
3577
|
"src/components/LoadingIndicator/LoadingIndicator.tsx"() {
|
|
3490
3578
|
"use strict";
|
|
3491
|
-
|
|
3579
|
+
import_dedupe34 = __toESM(require("classnames/dedupe"));
|
|
3492
3580
|
import_icons7 = require("@simplybusiness/icons");
|
|
3493
3581
|
init_Icon2();
|
|
3494
3582
|
import_LoadingIndicator = require("@simplybusiness/mobius/src/components/LoadingIndicator/LoadingIndicator.css");
|
|
3495
|
-
|
|
3583
|
+
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3496
3584
|
LoadingIndicator = ({ ref, ...props }) => {
|
|
3497
3585
|
const { icon = import_icons7.loading, ...otherProps } = props;
|
|
3498
|
-
const classes = (0,
|
|
3586
|
+
const classes = (0, import_dedupe34.default)(
|
|
3499
3587
|
"mobius",
|
|
3500
3588
|
"mobius-loading-indicator",
|
|
3501
3589
|
otherProps.className
|
|
3502
3590
|
);
|
|
3503
|
-
return /* @__PURE__ */ (0,
|
|
3591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { icon, spin: true, ref, ...otherProps, className: classes });
|
|
3504
3592
|
};
|
|
3505
3593
|
LoadingIndicator.displayName = "LoadingIndicator";
|
|
3506
3594
|
}
|
|
@@ -3515,16 +3603,16 @@ var init_LoadingIndicator2 = __esm({
|
|
|
3515
3603
|
});
|
|
3516
3604
|
|
|
3517
3605
|
// src/components/Logo/Logo.tsx
|
|
3518
|
-
var
|
|
3606
|
+
var import_dedupe35, import_jsx_runtime41, Logo;
|
|
3519
3607
|
var init_Logo = __esm({
|
|
3520
3608
|
"src/components/Logo/Logo.tsx"() {
|
|
3521
3609
|
"use strict";
|
|
3522
|
-
|
|
3523
|
-
|
|
3610
|
+
import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3611
|
+
import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3524
3612
|
Logo = ({ ref, ...props }) => {
|
|
3525
3613
|
const { className, width, height, ...otherProps } = props;
|
|
3526
|
-
const classes = (0,
|
|
3527
|
-
return /* @__PURE__ */ (0,
|
|
3614
|
+
const classes = (0, import_dedupe35.default)("mobius", "mobius-logo", className);
|
|
3615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3528
3616
|
"svg",
|
|
3529
3617
|
{
|
|
3530
3618
|
width,
|
|
@@ -3534,7 +3622,7 @@ var init_Logo = __esm({
|
|
|
3534
3622
|
viewBox: "0 0 144 37",
|
|
3535
3623
|
...otherProps,
|
|
3536
3624
|
children: [
|
|
3537
|
-
/* @__PURE__ */ (0,
|
|
3625
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3538
3626
|
"linearGradient",
|
|
3539
3627
|
{
|
|
3540
3628
|
id: "logo-gradient",
|
|
@@ -3543,27 +3631,27 @@ var init_Logo = __esm({
|
|
|
3543
3631
|
y1: "76.042%",
|
|
3544
3632
|
y2: "26.973%",
|
|
3545
3633
|
children: [
|
|
3546
|
-
/* @__PURE__ */ (0,
|
|
3547
|
-
/* @__PURE__ */ (0,
|
|
3634
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { stopColor: "#4632D8", offset: "0%" }),
|
|
3635
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { stopColor: "#9084E8", offset: "100%" })
|
|
3548
3636
|
]
|
|
3549
3637
|
}
|
|
3550
3638
|
) }),
|
|
3551
|
-
/* @__PURE__ */ (0,
|
|
3552
|
-
/* @__PURE__ */ (0,
|
|
3639
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("g", { children: [
|
|
3640
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3553
3641
|
"path",
|
|
3554
3642
|
{
|
|
3555
3643
|
fill: "#0E0A2B",
|
|
3556
3644
|
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"
|
|
3557
3645
|
}
|
|
3558
3646
|
),
|
|
3559
|
-
/* @__PURE__ */ (0,
|
|
3647
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3560
3648
|
"path",
|
|
3561
3649
|
{
|
|
3562
3650
|
fill: "url(#logo-gradient)",
|
|
3563
3651
|
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"
|
|
3564
3652
|
}
|
|
3565
3653
|
),
|
|
3566
|
-
/* @__PURE__ */ (0,
|
|
3654
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3567
3655
|
"path",
|
|
3568
3656
|
{
|
|
3569
3657
|
fill: "#0E0A2B",
|
|
@@ -3588,23 +3676,23 @@ var init_Logo2 = __esm({
|
|
|
3588
3676
|
});
|
|
3589
3677
|
|
|
3590
3678
|
// src/components/Modal/Content.tsx
|
|
3591
|
-
var
|
|
3679
|
+
var import_jsx_runtime42, Content2;
|
|
3592
3680
|
var init_Content2 = __esm({
|
|
3593
3681
|
"src/components/Modal/Content.tsx"() {
|
|
3594
3682
|
"use strict";
|
|
3595
|
-
|
|
3596
|
-
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
3683
|
+
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3684
|
+
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { ref, ...otherProps, className: "mobius-modal__content", children });
|
|
3597
3685
|
Content2.displayName = "Content";
|
|
3598
3686
|
}
|
|
3599
3687
|
});
|
|
3600
3688
|
|
|
3601
3689
|
// src/components/Modal/ModalContext.tsx
|
|
3602
|
-
var
|
|
3690
|
+
var import_react28, ModalContext;
|
|
3603
3691
|
var init_ModalContext = __esm({
|
|
3604
3692
|
"src/components/Modal/ModalContext.tsx"() {
|
|
3605
3693
|
"use strict";
|
|
3606
|
-
|
|
3607
|
-
ModalContext = (0,
|
|
3694
|
+
import_react28 = require("react");
|
|
3695
|
+
ModalContext = (0, import_react28.createContext)({
|
|
3608
3696
|
onClose: () => {
|
|
3609
3697
|
},
|
|
3610
3698
|
closeLabel: void 0
|
|
@@ -3613,21 +3701,21 @@ var init_ModalContext = __esm({
|
|
|
3613
3701
|
});
|
|
3614
3702
|
|
|
3615
3703
|
// src/components/Modal/useModal.ts
|
|
3616
|
-
var
|
|
3704
|
+
var import_react29, useModal;
|
|
3617
3705
|
var init_useModal = __esm({
|
|
3618
3706
|
"src/components/Modal/useModal.ts"() {
|
|
3619
3707
|
"use strict";
|
|
3620
|
-
|
|
3708
|
+
import_react29 = require("react");
|
|
3621
3709
|
init_ModalContext();
|
|
3622
3710
|
useModal = () => {
|
|
3623
|
-
const { onClose, closeLabel } = (0,
|
|
3711
|
+
const { onClose, closeLabel } = (0, import_react29.useContext)(ModalContext);
|
|
3624
3712
|
return { onClose, closeLabel };
|
|
3625
3713
|
};
|
|
3626
3714
|
}
|
|
3627
3715
|
});
|
|
3628
3716
|
|
|
3629
3717
|
// src/components/Modal/Header.tsx
|
|
3630
|
-
var import_icons8,
|
|
3718
|
+
var import_icons8, import_jsx_runtime43, Header2;
|
|
3631
3719
|
var init_Header2 = __esm({
|
|
3632
3720
|
"src/components/Modal/Header.tsx"() {
|
|
3633
3721
|
"use strict";
|
|
@@ -3635,12 +3723,12 @@ var init_Header2 = __esm({
|
|
|
3635
3723
|
init_Button2();
|
|
3636
3724
|
init_Icon2();
|
|
3637
3725
|
init_useModal();
|
|
3638
|
-
|
|
3726
|
+
import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3639
3727
|
Header2 = ({ ref, children, ...otherProps }) => {
|
|
3640
3728
|
const { onClose, closeLabel } = useModal();
|
|
3641
|
-
return /* @__PURE__ */ (0,
|
|
3729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { ref, ...otherProps, className: "mobius-modal__header", children: [
|
|
3642
3730
|
children,
|
|
3643
|
-
/* @__PURE__ */ (0,
|
|
3731
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3644
3732
|
Button,
|
|
3645
3733
|
{
|
|
3646
3734
|
"aria-label": "Close",
|
|
@@ -3648,7 +3736,7 @@ var init_Header2 = __esm({
|
|
|
3648
3736
|
onPress: onClose,
|
|
3649
3737
|
className: "mobius-modal__close",
|
|
3650
3738
|
children: [
|
|
3651
|
-
/* @__PURE__ */ (0,
|
|
3739
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { icon: import_icons8.cross }),
|
|
3652
3740
|
" ",
|
|
3653
3741
|
closeLabel
|
|
3654
3742
|
]
|
|
@@ -3661,19 +3749,19 @@ var init_Header2 = __esm({
|
|
|
3661
3749
|
});
|
|
3662
3750
|
|
|
3663
3751
|
// src/components/Modal/Modal.tsx
|
|
3664
|
-
var
|
|
3752
|
+
var import_dedupe36, import_react30, import_Modal, import_jsx_runtime44, TRANSITION_CSS_VARIABLE2, Modal;
|
|
3665
3753
|
var init_Modal = __esm({
|
|
3666
3754
|
"src/components/Modal/Modal.tsx"() {
|
|
3667
3755
|
"use strict";
|
|
3668
3756
|
"use client";
|
|
3669
|
-
|
|
3670
|
-
|
|
3757
|
+
import_dedupe36 = __toESM(require("classnames/dedupe"));
|
|
3758
|
+
import_react30 = require("react");
|
|
3671
3759
|
init_hooks();
|
|
3672
3760
|
init_utils();
|
|
3673
3761
|
init_polyfill_tests();
|
|
3674
3762
|
init_ModalContext();
|
|
3675
3763
|
import_Modal = require("@simplybusiness/mobius/src/components/Modal/Modal.css");
|
|
3676
|
-
|
|
3764
|
+
import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3677
3765
|
TRANSITION_CSS_VARIABLE2 = "--modal-transition-duration";
|
|
3678
3766
|
Modal = ({ ref, ...props }) => {
|
|
3679
3767
|
const {
|
|
@@ -3687,11 +3775,11 @@ var init_Modal = __esm({
|
|
|
3687
3775
|
animation,
|
|
3688
3776
|
...rest
|
|
3689
3777
|
} = props;
|
|
3690
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3691
|
-
(0,
|
|
3778
|
+
const [shouldTransition, setShouldTransition] = (0, import_react30.useState)(false);
|
|
3779
|
+
(0, import_react30.useEffect)(() => {
|
|
3692
3780
|
setShouldTransition(supportsDialog());
|
|
3693
3781
|
}, []);
|
|
3694
|
-
const dialogRef = (0,
|
|
3782
|
+
const dialogRef = (0, import_react30.useRef)(null);
|
|
3695
3783
|
const { close } = useDialog({
|
|
3696
3784
|
ref: dialogRef,
|
|
3697
3785
|
isOpen,
|
|
@@ -3702,7 +3790,7 @@ var init_Modal = __esm({
|
|
|
3702
3790
|
CSSVariable: TRANSITION_CSS_VARIABLE2
|
|
3703
3791
|
}
|
|
3704
3792
|
});
|
|
3705
|
-
const modalClasses = (0,
|
|
3793
|
+
const modalClasses = (0, import_dedupe36.default)(
|
|
3706
3794
|
"mobius",
|
|
3707
3795
|
"mobius-modal",
|
|
3708
3796
|
{
|
|
@@ -3715,21 +3803,21 @@ var init_Modal = __esm({
|
|
|
3715
3803
|
},
|
|
3716
3804
|
className
|
|
3717
3805
|
);
|
|
3718
|
-
const contextValue = (0,
|
|
3806
|
+
const contextValue = (0, import_react30.useMemo)(
|
|
3719
3807
|
() => ({
|
|
3720
3808
|
onClose: close,
|
|
3721
3809
|
closeLabel
|
|
3722
3810
|
}),
|
|
3723
3811
|
[close, closeLabel]
|
|
3724
3812
|
);
|
|
3725
|
-
return /* @__PURE__ */ (0,
|
|
3813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3726
3814
|
"dialog",
|
|
3727
3815
|
{
|
|
3728
3816
|
ref: mergeRefs([dialogRef, ref]),
|
|
3729
3817
|
onCancel: close,
|
|
3730
3818
|
className: modalClasses,
|
|
3731
3819
|
...rest,
|
|
3732
|
-
children: /* @__PURE__ */ (0,
|
|
3820
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ModalContext.Provider, { value: contextValue, children })
|
|
3733
3821
|
}
|
|
3734
3822
|
);
|
|
3735
3823
|
};
|
|
@@ -3754,16 +3842,16 @@ var init_Modal2 = __esm({
|
|
|
3754
3842
|
});
|
|
3755
3843
|
|
|
3756
3844
|
// src/components/NumberField/NumberField.tsx
|
|
3757
|
-
var
|
|
3845
|
+
var import_dedupe37, import_react31, import_NumberField, import_jsx_runtime45, NumberField;
|
|
3758
3846
|
var init_NumberField = __esm({
|
|
3759
3847
|
"src/components/NumberField/NumberField.tsx"() {
|
|
3760
3848
|
"use strict";
|
|
3761
3849
|
"use client";
|
|
3762
|
-
|
|
3763
|
-
|
|
3850
|
+
import_dedupe37 = __toESM(require("classnames/dedupe"));
|
|
3851
|
+
import_react31 = require("react");
|
|
3764
3852
|
init_TextField2();
|
|
3765
3853
|
import_NumberField = require("@simplybusiness/mobius/src/components/NumberField/NumberField.css");
|
|
3766
|
-
|
|
3854
|
+
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3767
3855
|
NumberField = ({ ref, ...props }) => {
|
|
3768
3856
|
const {
|
|
3769
3857
|
minValue,
|
|
@@ -3779,15 +3867,15 @@ var init_NumberField = __esm({
|
|
|
3779
3867
|
onBlur: customOnBlur,
|
|
3780
3868
|
...rest
|
|
3781
3869
|
} = otherProps;
|
|
3782
|
-
const focusedInputRef = (0,
|
|
3783
|
-
const wheelHandler = (0,
|
|
3784
|
-
(0,
|
|
3870
|
+
const focusedInputRef = (0, import_react31.useRef)(null);
|
|
3871
|
+
const wheelHandler = (0, import_react31.useCallback)((ev) => ev.preventDefault(), []);
|
|
3872
|
+
(0, import_react31.useEffect)(() => {
|
|
3785
3873
|
return () => {
|
|
3786
3874
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
3787
3875
|
focusedInputRef.current = null;
|
|
3788
3876
|
};
|
|
3789
3877
|
}, [wheelHandler]);
|
|
3790
|
-
const containerClasses = (0,
|
|
3878
|
+
const containerClasses = (0, import_dedupe37.default)("mobius-number-field", className, {
|
|
3791
3879
|
"--hide-spin-buttons": hideSpinButtons
|
|
3792
3880
|
});
|
|
3793
3881
|
const handleBeforeInput = (event) => {
|
|
@@ -3831,7 +3919,7 @@ var init_NumberField = __esm({
|
|
|
3831
3919
|
},
|
|
3832
3920
|
onBlur: (e) => handleBlur(e)
|
|
3833
3921
|
};
|
|
3834
|
-
return /* @__PURE__ */ (0,
|
|
3922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3835
3923
|
TextField,
|
|
3836
3924
|
{
|
|
3837
3925
|
...forwardedProps,
|
|
@@ -3859,18 +3947,18 @@ var init_NumberField2 = __esm({
|
|
|
3859
3947
|
});
|
|
3860
3948
|
|
|
3861
3949
|
// src/components/Option/Option.tsx
|
|
3862
|
-
var
|
|
3950
|
+
var import_jsx_runtime46, Option2;
|
|
3863
3951
|
var init_Option2 = __esm({
|
|
3864
3952
|
"src/components/Option/Option.tsx"() {
|
|
3865
3953
|
"use strict";
|
|
3866
|
-
|
|
3954
|
+
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3867
3955
|
Option2 = ({ ref, ...props }) => {
|
|
3868
3956
|
const { isDisabled, ...rest } = props;
|
|
3869
3957
|
const mappedProps = {
|
|
3870
3958
|
...rest,
|
|
3871
3959
|
disabled: isDisabled
|
|
3872
3960
|
};
|
|
3873
|
-
return /* @__PURE__ */ (0,
|
|
3961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { ...mappedProps, ref });
|
|
3874
3962
|
};
|
|
3875
3963
|
Option2.displayName = "Option";
|
|
3876
3964
|
}
|
|
@@ -3885,17 +3973,17 @@ var init_Option3 = __esm({
|
|
|
3885
3973
|
});
|
|
3886
3974
|
|
|
3887
3975
|
// src/components/PasswordField/ShowHideButton.tsx
|
|
3888
|
-
var import_icons9,
|
|
3976
|
+
var import_icons9, import_jsx_runtime47, ShowHideButton;
|
|
3889
3977
|
var init_ShowHideButton = __esm({
|
|
3890
3978
|
"src/components/PasswordField/ShowHideButton.tsx"() {
|
|
3891
3979
|
"use strict";
|
|
3892
3980
|
import_icons9 = require("@simplybusiness/icons");
|
|
3893
3981
|
init_src();
|
|
3894
|
-
|
|
3982
|
+
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3895
3983
|
ShowHideButton = ({
|
|
3896
3984
|
show = false,
|
|
3897
3985
|
onClick
|
|
3898
|
-
}) => /* @__PURE__ */ (0,
|
|
3986
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3899
3987
|
"button",
|
|
3900
3988
|
{
|
|
3901
3989
|
className: "mobius-password-field__show-button",
|
|
@@ -3906,35 +3994,35 @@ var init_ShowHideButton = __esm({
|
|
|
3906
3994
|
},
|
|
3907
3995
|
"aria-label": `${show ? "Hide" : "Show"} password`,
|
|
3908
3996
|
"data-testid": "show-hide-button",
|
|
3909
|
-
children: /* @__PURE__ */ (0,
|
|
3997
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { icon: show ? import_icons9.eyeSlash : import_icons9.eye, "aria-hidden": "true" })
|
|
3910
3998
|
}
|
|
3911
3999
|
);
|
|
3912
4000
|
}
|
|
3913
4001
|
});
|
|
3914
4002
|
|
|
3915
4003
|
// src/components/PasswordField/PasswordField.tsx
|
|
3916
|
-
var
|
|
4004
|
+
var import_dedupe38, import_react32, import_PasswordField, import_jsx_runtime48, PasswordField;
|
|
3917
4005
|
var init_PasswordField = __esm({
|
|
3918
4006
|
"src/components/PasswordField/PasswordField.tsx"() {
|
|
3919
4007
|
"use strict";
|
|
3920
4008
|
"use client";
|
|
3921
|
-
|
|
3922
|
-
|
|
4009
|
+
import_dedupe38 = __toESM(require("classnames/dedupe"));
|
|
4010
|
+
import_react32 = require("react");
|
|
3923
4011
|
init_mergeRefs();
|
|
3924
4012
|
init_TextField2();
|
|
3925
4013
|
init_ShowHideButton();
|
|
3926
4014
|
import_PasswordField = require("@simplybusiness/mobius/src/components/PasswordField/PasswordField.css");
|
|
3927
|
-
|
|
4015
|
+
import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3928
4016
|
PasswordField = ({
|
|
3929
4017
|
ref,
|
|
3930
4018
|
className,
|
|
3931
4019
|
autoComplete = "current-password",
|
|
3932
4020
|
...props
|
|
3933
4021
|
}) => {
|
|
3934
|
-
const [show, setShow] = (0,
|
|
4022
|
+
const [show, setShow] = (0, import_react32.useState)(false);
|
|
3935
4023
|
const type = show ? "text" : "password";
|
|
3936
|
-
const classes = (0,
|
|
3937
|
-
const localRef = (0,
|
|
4024
|
+
const classes = (0, import_dedupe38.default)("mobius-password-field", className);
|
|
4025
|
+
const localRef = (0, import_react32.useRef)(null);
|
|
3938
4026
|
const handleShowHideButtonClick = () => {
|
|
3939
4027
|
const selectionStart = localRef.current?.selectionStart;
|
|
3940
4028
|
const selectionEnd = localRef.current?.selectionEnd;
|
|
@@ -3946,7 +4034,7 @@ var init_PasswordField = __esm({
|
|
|
3946
4034
|
}
|
|
3947
4035
|
});
|
|
3948
4036
|
};
|
|
3949
|
-
return /* @__PURE__ */ (0,
|
|
4037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3950
4038
|
TextField,
|
|
3951
4039
|
{
|
|
3952
4040
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -3954,7 +4042,7 @@ var init_PasswordField = __esm({
|
|
|
3954
4042
|
...props,
|
|
3955
4043
|
autoComplete,
|
|
3956
4044
|
type,
|
|
3957
|
-
suffixInside: /* @__PURE__ */ (0,
|
|
4045
|
+
suffixInside: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ShowHideButton, { onClick: handleShowHideButtonClick, show })
|
|
3958
4046
|
}
|
|
3959
4047
|
);
|
|
3960
4048
|
};
|
|
@@ -3971,17 +4059,17 @@ var init_PasswordField2 = __esm({
|
|
|
3971
4059
|
});
|
|
3972
4060
|
|
|
3973
4061
|
// src/components/Popover/Popover.tsx
|
|
3974
|
-
var
|
|
4062
|
+
var import_react33, import_icons10, import_dedupe39, import_react34, import_mobius_hooks6, import_Popover, import_jsx_runtime49;
|
|
3975
4063
|
var init_Popover = __esm({
|
|
3976
4064
|
"src/components/Popover/Popover.tsx"() {
|
|
3977
4065
|
"use strict";
|
|
3978
|
-
|
|
4066
|
+
import_react33 = require("@floating-ui/react");
|
|
3979
4067
|
import_icons10 = require("@simplybusiness/icons");
|
|
3980
|
-
|
|
3981
|
-
|
|
4068
|
+
import_dedupe39 = __toESM(require("classnames/dedupe"));
|
|
4069
|
+
import_react34 = require("react");
|
|
3982
4070
|
import_mobius_hooks6 = require("@simplybusiness/mobius-hooks");
|
|
3983
4071
|
import_Popover = require("@simplybusiness/mobius/src/components/Popover/Popover.css");
|
|
3984
|
-
|
|
4072
|
+
import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3985
4073
|
}
|
|
3986
4074
|
});
|
|
3987
4075
|
|
|
@@ -4005,17 +4093,17 @@ function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
|
4005
4093
|
console.warn("Progress value is greater than maxValue");
|
|
4006
4094
|
}
|
|
4007
4095
|
}
|
|
4008
|
-
var
|
|
4096
|
+
var import_dedupe40, import_react35, import_Progress, import_jsx_runtime50, sanitizedValue, getLabelComponent, DEFAULT_VALUE, DEFAULT_MIN_VALUE, DEFAULT_MAX_VALUE, Progress;
|
|
4009
4097
|
var init_Progress = __esm({
|
|
4010
4098
|
"src/components/Progress/Progress.tsx"() {
|
|
4011
4099
|
"use strict";
|
|
4012
4100
|
"use client";
|
|
4013
|
-
|
|
4014
|
-
|
|
4101
|
+
import_dedupe40 = __toESM(require("classnames/dedupe"));
|
|
4102
|
+
import_react35 = require("react");
|
|
4015
4103
|
init_Label2();
|
|
4016
4104
|
init_VisuallyHidden2();
|
|
4017
4105
|
import_Progress = require("@simplybusiness/mobius/src/components/Progress/Progress.css");
|
|
4018
|
-
|
|
4106
|
+
import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4019
4107
|
sanitizedValue = (value, defaultValue) => {
|
|
4020
4108
|
if (value === void 0 || Number.isNaN(value)) {
|
|
4021
4109
|
return defaultValue;
|
|
@@ -4024,7 +4112,7 @@ var init_Progress = __esm({
|
|
|
4024
4112
|
};
|
|
4025
4113
|
getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
4026
4114
|
if (showLabel) {
|
|
4027
|
-
return /* @__PURE__ */ (0,
|
|
4115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4028
4116
|
Label,
|
|
4029
4117
|
{
|
|
4030
4118
|
id: progressLabelId,
|
|
@@ -4034,7 +4122,7 @@ var init_Progress = __esm({
|
|
|
4034
4122
|
}
|
|
4035
4123
|
);
|
|
4036
4124
|
}
|
|
4037
|
-
return /* @__PURE__ */ (0,
|
|
4125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4038
4126
|
Label,
|
|
4039
4127
|
{
|
|
4040
4128
|
id: progressLabelId,
|
|
@@ -4048,8 +4136,8 @@ var init_Progress = __esm({
|
|
|
4048
4136
|
DEFAULT_MIN_VALUE = 0;
|
|
4049
4137
|
DEFAULT_MAX_VALUE = 100;
|
|
4050
4138
|
Progress = ({ ref, ...props }) => {
|
|
4051
|
-
const progressId = (0,
|
|
4052
|
-
const progressLabelId = (0,
|
|
4139
|
+
const progressId = (0, import_react35.useId)();
|
|
4140
|
+
const progressLabelId = (0, import_react35.useId)();
|
|
4053
4141
|
const {
|
|
4054
4142
|
id,
|
|
4055
4143
|
label,
|
|
@@ -4074,7 +4162,7 @@ var init_Progress = __esm({
|
|
|
4074
4162
|
100
|
|
4075
4163
|
);
|
|
4076
4164
|
const barWidth = `${percentage}%`;
|
|
4077
|
-
const classes = (0,
|
|
4165
|
+
const classes = (0, import_dedupe40.default)("mobius", "mobius-progress", className, {
|
|
4078
4166
|
"--is-primary": variant === "primary",
|
|
4079
4167
|
"--is-secondary": variant === "secondary"
|
|
4080
4168
|
});
|
|
@@ -4084,7 +4172,7 @@ var init_Progress = __esm({
|
|
|
4084
4172
|
progressBarProps["aria-valuenow"] = value.toString();
|
|
4085
4173
|
progressBarProps["aria-valuetext"] = valueFormatter instanceof Function ? valueFormatter(value, minValue, maxValue) : barWidth;
|
|
4086
4174
|
const labelComponent = getLabelComponent(label, progressLabelId, showLabel);
|
|
4087
|
-
return /* @__PURE__ */ (0,
|
|
4175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4088
4176
|
"div",
|
|
4089
4177
|
{
|
|
4090
4178
|
id: id || progressId,
|
|
@@ -4095,8 +4183,8 @@ var init_Progress = __esm({
|
|
|
4095
4183
|
"aria-labelledby": progressLabelId,
|
|
4096
4184
|
children: [
|
|
4097
4185
|
labelComponent,
|
|
4098
|
-
/* @__PURE__ */ (0,
|
|
4099
|
-
showValueLabel && /* @__PURE__ */ (0,
|
|
4186
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mobius-progress__track", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mobius-progress__bar", style: { width: barWidth } }) }),
|
|
4187
|
+
showValueLabel && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
|
|
4100
4188
|
]
|
|
4101
4189
|
}
|
|
4102
4190
|
);
|
|
@@ -4114,17 +4202,17 @@ var init_Progress2 = __esm({
|
|
|
4114
4202
|
});
|
|
4115
4203
|
|
|
4116
4204
|
// src/components/Radio/Radio.tsx
|
|
4117
|
-
var
|
|
4205
|
+
var import_dedupe41, import_react36, import_Radio, import_jsx_runtime51, Radio;
|
|
4118
4206
|
var init_Radio = __esm({
|
|
4119
4207
|
"src/components/Radio/Radio.tsx"() {
|
|
4120
4208
|
"use strict";
|
|
4121
4209
|
"use client";
|
|
4122
|
-
|
|
4123
|
-
|
|
4210
|
+
import_dedupe41 = __toESM(require("classnames/dedupe"));
|
|
4211
|
+
import_react36 = require("react");
|
|
4124
4212
|
init_ErrorMessage2();
|
|
4125
4213
|
init_Label2();
|
|
4126
4214
|
import_Radio = require("@simplybusiness/mobius/src/components/Radio/Radio.css");
|
|
4127
|
-
|
|
4215
|
+
import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4128
4216
|
Radio = ({ ref, ...props }) => {
|
|
4129
4217
|
const {
|
|
4130
4218
|
children,
|
|
@@ -4148,19 +4236,19 @@ var init_Radio = __esm({
|
|
|
4148
4236
|
const isMultiline = label && children;
|
|
4149
4237
|
const isControlled = selected !== void 0;
|
|
4150
4238
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
4151
|
-
const contentRef = (0,
|
|
4152
|
-
const prevOverflowRef = (0,
|
|
4239
|
+
const contentRef = (0, import_react36.useRef)(null);
|
|
4240
|
+
const prevOverflowRef = (0, import_react36.useRef)({
|
|
4153
4241
|
vertical: false,
|
|
4154
4242
|
horizontal: false
|
|
4155
4243
|
});
|
|
4156
|
-
const hasIconFirst = (0,
|
|
4157
|
-
if (!children ||
|
|
4158
|
-
const firstChild =
|
|
4159
|
-
if (!(0,
|
|
4244
|
+
const hasIconFirst = (0, import_react36.useMemo)(() => {
|
|
4245
|
+
if (!children || import_react36.Children.count(children) === 0) return false;
|
|
4246
|
+
const firstChild = import_react36.Children.toArray(children)[0];
|
|
4247
|
+
if (!(0, import_react36.isValidElement)(firstChild)) return false;
|
|
4160
4248
|
const props2 = firstChild.props;
|
|
4161
4249
|
return "icon" in props2 && props2.icon !== void 0;
|
|
4162
4250
|
}, [children]);
|
|
4163
|
-
(0,
|
|
4251
|
+
(0, import_react36.useLayoutEffect)(() => {
|
|
4164
4252
|
if (!contentRef.current || !onOverflow) return;
|
|
4165
4253
|
if (orientation === "vertical") {
|
|
4166
4254
|
return;
|
|
@@ -4189,13 +4277,13 @@ var init_Radio = __esm({
|
|
|
4189
4277
|
"--is-multiline": !!isMultiline,
|
|
4190
4278
|
"--is-required": isRequired
|
|
4191
4279
|
};
|
|
4192
|
-
const containerClasses = (0,
|
|
4280
|
+
const containerClasses = (0, import_dedupe41.default)(
|
|
4193
4281
|
"mobius-radio__label",
|
|
4194
4282
|
radioClasses,
|
|
4195
4283
|
className,
|
|
4196
4284
|
{ "--has-icon-first": hasIconFirst }
|
|
4197
4285
|
);
|
|
4198
|
-
const inputClasses = (0,
|
|
4286
|
+
const inputClasses = (0, import_dedupe41.default)("mobius-radio__input", radioClasses);
|
|
4199
4287
|
const { "aria-describedby": _ariaDescribedBy, ...rest } = otherProps;
|
|
4200
4288
|
const handleChange = (event) => {
|
|
4201
4289
|
if (setSelected) {
|
|
@@ -4209,9 +4297,9 @@ var init_Radio = __esm({
|
|
|
4209
4297
|
onChange(adaptedEvent);
|
|
4210
4298
|
}
|
|
4211
4299
|
};
|
|
4212
|
-
return /* @__PURE__ */ (0,
|
|
4213
|
-
/* @__PURE__ */ (0,
|
|
4214
|
-
/* @__PURE__ */ (0,
|
|
4300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
4301
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Label, { className: containerClasses, children: [
|
|
4302
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4215
4303
|
"input",
|
|
4216
4304
|
{
|
|
4217
4305
|
"aria-describedby": otherProps["aria-describedby"],
|
|
@@ -4228,12 +4316,12 @@ var init_Radio = __esm({
|
|
|
4228
4316
|
...rest
|
|
4229
4317
|
}
|
|
4230
4318
|
),
|
|
4231
|
-
isMultiline ? /* @__PURE__ */ (0,
|
|
4232
|
-
/* @__PURE__ */ (0,
|
|
4233
|
-
/* @__PURE__ */ (0,
|
|
4234
|
-
] }) : /* @__PURE__ */ (0,
|
|
4319
|
+
isMultiline ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { ref: contentRef, className: "mobius-radio__content--multiline", children: [
|
|
4320
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mobius-radio__content-first-line", children: label }),
|
|
4321
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mobius-radio__extra-content", children })
|
|
4322
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { ref: contentRef, className: "mobius-radio__content", children: label || children })
|
|
4235
4323
|
] }),
|
|
4236
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
4324
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ErrorMessage, { errorMessage })
|
|
4237
4325
|
] });
|
|
4238
4326
|
};
|
|
4239
4327
|
Radio.displayName = "Radio";
|
|
@@ -4241,19 +4329,19 @@ var init_Radio = __esm({
|
|
|
4241
4329
|
});
|
|
4242
4330
|
|
|
4243
4331
|
// src/components/Radio/RadioGroup.tsx
|
|
4244
|
-
var
|
|
4332
|
+
var import_dedupe42, import_react37, import_jsx_runtime52, getDefaultVal, RadioGroup;
|
|
4245
4333
|
var init_RadioGroup = __esm({
|
|
4246
4334
|
"src/components/Radio/RadioGroup.tsx"() {
|
|
4247
4335
|
"use strict";
|
|
4248
4336
|
"use client";
|
|
4249
|
-
|
|
4250
|
-
|
|
4337
|
+
import_dedupe42 = __toESM(require("classnames/dedupe"));
|
|
4338
|
+
import_react37 = require("react");
|
|
4251
4339
|
init_hooks();
|
|
4252
4340
|
init_spaceDelimitedList();
|
|
4253
4341
|
init_ErrorMessage2();
|
|
4254
4342
|
init_Label2();
|
|
4255
4343
|
init_Stack2();
|
|
4256
|
-
|
|
4344
|
+
import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4257
4345
|
getDefaultVal = (children, defaultValue) => {
|
|
4258
4346
|
if (Array.isArray(children) && defaultValue) {
|
|
4259
4347
|
const option = children?.find((item) => item.props.value === defaultValue);
|
|
@@ -4281,15 +4369,15 @@ var init_RadioGroup = __esm({
|
|
|
4281
4369
|
...rest
|
|
4282
4370
|
} = props;
|
|
4283
4371
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
4284
|
-
const [selected, setSelected] = (0,
|
|
4285
|
-
const overflowsRef = (0,
|
|
4286
|
-
const [hasOverflow, setHasOverflow] = (0,
|
|
4287
|
-
(0,
|
|
4372
|
+
const [selected, setSelected] = (0, import_react37.useState)(defaultSelected);
|
|
4373
|
+
const overflowsRef = (0, import_react37.useRef)({});
|
|
4374
|
+
const [hasOverflow, setHasOverflow] = (0, import_react37.useState)(false);
|
|
4375
|
+
(0, import_react37.useEffect)(() => {
|
|
4288
4376
|
if (value !== void 0) {
|
|
4289
4377
|
setSelected(value);
|
|
4290
4378
|
}
|
|
4291
4379
|
}, [value]);
|
|
4292
|
-
const handleOverflow = (0,
|
|
4380
|
+
const handleOverflow = (0, import_react37.useCallback)(
|
|
4293
4381
|
(radioValue, overflow) => {
|
|
4294
4382
|
overflowsRef.current = {
|
|
4295
4383
|
...overflowsRef.current,
|
|
@@ -4313,26 +4401,26 @@ var init_RadioGroup = __esm({
|
|
|
4313
4401
|
[`--is-${effectiveOrientation}`]: true,
|
|
4314
4402
|
[className || ""]: true
|
|
4315
4403
|
};
|
|
4316
|
-
const radioGroupClasses = (0,
|
|
4404
|
+
const radioGroupClasses = (0, import_dedupe42.default)(
|
|
4317
4405
|
"mobius",
|
|
4318
4406
|
"mobius-radio-group",
|
|
4319
4407
|
radioClasses,
|
|
4320
4408
|
validationClasses
|
|
4321
4409
|
);
|
|
4322
|
-
const radioWrapperClasses = (0,
|
|
4410
|
+
const radioWrapperClasses = (0, import_dedupe42.default)("mobius-radio__wrapper", {
|
|
4323
4411
|
[`--is-${effectiveOrientation}`]: true
|
|
4324
4412
|
});
|
|
4325
|
-
const labelClasses = (0,
|
|
4326
|
-
const errorMessageId = (0,
|
|
4327
|
-
const defaultNameAttrId = (0,
|
|
4413
|
+
const labelClasses = (0, import_dedupe42.default)(radioClasses, validationClasses);
|
|
4414
|
+
const errorMessageId = (0, import_react37.useId)();
|
|
4415
|
+
const defaultNameAttrId = (0, import_react37.useId)();
|
|
4328
4416
|
const nameAttribute = name || defaultNameAttrId;
|
|
4329
4417
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4330
4418
|
const describedBy = spaceDelimitedList([
|
|
4331
4419
|
shouldErrorMessageShow,
|
|
4332
4420
|
props["aria-describedby"]
|
|
4333
4421
|
]);
|
|
4334
|
-
const labelId = (0,
|
|
4335
|
-
return /* @__PURE__ */ (0,
|
|
4422
|
+
const labelId = (0, import_react37.useId)();
|
|
4423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4336
4424
|
"div",
|
|
4337
4425
|
{
|
|
4338
4426
|
...rest,
|
|
@@ -4348,12 +4436,12 @@ var init_RadioGroup = __esm({
|
|
|
4348
4436
|
ref,
|
|
4349
4437
|
className: radioGroupClasses,
|
|
4350
4438
|
role: "radiogroup",
|
|
4351
|
-
children: /* @__PURE__ */ (0,
|
|
4352
|
-
label && /* @__PURE__ */ (0,
|
|
4353
|
-
/* @__PURE__ */ (0,
|
|
4354
|
-
if ((0,
|
|
4439
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Stack, { gap: "xs", children: [
|
|
4440
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
4441
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: radioWrapperClasses, children: import_react37.Children.map(children, (child) => {
|
|
4442
|
+
if ((0, import_react37.isValidElement)(child)) {
|
|
4355
4443
|
const childValue = child.props.value;
|
|
4356
|
-
return (0,
|
|
4444
|
+
return (0, import_react37.cloneElement)(
|
|
4357
4445
|
child,
|
|
4358
4446
|
{
|
|
4359
4447
|
orientation: effectiveOrientation,
|
|
@@ -4371,7 +4459,7 @@ var init_RadioGroup = __esm({
|
|
|
4371
4459
|
}
|
|
4372
4460
|
return child;
|
|
4373
4461
|
}) }),
|
|
4374
|
-
/* @__PURE__ */ (0,
|
|
4462
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4375
4463
|
] })
|
|
4376
4464
|
}
|
|
4377
4465
|
);
|
|
@@ -4390,47 +4478,47 @@ var init_Radio2 = __esm({
|
|
|
4390
4478
|
});
|
|
4391
4479
|
|
|
4392
4480
|
// src/components/Segment/SegmentGroup.tsx
|
|
4393
|
-
var
|
|
4481
|
+
var import_dedupe43, import_jsx_runtime53, SegmentGroup;
|
|
4394
4482
|
var init_SegmentGroup = __esm({
|
|
4395
4483
|
"src/components/Segment/SegmentGroup.tsx"() {
|
|
4396
4484
|
"use strict";
|
|
4397
|
-
|
|
4398
|
-
|
|
4485
|
+
import_dedupe43 = __toESM(require("classnames/dedupe"));
|
|
4486
|
+
import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4399
4487
|
SegmentGroup = (props) => {
|
|
4400
4488
|
const { children, horizontal, gap, className, ...rest } = props;
|
|
4401
4489
|
const gapClass = gap ? `gap-${gap}` : "";
|
|
4402
|
-
const classes = (0,
|
|
4490
|
+
const classes = (0, import_dedupe43.default)(
|
|
4403
4491
|
"mobius",
|
|
4404
4492
|
"mobius-segment-group",
|
|
4405
4493
|
className,
|
|
4406
4494
|
{ "--is-horizontal": horizontal },
|
|
4407
4495
|
gapClass
|
|
4408
4496
|
);
|
|
4409
|
-
return /* @__PURE__ */ (0,
|
|
4497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: classes, ...rest, children });
|
|
4410
4498
|
};
|
|
4411
4499
|
SegmentGroup.displayName = "SegmentGroup";
|
|
4412
4500
|
}
|
|
4413
4501
|
});
|
|
4414
4502
|
|
|
4415
4503
|
// src/components/Segment/Segment.tsx
|
|
4416
|
-
var
|
|
4504
|
+
var import_dedupe44, import_Segment, import_jsx_runtime54, Segment;
|
|
4417
4505
|
var init_Segment = __esm({
|
|
4418
4506
|
"src/components/Segment/Segment.tsx"() {
|
|
4419
4507
|
"use strict";
|
|
4420
|
-
|
|
4508
|
+
import_dedupe44 = __toESM(require("classnames/dedupe"));
|
|
4421
4509
|
import_Segment = require("@simplybusiness/mobius/src/components/Segment/Segment.css");
|
|
4422
|
-
|
|
4510
|
+
import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4423
4511
|
Segment = (props) => {
|
|
4424
4512
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
4425
|
-
const classes = (0,
|
|
4513
|
+
const classes = (0, import_dedupe44.default)(
|
|
4426
4514
|
"mobius",
|
|
4427
4515
|
"mobius-segment",
|
|
4428
4516
|
colour,
|
|
4429
4517
|
{ inverted },
|
|
4430
4518
|
className
|
|
4431
4519
|
);
|
|
4432
|
-
return /* @__PURE__ */ (0,
|
|
4433
|
-
heading && /* @__PURE__ */ (0,
|
|
4520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: classes, ...rest, children: [
|
|
4521
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mobius-segment__heading", children: heading }),
|
|
4434
4522
|
children
|
|
4435
4523
|
] });
|
|
4436
4524
|
};
|
|
@@ -4448,14 +4536,14 @@ var init_Segment2 = __esm({
|
|
|
4448
4536
|
});
|
|
4449
4537
|
|
|
4450
4538
|
// src/components/Select/Select.tsx
|
|
4451
|
-
var import_icons11,
|
|
4539
|
+
var import_icons11, import_dedupe45, import_react38, import_Select, import_jsx_runtime55, Select;
|
|
4452
4540
|
var init_Select = __esm({
|
|
4453
4541
|
"src/components/Select/Select.tsx"() {
|
|
4454
4542
|
"use strict";
|
|
4455
4543
|
"use client";
|
|
4456
4544
|
import_icons11 = require("@simplybusiness/icons");
|
|
4457
|
-
|
|
4458
|
-
|
|
4545
|
+
import_dedupe45 = __toESM(require("classnames/dedupe"));
|
|
4546
|
+
import_react38 = require("react");
|
|
4459
4547
|
init_hooks();
|
|
4460
4548
|
init_useLabel2();
|
|
4461
4549
|
init_spaceDelimitedList();
|
|
@@ -4464,7 +4552,7 @@ var init_Select = __esm({
|
|
|
4464
4552
|
init_Label2();
|
|
4465
4553
|
init_Stack2();
|
|
4466
4554
|
import_Select = require("@simplybusiness/mobius/src/components/Select/Select.css");
|
|
4467
|
-
|
|
4555
|
+
import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4468
4556
|
Select = ({ ref, ...props }) => {
|
|
4469
4557
|
const {
|
|
4470
4558
|
label,
|
|
@@ -4485,24 +4573,24 @@ var init_Select = __esm({
|
|
|
4485
4573
|
"--is-required": typeof isRequired === "boolean" && isRequired,
|
|
4486
4574
|
"--is-optional": typeof isRequired === "boolean" && !isRequired
|
|
4487
4575
|
};
|
|
4488
|
-
const sharedClasses = (0,
|
|
4489
|
-
const wrapperClasses = (0,
|
|
4576
|
+
const sharedClasses = (0, import_dedupe45.default)(validationClasses, stateClasses);
|
|
4577
|
+
const wrapperClasses = (0, import_dedupe45.default)(
|
|
4490
4578
|
"mobius-select__wrapper",
|
|
4491
4579
|
sharedClasses,
|
|
4492
4580
|
otherProps.className
|
|
4493
4581
|
);
|
|
4494
|
-
const selectClasses = (0,
|
|
4582
|
+
const selectClasses = (0, import_dedupe45.default)(
|
|
4495
4583
|
"mobius-select",
|
|
4496
4584
|
sharedClasses,
|
|
4497
4585
|
otherProps.className
|
|
4498
4586
|
);
|
|
4499
|
-
const labelClasses = (0,
|
|
4587
|
+
const labelClasses = (0, import_dedupe45.default)(
|
|
4500
4588
|
"mobius-label",
|
|
4501
4589
|
sharedClasses,
|
|
4502
4590
|
otherProps.className
|
|
4503
4591
|
);
|
|
4504
|
-
const iconClasses = (0,
|
|
4505
|
-
const errorMessageId = (0,
|
|
4592
|
+
const iconClasses = (0, import_dedupe45.default)("mobius-select__icon", sharedClasses);
|
|
4593
|
+
const errorMessageId = (0, import_react38.useId)();
|
|
4506
4594
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4507
4595
|
const describedBy = spaceDelimitedList([
|
|
4508
4596
|
shouldErrorMessageShow,
|
|
@@ -4513,10 +4601,10 @@ var init_Select = __esm({
|
|
|
4513
4601
|
onChange(e);
|
|
4514
4602
|
}
|
|
4515
4603
|
};
|
|
4516
|
-
return /* @__PURE__ */ (0,
|
|
4517
|
-
label && /* @__PURE__ */ (0,
|
|
4518
|
-
/* @__PURE__ */ (0,
|
|
4519
|
-
/* @__PURE__ */ (0,
|
|
4604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
|
|
4605
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
4606
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: wrapperClasses, children: [
|
|
4607
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4520
4608
|
"select",
|
|
4521
4609
|
{
|
|
4522
4610
|
...otherProps,
|
|
@@ -4532,9 +4620,9 @@ var init_Select = __esm({
|
|
|
4532
4620
|
onChange: handleChange
|
|
4533
4621
|
}
|
|
4534
4622
|
),
|
|
4535
|
-
/* @__PURE__ */ (0,
|
|
4623
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Icon, { icon: import_icons11.chevronDown }) })
|
|
4536
4624
|
] }),
|
|
4537
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
4625
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4538
4626
|
] });
|
|
4539
4627
|
};
|
|
4540
4628
|
Select.displayName = "Select";
|
|
@@ -4550,15 +4638,15 @@ var init_Select2 = __esm({
|
|
|
4550
4638
|
});
|
|
4551
4639
|
|
|
4552
4640
|
// src/components/Slider/Slider.tsx
|
|
4553
|
-
var
|
|
4641
|
+
var import_dedupe46, import_react39, import_Slider, import_jsx_runtime56;
|
|
4554
4642
|
var init_Slider = __esm({
|
|
4555
4643
|
"src/components/Slider/Slider.tsx"() {
|
|
4556
4644
|
"use strict";
|
|
4557
4645
|
"use client";
|
|
4558
|
-
|
|
4559
|
-
|
|
4646
|
+
import_dedupe46 = __toESM(require("classnames/dedupe"));
|
|
4647
|
+
import_react39 = require("react");
|
|
4560
4648
|
import_Slider = require("@simplybusiness/mobius/src/components/Slider/Slider.css");
|
|
4561
|
-
|
|
4649
|
+
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4562
4650
|
}
|
|
4563
4651
|
});
|
|
4564
4652
|
|
|
@@ -4571,19 +4659,19 @@ var init_Slider2 = __esm({
|
|
|
4571
4659
|
});
|
|
4572
4660
|
|
|
4573
4661
|
// src/components/SVG/SVG.tsx
|
|
4574
|
-
var
|
|
4662
|
+
var import_react40, import_dedupe47, import_jsx_runtime57, SVG;
|
|
4575
4663
|
var init_SVG = __esm({
|
|
4576
4664
|
"src/components/SVG/SVG.tsx"() {
|
|
4577
4665
|
"use strict";
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4666
|
+
import_react40 = require("react");
|
|
4667
|
+
import_dedupe47 = __toESM(require("classnames/dedupe"));
|
|
4668
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4581
4669
|
SVG = ({ ref, ...props }) => {
|
|
4582
4670
|
const { children, className, ...otherProps } = props;
|
|
4583
|
-
const classes = (0,
|
|
4584
|
-
const svgNode =
|
|
4671
|
+
const classes = (0, import_dedupe47.default)("mobius", "mobius-svg", className);
|
|
4672
|
+
const svgNode = import_react40.Children.only(children);
|
|
4585
4673
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
4586
|
-
return /* @__PURE__ */ (0,
|
|
4674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4587
4675
|
"svg",
|
|
4588
4676
|
{
|
|
4589
4677
|
viewBox,
|
|
@@ -4608,16 +4696,16 @@ var init_SVG2 = __esm({
|
|
|
4608
4696
|
});
|
|
4609
4697
|
|
|
4610
4698
|
// src/components/Switch/Switch.tsx
|
|
4611
|
-
var
|
|
4699
|
+
var import_react41, import_dedupe48, import_Switch, import_jsx_runtime58, Switch;
|
|
4612
4700
|
var init_Switch = __esm({
|
|
4613
4701
|
"src/components/Switch/Switch.tsx"() {
|
|
4614
4702
|
"use strict";
|
|
4615
4703
|
"use client";
|
|
4616
|
-
|
|
4617
|
-
|
|
4704
|
+
import_react41 = require("react");
|
|
4705
|
+
import_dedupe48 = __toESM(require("classnames/dedupe"));
|
|
4618
4706
|
init_VisuallyHidden2();
|
|
4619
4707
|
import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
|
|
4620
|
-
|
|
4708
|
+
import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4621
4709
|
Switch = ({ ref, ...props }) => {
|
|
4622
4710
|
const {
|
|
4623
4711
|
checked = false,
|
|
@@ -4626,11 +4714,11 @@ var init_Switch = __esm({
|
|
|
4626
4714
|
isDisabled = false,
|
|
4627
4715
|
...otherProps
|
|
4628
4716
|
} = props;
|
|
4629
|
-
const [enabled, setEnabled] = (0,
|
|
4630
|
-
(0,
|
|
4717
|
+
const [enabled, setEnabled] = (0, import_react41.useState)(checked);
|
|
4718
|
+
(0, import_react41.useEffect)(() => {
|
|
4631
4719
|
setEnabled(checked);
|
|
4632
4720
|
}, [checked]);
|
|
4633
|
-
const classes = (0,
|
|
4721
|
+
const classes = (0, import_dedupe48.default)(
|
|
4634
4722
|
"mobius",
|
|
4635
4723
|
"mobius-switch",
|
|
4636
4724
|
{
|
|
@@ -4645,9 +4733,9 @@ var init_Switch = __esm({
|
|
|
4645
4733
|
onChange(event);
|
|
4646
4734
|
}
|
|
4647
4735
|
};
|
|
4648
|
-
return /* @__PURE__ */ (0,
|
|
4649
|
-
/* @__PURE__ */ (0,
|
|
4650
|
-
/* @__PURE__ */ (0,
|
|
4736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("label", { ref, className: classes, children: [
|
|
4737
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: enabled ? "On" : "Off" }) }),
|
|
4738
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4651
4739
|
"input",
|
|
4652
4740
|
{
|
|
4653
4741
|
type: "checkbox",
|
|
@@ -4658,7 +4746,7 @@ var init_Switch = __esm({
|
|
|
4658
4746
|
...otherProps
|
|
4659
4747
|
}
|
|
4660
4748
|
),
|
|
4661
|
-
/* @__PURE__ */ (0,
|
|
4749
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "mobius-switch__slider" })
|
|
4662
4750
|
] });
|
|
4663
4751
|
};
|
|
4664
4752
|
Switch.displayName = "Switch";
|
|
@@ -4674,114 +4762,114 @@ var init_Switch2 = __esm({
|
|
|
4674
4762
|
});
|
|
4675
4763
|
|
|
4676
4764
|
// src/components/Table/Table.tsx
|
|
4677
|
-
var
|
|
4765
|
+
var import_dedupe49, import_Table, import_jsx_runtime59, Table;
|
|
4678
4766
|
var init_Table = __esm({
|
|
4679
4767
|
"src/components/Table/Table.tsx"() {
|
|
4680
4768
|
"use strict";
|
|
4681
|
-
|
|
4769
|
+
import_dedupe49 = __toESM(require("classnames/dedupe"));
|
|
4682
4770
|
import_Table = require("@simplybusiness/mobius/src/components/Table/Table.css");
|
|
4683
|
-
|
|
4771
|
+
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4684
4772
|
Table = ({ ref, ...props }) => {
|
|
4685
|
-
const classes = (0,
|
|
4686
|
-
return /* @__PURE__ */ (0,
|
|
4773
|
+
const classes = (0, import_dedupe49.default)("mobius", "mobius-table", props.className);
|
|
4774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("table", { ref, ...props, className: classes });
|
|
4687
4775
|
};
|
|
4688
4776
|
Table.displayName = "Table";
|
|
4689
4777
|
}
|
|
4690
4778
|
});
|
|
4691
4779
|
|
|
4692
4780
|
// src/components/Table/Head.tsx
|
|
4693
|
-
var
|
|
4781
|
+
var import_dedupe50, import_jsx_runtime60, Head;
|
|
4694
4782
|
var init_Head = __esm({
|
|
4695
4783
|
"src/components/Table/Head.tsx"() {
|
|
4696
4784
|
"use strict";
|
|
4697
|
-
|
|
4698
|
-
|
|
4785
|
+
import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
4786
|
+
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4699
4787
|
Head = ({ ref, ...props }) => {
|
|
4700
|
-
const classes = (0,
|
|
4701
|
-
return /* @__PURE__ */ (0,
|
|
4788
|
+
const classes = (0, import_dedupe50.default)("mobius", "mobius-table__head", props.className);
|
|
4789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("thead", { ref, ...props, className: classes });
|
|
4702
4790
|
};
|
|
4703
4791
|
Head.displayName = "Table.Head";
|
|
4704
4792
|
}
|
|
4705
4793
|
});
|
|
4706
4794
|
|
|
4707
4795
|
// src/components/Table/Body.tsx
|
|
4708
|
-
var
|
|
4796
|
+
var import_dedupe51, import_jsx_runtime61, Body;
|
|
4709
4797
|
var init_Body = __esm({
|
|
4710
4798
|
"src/components/Table/Body.tsx"() {
|
|
4711
4799
|
"use strict";
|
|
4712
|
-
|
|
4713
|
-
|
|
4800
|
+
import_dedupe51 = __toESM(require("classnames/dedupe"));
|
|
4801
|
+
import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4714
4802
|
Body = ({ ref, ...props }) => {
|
|
4715
|
-
const classes = (0,
|
|
4716
|
-
return /* @__PURE__ */ (0,
|
|
4803
|
+
const classes = (0, import_dedupe51.default)("mobius", "mobius-table__body", props.className);
|
|
4804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("tbody", { ref, ...props, className: classes });
|
|
4717
4805
|
};
|
|
4718
4806
|
Body.displayName = "Table.Body";
|
|
4719
4807
|
}
|
|
4720
4808
|
});
|
|
4721
4809
|
|
|
4722
4810
|
// src/components/Table/Foot.tsx
|
|
4723
|
-
var
|
|
4811
|
+
var import_dedupe52, import_jsx_runtime62, Foot;
|
|
4724
4812
|
var init_Foot = __esm({
|
|
4725
4813
|
"src/components/Table/Foot.tsx"() {
|
|
4726
4814
|
"use strict";
|
|
4727
|
-
|
|
4728
|
-
|
|
4815
|
+
import_dedupe52 = __toESM(require("classnames/dedupe"));
|
|
4816
|
+
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4729
4817
|
Foot = ({ ref, ...props }) => {
|
|
4730
|
-
const classes = (0,
|
|
4731
|
-
return /* @__PURE__ */ (0,
|
|
4818
|
+
const classes = (0, import_dedupe52.default)("mobius", "mobius-table__foot", props.className);
|
|
4819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tfoot", { ref, ...props, className: classes });
|
|
4732
4820
|
};
|
|
4733
4821
|
Foot.displayName = "Table.Foot";
|
|
4734
4822
|
}
|
|
4735
4823
|
});
|
|
4736
4824
|
|
|
4737
4825
|
// src/components/Table/Row.tsx
|
|
4738
|
-
var
|
|
4826
|
+
var import_dedupe53, import_jsx_runtime63, Row;
|
|
4739
4827
|
var init_Row = __esm({
|
|
4740
4828
|
"src/components/Table/Row.tsx"() {
|
|
4741
4829
|
"use strict";
|
|
4742
|
-
|
|
4743
|
-
|
|
4830
|
+
import_dedupe53 = __toESM(require("classnames/dedupe"));
|
|
4831
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4744
4832
|
Row = ({ ref, ...props }) => {
|
|
4745
|
-
const classes = (0,
|
|
4746
|
-
return /* @__PURE__ */ (0,
|
|
4833
|
+
const classes = (0, import_dedupe53.default)("mobius", "mobius-table__row", props.className);
|
|
4834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("tr", { ref, ...props, className: classes });
|
|
4747
4835
|
};
|
|
4748
4836
|
Row.displayName = "Table.Row";
|
|
4749
4837
|
}
|
|
4750
4838
|
});
|
|
4751
4839
|
|
|
4752
4840
|
// src/components/Table/HeaderCell.tsx
|
|
4753
|
-
var
|
|
4841
|
+
var import_dedupe54, import_jsx_runtime64, HeaderCell;
|
|
4754
4842
|
var init_HeaderCell = __esm({
|
|
4755
4843
|
"src/components/Table/HeaderCell.tsx"() {
|
|
4756
4844
|
"use strict";
|
|
4757
|
-
|
|
4758
|
-
|
|
4845
|
+
import_dedupe54 = __toESM(require("classnames/dedupe"));
|
|
4846
|
+
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4759
4847
|
HeaderCell = ({ ref, ...props }) => {
|
|
4760
|
-
const classes = (0,
|
|
4848
|
+
const classes = (0, import_dedupe54.default)(
|
|
4761
4849
|
"mobius",
|
|
4762
4850
|
"mobius-table__head-cell",
|
|
4763
4851
|
props.className
|
|
4764
4852
|
);
|
|
4765
|
-
return /* @__PURE__ */ (0,
|
|
4853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("th", { ...props, ref, className: classes });
|
|
4766
4854
|
};
|
|
4767
4855
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
4768
4856
|
}
|
|
4769
4857
|
});
|
|
4770
4858
|
|
|
4771
4859
|
// src/components/Table/Cell.tsx
|
|
4772
|
-
var
|
|
4860
|
+
var import_dedupe55, import_jsx_runtime65, Cell;
|
|
4773
4861
|
var init_Cell = __esm({
|
|
4774
4862
|
"src/components/Table/Cell.tsx"() {
|
|
4775
4863
|
"use strict";
|
|
4776
|
-
|
|
4777
|
-
|
|
4864
|
+
import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
4865
|
+
import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4778
4866
|
Cell = ({ ref, ...props }) => {
|
|
4779
|
-
const classes = (0,
|
|
4867
|
+
const classes = (0, import_dedupe55.default)(
|
|
4780
4868
|
"mobius",
|
|
4781
4869
|
"mobius-table__body-cell",
|
|
4782
4870
|
props.className
|
|
4783
4871
|
);
|
|
4784
|
-
return /* @__PURE__ */ (0,
|
|
4872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("td", { ref, ...props, className: classes });
|
|
4785
4873
|
};
|
|
4786
4874
|
Cell.displayName = "Table.Cell";
|
|
4787
4875
|
}
|
|
@@ -4811,37 +4899,6 @@ var init_Table2 = __esm({
|
|
|
4811
4899
|
}
|
|
4812
4900
|
});
|
|
4813
4901
|
|
|
4814
|
-
// src/components/Text/Text.tsx
|
|
4815
|
-
var import_dedupe55, import_Text, import_jsx_runtime64, getElementType, Text;
|
|
4816
|
-
var init_Text = __esm({
|
|
4817
|
-
"src/components/Text/Text.tsx"() {
|
|
4818
|
-
"use strict";
|
|
4819
|
-
import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
4820
|
-
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
4821
|
-
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4822
|
-
getElementType = (variant, elementType) => {
|
|
4823
|
-
if (variant) {
|
|
4824
|
-
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
4825
|
-
}
|
|
4826
|
-
return elementType || "p";
|
|
4827
|
-
};
|
|
4828
|
-
Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
4829
|
-
const { variant, className, spacing, ...otherProps } = props;
|
|
4830
|
-
const elementType = getElementType(variant, Component);
|
|
4831
|
-
const variantType = variant || elementType;
|
|
4832
|
-
const classes = (0, import_dedupe55.default)(
|
|
4833
|
-
"mobius",
|
|
4834
|
-
"mobius-text",
|
|
4835
|
-
{ [`--is-${variantType}`]: variantType },
|
|
4836
|
-
{ [`--has-line-height-${spacing}`]: spacing },
|
|
4837
|
-
className
|
|
4838
|
-
);
|
|
4839
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
4840
|
-
};
|
|
4841
|
-
Text.displayName = "Text";
|
|
4842
|
-
}
|
|
4843
|
-
});
|
|
4844
|
-
|
|
4845
4902
|
// src/components/Text/index.tsx
|
|
4846
4903
|
var init_Text2 = __esm({
|
|
4847
4904
|
"src/components/Text/index.tsx"() {
|
|
@@ -4851,12 +4908,12 @@ var init_Text2 = __esm({
|
|
|
4851
4908
|
});
|
|
4852
4909
|
|
|
4853
4910
|
// src/components/TextAreaInput/TextAreaInput.tsx
|
|
4854
|
-
var import_dedupe56,
|
|
4911
|
+
var import_dedupe56, import_jsx_runtime66, TextAreaInput;
|
|
4855
4912
|
var init_TextAreaInput = __esm({
|
|
4856
4913
|
"src/components/TextAreaInput/TextAreaInput.tsx"() {
|
|
4857
4914
|
"use strict";
|
|
4858
4915
|
import_dedupe56 = __toESM(require("classnames/dedupe"));
|
|
4859
|
-
|
|
4916
|
+
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4860
4917
|
TextAreaInput = ({ ref, ...props }) => {
|
|
4861
4918
|
const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
|
|
4862
4919
|
const classes = (0, import_dedupe56.default)(
|
|
@@ -4869,7 +4926,7 @@ var init_TextAreaInput = __esm({
|
|
|
4869
4926
|
},
|
|
4870
4927
|
otherProps.className
|
|
4871
4928
|
);
|
|
4872
|
-
return /* @__PURE__ */ (0,
|
|
4929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4873
4930
|
"textarea",
|
|
4874
4931
|
{
|
|
4875
4932
|
ref,
|
|
@@ -4893,7 +4950,7 @@ var init_TextAreaInput2 = __esm({
|
|
|
4893
4950
|
});
|
|
4894
4951
|
|
|
4895
4952
|
// src/components/TextArea/TextArea.tsx
|
|
4896
|
-
var import_dedupe57, import_TextArea,
|
|
4953
|
+
var import_dedupe57, import_TextArea, import_jsx_runtime67, TextArea;
|
|
4897
4954
|
var init_TextArea = __esm({
|
|
4898
4955
|
"src/components/TextArea/TextArea.tsx"() {
|
|
4899
4956
|
"use strict";
|
|
@@ -4905,7 +4962,7 @@ var init_TextArea = __esm({
|
|
|
4905
4962
|
init_Stack2();
|
|
4906
4963
|
init_TextAreaInput2();
|
|
4907
4964
|
import_TextArea = require("@simplybusiness/mobius/src/components/TextArea/TextArea.css");
|
|
4908
|
-
|
|
4965
|
+
import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4909
4966
|
TextArea = ({ ref, ...props }) => {
|
|
4910
4967
|
const {
|
|
4911
4968
|
isDisabled,
|
|
@@ -4925,9 +4982,9 @@ var init_TextArea = __esm({
|
|
|
4925
4982
|
},
|
|
4926
4983
|
validationClasses
|
|
4927
4984
|
);
|
|
4928
|
-
return /* @__PURE__ */ (0,
|
|
4929
|
-
label && /* @__PURE__ */ (0,
|
|
4930
|
-
/* @__PURE__ */ (0,
|
|
4985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Stack, { className: classes, gap: "xs", children: [
|
|
4986
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Label, { ...labelProps, className: labelClasses, children: props.label }),
|
|
4987
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4931
4988
|
TextAreaInput,
|
|
4932
4989
|
{
|
|
4933
4990
|
...otherProps,
|
|
@@ -4938,7 +4995,7 @@ var init_TextArea = __esm({
|
|
|
4938
4995
|
"aria-invalid": errorMessage != null
|
|
4939
4996
|
}
|
|
4940
4997
|
),
|
|
4941
|
-
/* @__PURE__ */ (0,
|
|
4998
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
4942
4999
|
] });
|
|
4943
5000
|
};
|
|
4944
5001
|
TextArea.displayName = "TextArea";
|
|
@@ -4953,53 +5010,6 @@ var init_TextArea2 = __esm({
|
|
|
4953
5010
|
}
|
|
4954
5011
|
});
|
|
4955
5012
|
|
|
4956
|
-
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
4957
|
-
var import_react41, import_jsx_runtime67, isHTML, TextOrHTML;
|
|
4958
|
-
var init_TextOrHTML = __esm({
|
|
4959
|
-
"src/components/TextOrHTML/TextOrHTML.tsx"() {
|
|
4960
|
-
"use strict";
|
|
4961
|
-
import_react41 = require("react");
|
|
4962
|
-
init_Text();
|
|
4963
|
-
import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4964
|
-
isHTML = (text) => /^\s*<[a-z]/i.test(text);
|
|
4965
|
-
TextOrHTML = ({
|
|
4966
|
-
ref,
|
|
4967
|
-
text,
|
|
4968
|
-
htmlClassName,
|
|
4969
|
-
htmlElementType,
|
|
4970
|
-
textWrapper = false,
|
|
4971
|
-
autoDetect = false,
|
|
4972
|
-
...textProps
|
|
4973
|
-
}) => {
|
|
4974
|
-
const textIsHTML = autoDetect && isHTML(text);
|
|
4975
|
-
const shouldWrapInText = autoDetect ? textWrapper || !textIsHTML : textWrapper;
|
|
4976
|
-
const resolvedElementType = htmlElementType ?? (textIsHTML ? "div" : "span");
|
|
4977
|
-
const DangerousComponent = resolvedElementType;
|
|
4978
|
-
const dangerousHTML = (0, import_react41.useMemo)(() => ({ __html: text }), [text]);
|
|
4979
|
-
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4980
|
-
DangerousComponent,
|
|
4981
|
-
{
|
|
4982
|
-
className: htmlClassName,
|
|
4983
|
-
dangerouslySetInnerHTML: dangerousHTML
|
|
4984
|
-
}
|
|
4985
|
-
);
|
|
4986
|
-
if (shouldWrapInText) {
|
|
4987
|
-
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
4988
|
-
}
|
|
4989
|
-
return dangerousElement;
|
|
4990
|
-
};
|
|
4991
|
-
TextOrHTML.displayName = "TextOrHTML";
|
|
4992
|
-
}
|
|
4993
|
-
});
|
|
4994
|
-
|
|
4995
|
-
// src/components/TextOrHTML/index.tsx
|
|
4996
|
-
var init_TextOrHTML2 = __esm({
|
|
4997
|
-
"src/components/TextOrHTML/index.tsx"() {
|
|
4998
|
-
"use strict";
|
|
4999
|
-
init_TextOrHTML();
|
|
5000
|
-
}
|
|
5001
|
-
});
|
|
5002
|
-
|
|
5003
5013
|
// src/components/Title/Title.tsx
|
|
5004
5014
|
var import_dedupe58, import_Title, import_jsx_runtime68, Title;
|
|
5005
5015
|
var init_Title = __esm({
|