@simplybusiness/mobius 10.1.1 → 10.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/components/AddressLookup/AddressLookup.js +536 -526
- package/dist/cjs/components/AddressLookup/AddressLookup.js.map +4 -4
- package/dist/cjs/components/AddressLookup/index.js +536 -526
- package/dist/cjs/components/AddressLookup/index.js.map +4 -4
- package/dist/cjs/components/Alert/Alert.js +79 -11
- package/dist/cjs/components/Alert/Alert.js.map +4 -4
- package/dist/cjs/components/Alert/index.js +79 -11
- package/dist/cjs/components/Alert/index.js.map +4 -4
- package/dist/cjs/components/Checkbox/Checkbox.js +502 -492
- package/dist/cjs/components/Checkbox/Checkbox.js.map +4 -4
- package/dist/cjs/components/Checkbox/CheckboxGroup.js +502 -492
- package/dist/cjs/components/Checkbox/CheckboxGroup.js.map +4 -4
- package/dist/cjs/components/Checkbox/index.js +481 -471
- package/dist/cjs/components/Checkbox/index.js.map +4 -4
- package/dist/cjs/components/Combobox/Combobox.js +536 -526
- package/dist/cjs/components/Combobox/Combobox.js.map +4 -4
- package/dist/cjs/components/Combobox/index.js +536 -526
- package/dist/cjs/components/Combobox/index.js.map +4 -4
- package/dist/cjs/components/DateField/DateField.js +523 -513
- package/dist/cjs/components/DateField/DateField.js.map +4 -4
- package/dist/cjs/components/DateField/index.js +523 -513
- package/dist/cjs/components/DateField/index.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js +523 -513
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/index.js +523 -513
- package/dist/cjs/components/ErrorMessage/index.js.map +4 -4
- package/dist/cjs/components/ExpandableText/ExpandableText.js +523 -513
- package/dist/cjs/components/ExpandableText/ExpandableText.js.map +4 -4
- package/dist/cjs/components/ExpandableText/index.js +523 -513
- package/dist/cjs/components/ExpandableText/index.js.map +4 -4
- package/dist/cjs/components/MaskedField/MaskedField.js +533 -523
- package/dist/cjs/components/MaskedField/MaskedField.js.map +4 -4
- package/dist/cjs/components/MaskedField/index.js +533 -523
- package/dist/cjs/components/MaskedField/index.js.map +4 -4
- package/dist/cjs/components/NumberField/NumberField.js +524 -514
- package/dist/cjs/components/NumberField/NumberField.js.map +4 -4
- package/dist/cjs/components/NumberField/index.js +524 -514
- package/dist/cjs/components/NumberField/index.js.map +4 -4
- package/dist/cjs/components/PasswordField/PasswordField.js +520 -510
- package/dist/cjs/components/PasswordField/PasswordField.js.map +4 -4
- package/dist/cjs/components/PasswordField/ShowHideButton.js +519 -509
- package/dist/cjs/components/PasswordField/ShowHideButton.js.map +4 -4
- package/dist/cjs/components/PasswordField/index.js +520 -510
- package/dist/cjs/components/PasswordField/index.js.map +4 -4
- package/dist/cjs/components/Radio/Radio.js +502 -492
- package/dist/cjs/components/Radio/Radio.js.map +4 -4
- package/dist/cjs/components/Radio/RadioGroup.js +501 -491
- package/dist/cjs/components/Radio/RadioGroup.js.map +4 -4
- package/dist/cjs/components/Radio/index.js +480 -470
- package/dist/cjs/components/Radio/index.js.map +4 -4
- package/dist/cjs/components/Select/Select.js +507 -497
- package/dist/cjs/components/Select/Select.js.map +4 -4
- package/dist/cjs/components/Select/index.js +507 -497
- package/dist/cjs/components/Select/index.js.map +4 -4
- package/dist/cjs/components/TextArea/TextArea.js +517 -507
- package/dist/cjs/components/TextArea/TextArea.js.map +4 -4
- package/dist/cjs/components/TextArea/index.js +517 -507
- package/dist/cjs/components/TextArea/index.js.map +4 -4
- package/dist/cjs/components/TextField/TextField.js +533 -523
- package/dist/cjs/components/TextField/TextField.js.map +4 -4
- package/dist/cjs/components/TextField/index.js +533 -523
- package/dist/cjs/components/TextField/index.js.map +4 -4
- package/dist/cjs/components/index.js +563 -553
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/index.js +563 -553
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/meta.json +1340 -1273
- package/dist/esm/{chunk-FTSJNY4J.js → chunk-N5WGQAHM.js} +14 -2
- package/dist/esm/chunk-N5WGQAHM.js.map +7 -0
- package/dist/esm/{chunk-C4BILMFX.js → chunk-PB2OICEB.js} +1 -1
- package/dist/esm/components/AddressLookup/AddressLookup.js +2 -2
- package/dist/esm/components/AddressLookup/index.js +2 -2
- package/dist/esm/components/Alert/Alert.js +4 -1
- package/dist/esm/components/Alert/index.js +4 -1
- package/dist/esm/components/Checkbox/Checkbox.js +2 -2
- package/dist/esm/components/Checkbox/CheckboxGroup.js +2 -2
- package/dist/esm/components/Checkbox/index.js +2 -2
- package/dist/esm/components/Combobox/Combobox.js +2 -2
- package/dist/esm/components/Combobox/index.js +2 -2
- package/dist/esm/components/DateField/DateField.js +2 -2
- package/dist/esm/components/DateField/index.js +2 -2
- package/dist/esm/components/ErrorMessage/ErrorMessage.js +2 -2
- package/dist/esm/components/ErrorMessage/index.js +2 -2
- package/dist/esm/components/ExpandableText/ExpandableText.js +2 -2
- package/dist/esm/components/ExpandableText/index.js +2 -2
- package/dist/esm/components/MaskedField/MaskedField.js +2 -2
- package/dist/esm/components/MaskedField/index.js +2 -2
- package/dist/esm/components/NumberField/NumberField.js +2 -2
- package/dist/esm/components/NumberField/index.js +2 -2
- package/dist/esm/components/PasswordField/PasswordField.js +2 -2
- package/dist/esm/components/PasswordField/ShowHideButton.js +2 -2
- package/dist/esm/components/PasswordField/index.js +2 -2
- package/dist/esm/components/Radio/Radio.js +2 -2
- package/dist/esm/components/Radio/RadioGroup.js +2 -2
- package/dist/esm/components/Radio/index.js +2 -2
- package/dist/esm/components/Select/Select.js +2 -2
- package/dist/esm/components/Select/index.js +2 -2
- package/dist/esm/components/TextArea/TextArea.js +2 -2
- package/dist/esm/components/TextArea/index.js +2 -2
- package/dist/esm/components/TextField/TextField.js +2 -2
- package/dist/esm/components/TextField/index.js +2 -2
- package/dist/esm/components/index.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/meta.json +160 -127
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/Alert/Alert.tsx +10 -1
- package/dist/esm/chunk-FTSJNY4J.js.map +0 -7
- /package/dist/esm/{chunk-C4BILMFX.js.map → chunk-PB2OICEB.js.map} +0 -0
|
@@ -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,13 +2595,13 @@ var init_Button2 = __esm({
|
|
|
2507
2595
|
});
|
|
2508
2596
|
|
|
2509
2597
|
// src/components/Checkbox/Checkbox.tsx
|
|
2510
|
-
var
|
|
2598
|
+
var import_react18, import_dedupe20, import_icons6, import_Checkbox, import_jsx_runtime24, Checkbox;
|
|
2511
2599
|
var init_Checkbox = __esm({
|
|
2512
2600
|
"src/components/Checkbox/Checkbox.tsx"() {
|
|
2513
2601
|
"use strict";
|
|
2514
2602
|
"use client";
|
|
2515
|
-
|
|
2516
|
-
|
|
2603
|
+
import_react18 = require("react");
|
|
2604
|
+
import_dedupe20 = __toESM(require("classnames/dedupe"));
|
|
2517
2605
|
import_icons6 = require("@simplybusiness/icons");
|
|
2518
2606
|
init_ErrorMessage2();
|
|
2519
2607
|
init_spaceDelimitedList();
|
|
@@ -2521,7 +2609,7 @@ var init_Checkbox = __esm({
|
|
|
2521
2609
|
init_Icon2();
|
|
2522
2610
|
init_Stack2();
|
|
2523
2611
|
import_Checkbox = require("@simplybusiness/mobius/src/components/Checkbox/Checkbox.css");
|
|
2524
|
-
|
|
2612
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2525
2613
|
Checkbox = ({ ref, ...props }) => {
|
|
2526
2614
|
const {
|
|
2527
2615
|
id,
|
|
@@ -2541,18 +2629,18 @@ var init_Checkbox = __esm({
|
|
|
2541
2629
|
["aria-describedby"]: ariaDescribedBy,
|
|
2542
2630
|
...rest
|
|
2543
2631
|
} = props;
|
|
2544
|
-
const [checked, setChecked] = (0,
|
|
2545
|
-
const fallbackRef = (0,
|
|
2632
|
+
const [checked, setChecked] = (0, import_react18.useState)(defaultSelected);
|
|
2633
|
+
const fallbackRef = (0, import_react18.useRef)(null);
|
|
2546
2634
|
const refObj = ref || fallbackRef;
|
|
2547
|
-
const inputId = (0,
|
|
2635
|
+
const inputId = (0, import_react18.useId)();
|
|
2548
2636
|
const isControlled = typeof selected === "boolean";
|
|
2549
|
-
(0,
|
|
2637
|
+
(0, import_react18.useEffect)(() => {
|
|
2550
2638
|
if (isControlled) {
|
|
2551
2639
|
setChecked(selected);
|
|
2552
2640
|
}
|
|
2553
2641
|
}, [selected, isControlled]);
|
|
2554
2642
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2555
|
-
const sharedClasses = (0,
|
|
2643
|
+
const sharedClasses = (0, import_dedupe20.default)(
|
|
2556
2644
|
{
|
|
2557
2645
|
"--is-disabled": isDisabled,
|
|
2558
2646
|
"--is-selected": checked,
|
|
@@ -2561,31 +2649,31 @@ var init_Checkbox = __esm({
|
|
|
2561
2649
|
},
|
|
2562
2650
|
validationClasses
|
|
2563
2651
|
);
|
|
2564
|
-
const wrapperClasses = (0,
|
|
2652
|
+
const wrapperClasses = (0, import_dedupe20.default)(
|
|
2565
2653
|
"mobius",
|
|
2566
2654
|
"mobius-checkbox",
|
|
2567
2655
|
sharedClasses,
|
|
2568
2656
|
className
|
|
2569
2657
|
);
|
|
2570
|
-
const labelClasses = (0,
|
|
2571
|
-
const inputClasses = (0,
|
|
2572
|
-
const iconClasses = (0,
|
|
2573
|
-
const errorMessageId = (0,
|
|
2658
|
+
const labelClasses = (0, import_dedupe20.default)("mobius-checkbox__label", sharedClasses);
|
|
2659
|
+
const inputClasses = (0, import_dedupe20.default)("mobius-checkbox__input", sharedClasses);
|
|
2660
|
+
const iconClasses = (0, import_dedupe20.default)("mobius-checkbox__icon", sharedClasses);
|
|
2661
|
+
const errorMessageId = (0, import_react18.useId)();
|
|
2574
2662
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2575
2663
|
const describedBy = spaceDelimitedList([
|
|
2576
2664
|
shouldErrorMessageShow,
|
|
2577
2665
|
ariaDescribedBy
|
|
2578
2666
|
]);
|
|
2579
|
-
const labelId = (0,
|
|
2667
|
+
const labelId = (0, import_react18.useId)();
|
|
2580
2668
|
const handleChange = (event) => {
|
|
2581
2669
|
setChecked(!checked);
|
|
2582
2670
|
if (onChange) {
|
|
2583
2671
|
onChange(event, isLastItem);
|
|
2584
2672
|
}
|
|
2585
2673
|
};
|
|
2586
|
-
return /* @__PURE__ */ (0,
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Stack, { gap: "xs", className: wrapperClasses, children: [
|
|
2675
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: labelClasses, children: [
|
|
2676
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2589
2677
|
"input",
|
|
2590
2678
|
{
|
|
2591
2679
|
"aria-describedby": describedBy,
|
|
@@ -2606,7 +2694,7 @@ var init_Checkbox = __esm({
|
|
|
2606
2694
|
...rest
|
|
2607
2695
|
}
|
|
2608
2696
|
),
|
|
2609
|
-
/* @__PURE__ */ (0,
|
|
2697
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2610
2698
|
Icon,
|
|
2611
2699
|
{
|
|
2612
2700
|
icon: checked ? import_icons6.squareTick : import_icons6.square,
|
|
@@ -2614,9 +2702,9 @@ var init_Checkbox = __esm({
|
|
|
2614
2702
|
className: iconClasses
|
|
2615
2703
|
}
|
|
2616
2704
|
),
|
|
2617
|
-
/* @__PURE__ */ (0,
|
|
2705
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { id: labelId, className: "mobius-checkbox__visible-label", children: label })
|
|
2618
2706
|
] }),
|
|
2619
|
-
/* @__PURE__ */ (0,
|
|
2707
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2620
2708
|
] });
|
|
2621
2709
|
};
|
|
2622
2710
|
Checkbox.displayName = "Checkbox";
|
|
@@ -2641,23 +2729,23 @@ var init_Checkbox2 = __esm({
|
|
|
2641
2729
|
});
|
|
2642
2730
|
|
|
2643
2731
|
// src/components/Container/Container.tsx
|
|
2644
|
-
var
|
|
2732
|
+
var import_dedupe21, import_Container, import_jsx_runtime25, Container;
|
|
2645
2733
|
var init_Container = __esm({
|
|
2646
2734
|
"src/components/Container/Container.tsx"() {
|
|
2647
2735
|
"use strict";
|
|
2648
|
-
|
|
2736
|
+
import_dedupe21 = __toESM(require("classnames/dedupe"));
|
|
2649
2737
|
init_utils();
|
|
2650
2738
|
import_Container = require("@simplybusiness/mobius/src/components/Container/Container.css");
|
|
2651
|
-
|
|
2739
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2652
2740
|
Container = ({ ref, ...props }) => {
|
|
2653
2741
|
const { elementType: Element = "div", size = "md", ...otherProps } = props;
|
|
2654
|
-
const classes = (0,
|
|
2742
|
+
const classes = (0, import_dedupe21.default)(
|
|
2655
2743
|
"mobius",
|
|
2656
2744
|
"mobius-container",
|
|
2657
2745
|
sizeClasses(size),
|
|
2658
2746
|
otherProps.className
|
|
2659
2747
|
);
|
|
2660
|
-
return /* @__PURE__ */ (0,
|
|
2748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
2661
2749
|
};
|
|
2662
2750
|
Container.displayName = "Container";
|
|
2663
2751
|
}
|
|
@@ -2710,17 +2798,17 @@ var init_validation = __esm({
|
|
|
2710
2798
|
});
|
|
2711
2799
|
|
|
2712
2800
|
// src/components/DateField/DateField.tsx
|
|
2713
|
-
var
|
|
2801
|
+
var import_dedupe22, import_react19, import_jsx_runtime26, MIN_MAX_ERROR, DateField;
|
|
2714
2802
|
var init_DateField = __esm({
|
|
2715
2803
|
"src/components/DateField/DateField.tsx"() {
|
|
2716
2804
|
"use strict";
|
|
2717
2805
|
"use client";
|
|
2718
|
-
|
|
2719
|
-
|
|
2806
|
+
import_dedupe22 = __toESM(require("classnames/dedupe"));
|
|
2807
|
+
import_react19 = require("react");
|
|
2720
2808
|
init_mergeRefs();
|
|
2721
2809
|
init_TextField2();
|
|
2722
2810
|
init_validation();
|
|
2723
|
-
|
|
2811
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2724
2812
|
MIN_MAX_ERROR = '"min" value should not be greater than "max" value.';
|
|
2725
2813
|
DateField = ({ ref, ...props }) => {
|
|
2726
2814
|
const {
|
|
@@ -2733,10 +2821,10 @@ var init_DateField = __esm({
|
|
|
2733
2821
|
value,
|
|
2734
2822
|
...otherProps
|
|
2735
2823
|
} = props;
|
|
2736
|
-
const [error3, setError] = (0,
|
|
2737
|
-
const [isInvalid, setIsInvalid] = (0,
|
|
2738
|
-
const localRef = (0,
|
|
2739
|
-
const classes = (0,
|
|
2824
|
+
const [error3, setError] = (0, import_react19.useState)(errorMessage);
|
|
2825
|
+
const [isInvalid, setIsInvalid] = (0, import_react19.useState)(void 0);
|
|
2826
|
+
const localRef = (0, import_react19.useRef)(null);
|
|
2827
|
+
const classes = (0, import_dedupe22.default)("mobius-date-field", className);
|
|
2740
2828
|
const formattedMin = min ? convertToDateFormat(min, format) : void 0;
|
|
2741
2829
|
const formattedMax = max ? convertToDateFormat(max, format) : void 0;
|
|
2742
2830
|
const formattedDefaultValue = defaultValue ? convertToDateFormat(defaultValue, format) : void 0;
|
|
@@ -2749,7 +2837,7 @@ var init_DateField = __esm({
|
|
|
2749
2837
|
setError(props.errorMessage);
|
|
2750
2838
|
setIsInvalid(false);
|
|
2751
2839
|
};
|
|
2752
|
-
(0,
|
|
2840
|
+
(0, import_react19.useEffect)(() => {
|
|
2753
2841
|
if (!isValidDate(min, format)) {
|
|
2754
2842
|
setInvalidState(`Invalid min date: ${min}`);
|
|
2755
2843
|
return;
|
|
@@ -2782,7 +2870,7 @@ var init_DateField = __esm({
|
|
|
2782
2870
|
validate();
|
|
2783
2871
|
otherProps.onBlur?.(event);
|
|
2784
2872
|
};
|
|
2785
|
-
return /* @__PURE__ */ (0,
|
|
2873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2786
2874
|
TextField,
|
|
2787
2875
|
{
|
|
2788
2876
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -2813,23 +2901,23 @@ var init_DateField2 = __esm({
|
|
|
2813
2901
|
});
|
|
2814
2902
|
|
|
2815
2903
|
// src/components/Drawer/Content.tsx
|
|
2816
|
-
var
|
|
2904
|
+
var import_jsx_runtime27, Content;
|
|
2817
2905
|
var init_Content = __esm({
|
|
2818
2906
|
"src/components/Drawer/Content.tsx"() {
|
|
2819
2907
|
"use strict";
|
|
2820
|
-
|
|
2821
|
-
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
2908
|
+
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2909
|
+
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, ...otherProps, className: "mobius-drawer__content", children });
|
|
2822
2910
|
Content.displayName = "Content";
|
|
2823
2911
|
}
|
|
2824
2912
|
});
|
|
2825
2913
|
|
|
2826
2914
|
// src/components/Drawer/DrawerContext.tsx
|
|
2827
|
-
var
|
|
2915
|
+
var import_react20, DrawerContext;
|
|
2828
2916
|
var init_DrawerContext = __esm({
|
|
2829
2917
|
"src/components/Drawer/DrawerContext.tsx"() {
|
|
2830
2918
|
"use strict";
|
|
2831
|
-
|
|
2832
|
-
DrawerContext = (0,
|
|
2919
|
+
import_react20 = require("react");
|
|
2920
|
+
DrawerContext = (0, import_react20.createContext)({
|
|
2833
2921
|
onClose: () => {
|
|
2834
2922
|
},
|
|
2835
2923
|
closeLabel: void 0,
|
|
@@ -2839,19 +2927,19 @@ var init_DrawerContext = __esm({
|
|
|
2839
2927
|
});
|
|
2840
2928
|
|
|
2841
2929
|
// src/components/Drawer/Drawer.tsx
|
|
2842
|
-
var
|
|
2930
|
+
var import_dedupe23, import_react21, import_Drawer, import_jsx_runtime28, TRANSITION_CSS_VARIABLE, Drawer;
|
|
2843
2931
|
var init_Drawer = __esm({
|
|
2844
2932
|
"src/components/Drawer/Drawer.tsx"() {
|
|
2845
2933
|
"use strict";
|
|
2846
2934
|
"use client";
|
|
2847
|
-
|
|
2848
|
-
|
|
2935
|
+
import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
2936
|
+
import_react21 = require("react");
|
|
2849
2937
|
init_hooks();
|
|
2850
2938
|
init_utils();
|
|
2851
2939
|
init_VisuallyHidden2();
|
|
2852
2940
|
init_DrawerContext();
|
|
2853
2941
|
import_Drawer = require("@simplybusiness/mobius/src/components/Drawer/Drawer.css");
|
|
2854
|
-
|
|
2942
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2855
2943
|
TRANSITION_CSS_VARIABLE = "--drawer-transition-duration";
|
|
2856
2944
|
Drawer = ({ ref, ...props }) => {
|
|
2857
2945
|
const {
|
|
@@ -2864,8 +2952,8 @@ var init_Drawer = __esm({
|
|
|
2864
2952
|
onClose,
|
|
2865
2953
|
children
|
|
2866
2954
|
} = props;
|
|
2867
|
-
const dialogRef = (0,
|
|
2868
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
2955
|
+
const dialogRef = (0, import_react21.useRef)(null);
|
|
2956
|
+
const [shouldTransition, setShouldTransition] = (0, import_react21.useState)(false);
|
|
2869
2957
|
const { close } = useDialog({
|
|
2870
2958
|
ref: dialogRef,
|
|
2871
2959
|
isOpen,
|
|
@@ -2876,9 +2964,9 @@ var init_Drawer = __esm({
|
|
|
2876
2964
|
CSSVariable: TRANSITION_CSS_VARIABLE
|
|
2877
2965
|
}
|
|
2878
2966
|
});
|
|
2879
|
-
const hiddenId = `dialog-screen-reader-announce-${(0,
|
|
2880
|
-
const headerId = `dialog-header-${(0,
|
|
2881
|
-
const dialogClasses = (0,
|
|
2967
|
+
const hiddenId = `dialog-screen-reader-announce-${(0, import_react21.useId)()}`;
|
|
2968
|
+
const headerId = `dialog-header-${(0, import_react21.useId)()}`;
|
|
2969
|
+
const dialogClasses = (0, import_dedupe23.default)(
|
|
2882
2970
|
"mobius",
|
|
2883
2971
|
"mobius-drawer",
|
|
2884
2972
|
`--${direction}`,
|
|
@@ -2887,10 +2975,10 @@ var init_Drawer = __esm({
|
|
|
2887
2975
|
"--should-transition": shouldTransition
|
|
2888
2976
|
}
|
|
2889
2977
|
);
|
|
2890
|
-
(0,
|
|
2978
|
+
(0, import_react21.useEffect)(() => {
|
|
2891
2979
|
setShouldTransition(supportsDialog());
|
|
2892
2980
|
}, []);
|
|
2893
|
-
const contextValue = (0,
|
|
2981
|
+
const contextValue = (0, import_react21.useMemo)(
|
|
2894
2982
|
() => ({
|
|
2895
2983
|
onClose: close,
|
|
2896
2984
|
closeLabel,
|
|
@@ -2898,18 +2986,18 @@ var init_Drawer = __esm({
|
|
|
2898
2986
|
}),
|
|
2899
2987
|
[close, closeLabel, headerId]
|
|
2900
2988
|
);
|
|
2901
|
-
return /* @__PURE__ */ (0,
|
|
2989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2902
2990
|
"dialog",
|
|
2903
2991
|
{
|
|
2904
|
-
id: (0,
|
|
2992
|
+
id: (0, import_react21.useId)(),
|
|
2905
2993
|
ref: mergeRefs([dialogRef, ref]),
|
|
2906
2994
|
onCancel: close,
|
|
2907
2995
|
className: dialogClasses,
|
|
2908
2996
|
"aria-describedby": hiddenId,
|
|
2909
2997
|
"aria-labelledby": headerId,
|
|
2910
2998
|
children: [
|
|
2911
|
-
/* @__PURE__ */ (0,
|
|
2912
|
-
/* @__PURE__ */ (0,
|
|
2999
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { id: hiddenId, children: announce }) }),
|
|
3000
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DrawerContext.Provider, { value: contextValue, children })
|
|
2913
3001
|
]
|
|
2914
3002
|
}
|
|
2915
3003
|
);
|
|
@@ -2919,21 +3007,21 @@ var init_Drawer = __esm({
|
|
|
2919
3007
|
});
|
|
2920
3008
|
|
|
2921
3009
|
// src/components/Drawer/useDrawer.ts
|
|
2922
|
-
var
|
|
3010
|
+
var import_react22, useDrawer;
|
|
2923
3011
|
var init_useDrawer = __esm({
|
|
2924
3012
|
"src/components/Drawer/useDrawer.ts"() {
|
|
2925
3013
|
"use strict";
|
|
2926
|
-
|
|
3014
|
+
import_react22 = require("react");
|
|
2927
3015
|
init_DrawerContext();
|
|
2928
3016
|
useDrawer = () => {
|
|
2929
|
-
const { onClose, closeLabel, headerId } = (0,
|
|
3017
|
+
const { onClose, closeLabel, headerId } = (0, import_react22.useContext)(DrawerContext);
|
|
2930
3018
|
return { onClose, closeLabel, headerId };
|
|
2931
3019
|
};
|
|
2932
3020
|
}
|
|
2933
3021
|
});
|
|
2934
3022
|
|
|
2935
3023
|
// src/components/Drawer/Header.tsx
|
|
2936
|
-
var import_icons7,
|
|
3024
|
+
var import_icons7, import_jsx_runtime29, Header;
|
|
2937
3025
|
var init_Header = __esm({
|
|
2938
3026
|
"src/components/Drawer/Header.tsx"() {
|
|
2939
3027
|
"use strict";
|
|
@@ -2941,12 +3029,12 @@ var init_Header = __esm({
|
|
|
2941
3029
|
init_Button2();
|
|
2942
3030
|
init_Icon2();
|
|
2943
3031
|
init_useDrawer();
|
|
2944
|
-
|
|
3032
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2945
3033
|
Header = ({ ref, children, ...otherProps }) => {
|
|
2946
3034
|
const { onClose, closeLabel, headerId } = useDrawer();
|
|
2947
|
-
return /* @__PURE__ */ (0,
|
|
2948
|
-
/* @__PURE__ */ (0,
|
|
2949
|
-
/* @__PURE__ */ (0,
|
|
3035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("header", { ref, ...otherProps, className: "mobius-drawer__header", children: [
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h2", { id: headerId, children }),
|
|
3037
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2950
3038
|
Button,
|
|
2951
3039
|
{
|
|
2952
3040
|
"aria-label": "Close",
|
|
@@ -2955,7 +3043,7 @@ var init_Header = __esm({
|
|
|
2955
3043
|
className: "mobius-drawer__close",
|
|
2956
3044
|
size: "sm",
|
|
2957
3045
|
children: [
|
|
2958
|
-
/* @__PURE__ */ (0,
|
|
3046
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { icon: import_icons7.cross }),
|
|
2959
3047
|
" ",
|
|
2960
3048
|
closeLabel
|
|
2961
3049
|
]
|
|
@@ -2984,17 +3072,17 @@ var init_Drawer2 = __esm({
|
|
|
2984
3072
|
});
|
|
2985
3073
|
|
|
2986
3074
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2987
|
-
var
|
|
3075
|
+
var import_react23, import_react_accessible_dropdown_menu_hook, import_dedupe24, import_DropdownMenu, import_jsx_runtime30, DropdownMenu;
|
|
2988
3076
|
var init_DropdownMenu = __esm({
|
|
2989
3077
|
"src/components/DropdownMenu/DropdownMenu.tsx"() {
|
|
2990
3078
|
"use strict";
|
|
2991
3079
|
"use client";
|
|
2992
|
-
|
|
3080
|
+
import_react23 = require("react");
|
|
2993
3081
|
import_react_accessible_dropdown_menu_hook = __toESM(require("react-accessible-dropdown-menu-hook"));
|
|
2994
|
-
|
|
3082
|
+
import_dedupe24 = __toESM(require("classnames/dedupe"));
|
|
2995
3083
|
init_Button2();
|
|
2996
3084
|
import_DropdownMenu = require("@simplybusiness/mobius/src/components/DropdownMenu/DropdownMenu.css");
|
|
2997
|
-
|
|
3085
|
+
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2998
3086
|
DropdownMenu = ({ ref, ...props }) => {
|
|
2999
3087
|
const {
|
|
3000
3088
|
elementType: Element = "nav",
|
|
@@ -3003,21 +3091,21 @@ var init_DropdownMenu = __esm({
|
|
|
3003
3091
|
children,
|
|
3004
3092
|
...otherProps
|
|
3005
3093
|
} = props;
|
|
3006
|
-
const [activeId, setActiveId] = (0,
|
|
3007
|
-
const numberOfItems =
|
|
3094
|
+
const [activeId, setActiveId] = (0, import_react23.useState)(null);
|
|
3095
|
+
const numberOfItems = import_react23.Children.count(children);
|
|
3008
3096
|
const {
|
|
3009
3097
|
buttonProps,
|
|
3010
3098
|
itemProps,
|
|
3011
3099
|
isOpen: open,
|
|
3012
3100
|
setIsOpen
|
|
3013
3101
|
} = (0, import_react_accessible_dropdown_menu_hook.default)(numberOfItems);
|
|
3014
|
-
const classes = (0,
|
|
3102
|
+
const classes = (0, import_dedupe24.default)(
|
|
3015
3103
|
"mobius",
|
|
3016
3104
|
"mobius-dropdown-menu",
|
|
3017
3105
|
otherProps.className
|
|
3018
3106
|
);
|
|
3019
|
-
const triggerClasses = (0,
|
|
3020
|
-
const listClasses = (0,
|
|
3107
|
+
const triggerClasses = (0, import_dedupe24.default)("mobius", "mobius-dropdown-menu__trigger");
|
|
3108
|
+
const listClasses = (0, import_dedupe24.default)("mobius", "mobius-dropdown-menu__list", {
|
|
3021
3109
|
"--is-open": open
|
|
3022
3110
|
});
|
|
3023
3111
|
const handleChildClick = ({ onClick }, index) => {
|
|
@@ -3027,16 +3115,16 @@ var init_DropdownMenu = __esm({
|
|
|
3027
3115
|
onClick();
|
|
3028
3116
|
}
|
|
3029
3117
|
};
|
|
3030
|
-
return /* @__PURE__ */ (0,
|
|
3031
|
-
trigger ? (0,
|
|
3118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Element, { ref, ...otherProps, className: classes, children: [
|
|
3119
|
+
trigger ? (0, import_react23.cloneElement)(trigger, {
|
|
3032
3120
|
className: triggerClasses,
|
|
3033
3121
|
open,
|
|
3034
3122
|
label,
|
|
3035
3123
|
...buttonProps
|
|
3036
|
-
}) : /* @__PURE__ */ (0,
|
|
3037
|
-
/* @__PURE__ */ (0,
|
|
3038
|
-
if ((0,
|
|
3039
|
-
return (0,
|
|
3124
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
3125
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ul", { className: listClasses, role: "menu", children: import_react23.Children.map(children, (child, index) => {
|
|
3126
|
+
if ((0, import_react23.isValidElement)(child)) {
|
|
3127
|
+
return (0, import_react23.cloneElement)(child, {
|
|
3040
3128
|
onClick: () => handleChildClick(child.props, index),
|
|
3041
3129
|
active: index === activeId,
|
|
3042
3130
|
...itemProps[index]
|
|
@@ -3051,13 +3139,13 @@ var init_DropdownMenu = __esm({
|
|
|
3051
3139
|
});
|
|
3052
3140
|
|
|
3053
3141
|
// src/components/DropdownMenu/Item.tsx
|
|
3054
|
-
var
|
|
3142
|
+
var import_react24, import_dedupe25, import_jsx_runtime31, Item;
|
|
3055
3143
|
var init_Item = __esm({
|
|
3056
3144
|
"src/components/DropdownMenu/Item.tsx"() {
|
|
3057
3145
|
"use strict";
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3146
|
+
import_react24 = require("react");
|
|
3147
|
+
import_dedupe25 = __toESM(require("classnames/dedupe"));
|
|
3148
|
+
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3061
3149
|
Item = ({ ref, ...props }) => {
|
|
3062
3150
|
const {
|
|
3063
3151
|
elementType: Element = "li",
|
|
@@ -3066,26 +3154,26 @@ var init_Item = __esm({
|
|
|
3066
3154
|
children,
|
|
3067
3155
|
...otherProps
|
|
3068
3156
|
} = props;
|
|
3069
|
-
const classes = (0,
|
|
3157
|
+
const classes = (0, import_dedupe25.default)(
|
|
3070
3158
|
"mobius",
|
|
3071
3159
|
"mobius-dropdown-menu__item",
|
|
3072
3160
|
{ "--is-active": active },
|
|
3073
3161
|
otherProps.className
|
|
3074
3162
|
);
|
|
3075
|
-
return /* @__PURE__ */ (0,
|
|
3076
|
-
if ((0,
|
|
3077
|
-
const childClasses = (0,
|
|
3163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Element, { ref, onClick, ...otherProps, children: import_react24.Children.map(children, (child) => {
|
|
3164
|
+
if ((0, import_react24.isValidElement)(child)) {
|
|
3165
|
+
const childClasses = (0, import_dedupe25.default)(
|
|
3078
3166
|
child.props.className,
|
|
3079
3167
|
classes
|
|
3080
3168
|
);
|
|
3081
|
-
return (0,
|
|
3169
|
+
return (0, import_react24.cloneElement)(
|
|
3082
3170
|
child,
|
|
3083
3171
|
{
|
|
3084
3172
|
className: childClasses
|
|
3085
3173
|
}
|
|
3086
3174
|
);
|
|
3087
3175
|
}
|
|
3088
|
-
return /* @__PURE__ */ (0,
|
|
3176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: classes, children: child });
|
|
3089
3177
|
}) });
|
|
3090
3178
|
};
|
|
3091
3179
|
Item.displayName = "DropdownMenu.Item";
|
|
@@ -3110,23 +3198,23 @@ var init_DropdownMenu2 = __esm({
|
|
|
3110
3198
|
});
|
|
3111
3199
|
|
|
3112
3200
|
// src/components/Fieldset/Fieldset.tsx
|
|
3113
|
-
var
|
|
3201
|
+
var import_dedupe26, import_react25, import_Fieldset, import_jsx_runtime32, useFieldset, Fieldset;
|
|
3114
3202
|
var init_Fieldset = __esm({
|
|
3115
3203
|
"src/components/Fieldset/Fieldset.tsx"() {
|
|
3116
3204
|
"use strict";
|
|
3117
3205
|
"use client";
|
|
3118
|
-
|
|
3119
|
-
|
|
3206
|
+
import_dedupe26 = __toESM(require("classnames/dedupe"));
|
|
3207
|
+
import_react25 = require("react");
|
|
3120
3208
|
init_Flex2();
|
|
3121
3209
|
import_Fieldset = require("@simplybusiness/mobius/src/components/Fieldset/Fieldset.css");
|
|
3122
|
-
|
|
3210
|
+
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3123
3211
|
useFieldset = (props) => {
|
|
3124
3212
|
const { legend } = props;
|
|
3125
3213
|
let legendProps = {};
|
|
3126
3214
|
let containerProps = {
|
|
3127
3215
|
role: "group"
|
|
3128
3216
|
};
|
|
3129
|
-
const legendId = (0,
|
|
3217
|
+
const legendId = (0, import_react25.useId)();
|
|
3130
3218
|
if (legend) {
|
|
3131
3219
|
legendProps = {
|
|
3132
3220
|
...legendProps,
|
|
@@ -3146,14 +3234,14 @@ var init_Fieldset = __esm({
|
|
|
3146
3234
|
const {
|
|
3147
3235
|
children,
|
|
3148
3236
|
legend,
|
|
3149
|
-
legendComponent = /* @__PURE__ */ (0,
|
|
3237
|
+
legendComponent = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("legend", {}),
|
|
3150
3238
|
...otherProps
|
|
3151
3239
|
} = props;
|
|
3152
3240
|
const { legendProps, containerProps } = useFieldset(props);
|
|
3153
|
-
const classes = (0,
|
|
3241
|
+
const classes = (0, import_dedupe26.default)("mobius", "mobius-fieldset", props.className);
|
|
3154
3242
|
legendProps.className = "mobius-fieldset__legend";
|
|
3155
|
-
return /* @__PURE__ */ (0,
|
|
3156
|
-
legend && (0,
|
|
3243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
3244
|
+
legend && (0, import_react25.cloneElement)(legendComponent, { ...legendProps }, [legend]),
|
|
3157
3245
|
children
|
|
3158
3246
|
] });
|
|
3159
3247
|
};
|
|
@@ -3170,13 +3258,13 @@ var init_Fieldset2 = __esm({
|
|
|
3170
3258
|
});
|
|
3171
3259
|
|
|
3172
3260
|
// src/components/Grid/Grid.tsx
|
|
3173
|
-
var
|
|
3261
|
+
var import_dedupe27, import_jsx_runtime33, Grid;
|
|
3174
3262
|
var init_Grid = __esm({
|
|
3175
3263
|
"src/components/Grid/Grid.tsx"() {
|
|
3176
3264
|
"use strict";
|
|
3177
|
-
|
|
3265
|
+
import_dedupe27 = __toESM(require("classnames/dedupe"));
|
|
3178
3266
|
init_utils();
|
|
3179
|
-
|
|
3267
|
+
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3180
3268
|
Grid = ({ ref: _ref, ...props }) => {
|
|
3181
3269
|
const {
|
|
3182
3270
|
columns = 12,
|
|
@@ -3191,7 +3279,7 @@ var init_Grid = __esm({
|
|
|
3191
3279
|
style,
|
|
3192
3280
|
...rest
|
|
3193
3281
|
} = props;
|
|
3194
|
-
const classes = (0,
|
|
3282
|
+
const classes = (0, import_dedupe27.default)("mobius", "mobius-grid", className);
|
|
3195
3283
|
const styles = filterUndefinedProps({
|
|
3196
3284
|
boxSizing: "border-box",
|
|
3197
3285
|
display: "grid",
|
|
@@ -3205,22 +3293,22 @@ var init_Grid = __esm({
|
|
|
3205
3293
|
justifyItems,
|
|
3206
3294
|
...style
|
|
3207
3295
|
});
|
|
3208
|
-
return /* @__PURE__ */ (0,
|
|
3296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: styles, className: classes, ...rest });
|
|
3209
3297
|
};
|
|
3210
3298
|
Grid.displayName = "Grid";
|
|
3211
3299
|
}
|
|
3212
3300
|
});
|
|
3213
3301
|
|
|
3214
3302
|
// src/components/Grid/Item.tsx
|
|
3215
|
-
var
|
|
3303
|
+
var import_react26, import_dedupe28, import_jsx_runtime34, getBreakpointMap, DEFAULT_SPAN, GridItem;
|
|
3216
3304
|
var init_Item2 = __esm({
|
|
3217
3305
|
"src/components/Grid/Item.tsx"() {
|
|
3218
3306
|
"use strict";
|
|
3219
3307
|
"use client";
|
|
3220
|
-
|
|
3221
|
-
|
|
3308
|
+
import_react26 = require("react");
|
|
3309
|
+
import_dedupe28 = __toESM(require("classnames/dedupe"));
|
|
3222
3310
|
init_hooks();
|
|
3223
|
-
|
|
3311
|
+
import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3224
3312
|
getBreakpointMap = (config) => Object.entries(config).reduce(
|
|
3225
3313
|
(prev, [key, value]) => {
|
|
3226
3314
|
const previous = Object.values(prev);
|
|
@@ -3255,9 +3343,9 @@ var init_Item2 = __esm({
|
|
|
3255
3343
|
xl,
|
|
3256
3344
|
xxl
|
|
3257
3345
|
});
|
|
3258
|
-
const [responsiveSpan, setResponsiveSpan] = (0,
|
|
3259
|
-
const classes = (0,
|
|
3260
|
-
(0,
|
|
3346
|
+
const [responsiveSpan, setResponsiveSpan] = (0, import_react26.useState)();
|
|
3347
|
+
const classes = (0, import_dedupe28.default)("mobius-grid__item", className);
|
|
3348
|
+
(0, import_react26.useEffect)(() => {
|
|
3261
3349
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
3262
3350
|
}, [breakpointSize, breakpointMap]);
|
|
3263
3351
|
const styles = {
|
|
@@ -3265,7 +3353,7 @@ var init_Item2 = __esm({
|
|
|
3265
3353
|
alignSelf,
|
|
3266
3354
|
justifySelf
|
|
3267
3355
|
};
|
|
3268
|
-
return /* @__PURE__ */ (0,
|
|
3356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { style: { ...styles }, className: classes, ...rest });
|
|
3269
3357
|
};
|
|
3270
3358
|
GridItem.displayName = "GridItem";
|
|
3271
3359
|
}
|
|
@@ -3286,20 +3374,20 @@ var init_Grid2 = __esm({
|
|
|
3286
3374
|
});
|
|
3287
3375
|
|
|
3288
3376
|
// src/components/Image/Image.tsx
|
|
3289
|
-
var
|
|
3377
|
+
var import_dedupe29, import_jsx_runtime35, Image;
|
|
3290
3378
|
var init_Image = __esm({
|
|
3291
3379
|
"src/components/Image/Image.tsx"() {
|
|
3292
3380
|
"use strict";
|
|
3293
|
-
|
|
3294
|
-
|
|
3381
|
+
import_dedupe29 = __toESM(require("classnames/dedupe"));
|
|
3382
|
+
import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3295
3383
|
Image = ({
|
|
3296
3384
|
ref,
|
|
3297
3385
|
alt,
|
|
3298
3386
|
elementType: Component = "img",
|
|
3299
3387
|
...otherProps
|
|
3300
3388
|
}) => {
|
|
3301
|
-
const classes = (0,
|
|
3302
|
-
return /* @__PURE__ */ (0,
|
|
3389
|
+
const classes = (0, import_dedupe29.default)("mobius", "mobius-image", otherProps.className);
|
|
3390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Component, { alt, ref, ...otherProps, className: classes });
|
|
3303
3391
|
};
|
|
3304
3392
|
Image.displayName = "Image";
|
|
3305
3393
|
}
|
|
@@ -3314,13 +3402,13 @@ var init_Image2 = __esm({
|
|
|
3314
3402
|
});
|
|
3315
3403
|
|
|
3316
3404
|
// src/components/Link/Link.tsx
|
|
3317
|
-
var
|
|
3405
|
+
var import_dedupe30, import_Link, import_jsx_runtime36, Link;
|
|
3318
3406
|
var init_Link = __esm({
|
|
3319
3407
|
"src/components/Link/Link.tsx"() {
|
|
3320
3408
|
"use strict";
|
|
3321
|
-
|
|
3409
|
+
import_dedupe30 = __toESM(require("classnames/dedupe"));
|
|
3322
3410
|
import_Link = require("@simplybusiness/mobius/src/components/Link/Link.css");
|
|
3323
|
-
|
|
3411
|
+
import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3324
3412
|
Link = ({ ref, ...props }) => {
|
|
3325
3413
|
const {
|
|
3326
3414
|
isDisabled = false,
|
|
@@ -3334,7 +3422,7 @@ var init_Link = __esm({
|
|
|
3334
3422
|
pointerEvents: "none"
|
|
3335
3423
|
};
|
|
3336
3424
|
const styles = { ...style, ...isDisabled && disabledStyles };
|
|
3337
|
-
const classes = (0,
|
|
3425
|
+
const classes = (0, import_dedupe30.default)(
|
|
3338
3426
|
"mobius",
|
|
3339
3427
|
"mobius-link",
|
|
3340
3428
|
className,
|
|
@@ -3343,7 +3431,7 @@ var init_Link = __esm({
|
|
|
3343
3431
|
"--is-disabled": isDisabled
|
|
3344
3432
|
}
|
|
3345
3433
|
);
|
|
3346
|
-
return /* @__PURE__ */ (0,
|
|
3434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3347
3435
|
Component,
|
|
3348
3436
|
{
|
|
3349
3437
|
ref,
|
|
@@ -3368,12 +3456,12 @@ var init_Link2 = __esm({
|
|
|
3368
3456
|
});
|
|
3369
3457
|
|
|
3370
3458
|
// src/components/LinkButton/LinkButton.tsx
|
|
3371
|
-
var
|
|
3459
|
+
var import_dedupe31, import_jsx_runtime37;
|
|
3372
3460
|
var init_LinkButton = __esm({
|
|
3373
3461
|
"src/components/LinkButton/LinkButton.tsx"() {
|
|
3374
3462
|
"use strict";
|
|
3375
|
-
|
|
3376
|
-
|
|
3463
|
+
import_dedupe31 = __toESM(require("classnames/dedupe"));
|
|
3464
|
+
import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3377
3465
|
}
|
|
3378
3466
|
});
|
|
3379
3467
|
|
|
@@ -3386,14 +3474,14 @@ var init_LinkButton2 = __esm({
|
|
|
3386
3474
|
});
|
|
3387
3475
|
|
|
3388
3476
|
// src/components/List/List.tsx
|
|
3389
|
-
var
|
|
3477
|
+
var import_react27, import_dedupe32, import_List, import_jsx_runtime38, List;
|
|
3390
3478
|
var init_List = __esm({
|
|
3391
3479
|
"src/components/List/List.tsx"() {
|
|
3392
3480
|
"use strict";
|
|
3393
|
-
|
|
3394
|
-
|
|
3481
|
+
import_react27 = require("react");
|
|
3482
|
+
import_dedupe32 = __toESM(require("classnames/dedupe"));
|
|
3395
3483
|
import_List = require("@simplybusiness/mobius/src/components/List/List.css");
|
|
3396
|
-
|
|
3484
|
+
import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3397
3485
|
List = ({ ref, ...props }) => {
|
|
3398
3486
|
const Component = props.isOrdered ? "ol" : "ul";
|
|
3399
3487
|
const { children, icon, ...otherProps } = props;
|
|
@@ -3402,7 +3490,7 @@ var init_List = __esm({
|
|
|
3402
3490
|
...restProps,
|
|
3403
3491
|
reversed: isReversed
|
|
3404
3492
|
};
|
|
3405
|
-
const classes = (0,
|
|
3493
|
+
const classes = (0, import_dedupe32.default)(
|
|
3406
3494
|
"mobius",
|
|
3407
3495
|
"mobius-list",
|
|
3408
3496
|
{
|
|
@@ -3411,9 +3499,9 @@ var init_List = __esm({
|
|
|
3411
3499
|
},
|
|
3412
3500
|
otherProps.className
|
|
3413
3501
|
);
|
|
3414
|
-
return /* @__PURE__ */ (0,
|
|
3415
|
-
if ((0,
|
|
3416
|
-
return (0,
|
|
3502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Component, { ref, ...mappedProps, className: classes, children: import_react27.Children.map(children, (child) => {
|
|
3503
|
+
if ((0, import_react27.isValidElement)(child)) {
|
|
3504
|
+
return (0, import_react27.cloneElement)(child, {
|
|
3417
3505
|
parentIcon: icon
|
|
3418
3506
|
});
|
|
3419
3507
|
}
|
|
@@ -3425,16 +3513,16 @@ var init_List = __esm({
|
|
|
3425
3513
|
});
|
|
3426
3514
|
|
|
3427
3515
|
// src/components/List/ListItem.tsx
|
|
3428
|
-
var
|
|
3516
|
+
var import_dedupe33, import_jsx_runtime39, ListItem;
|
|
3429
3517
|
var init_ListItem = __esm({
|
|
3430
3518
|
"src/components/List/ListItem.tsx"() {
|
|
3431
3519
|
"use strict";
|
|
3432
|
-
|
|
3433
|
-
|
|
3520
|
+
import_dedupe33 = __toESM(require("classnames/dedupe"));
|
|
3521
|
+
import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3434
3522
|
ListItem = ({ ref, ...props }) => {
|
|
3435
3523
|
const { parentIcon, icon, children, ...otherProps } = props;
|
|
3436
3524
|
const iconContent = icon || parentIcon;
|
|
3437
|
-
const classes = (0,
|
|
3525
|
+
const classes = (0, import_dedupe33.default)(
|
|
3438
3526
|
"mobius",
|
|
3439
3527
|
"mobius-list__item",
|
|
3440
3528
|
{
|
|
@@ -3442,15 +3530,15 @@ var init_ListItem = __esm({
|
|
|
3442
3530
|
},
|
|
3443
3531
|
props.className
|
|
3444
3532
|
);
|
|
3445
|
-
const contentClasses = (0,
|
|
3446
|
-
const iconClasses = (0,
|
|
3533
|
+
const contentClasses = (0, import_dedupe33.default)("mobius", "mobius-list__item-content");
|
|
3534
|
+
const iconClasses = (0, import_dedupe33.default)("mobius", "mobius-list__icon");
|
|
3447
3535
|
if (iconContent) {
|
|
3448
|
-
return /* @__PURE__ */ (0,
|
|
3449
|
-
/* @__PURE__ */ (0,
|
|
3536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: contentClasses, children: [
|
|
3537
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: iconClasses, children: iconContent }),
|
|
3450
3538
|
children
|
|
3451
3539
|
] }) });
|
|
3452
3540
|
}
|
|
3453
|
-
return /* @__PURE__ */ (0,
|
|
3541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { ref, ...otherProps, className: classes, children });
|
|
3454
3542
|
};
|
|
3455
3543
|
ListItem.displayName = "ListItem";
|
|
3456
3544
|
}
|
|
@@ -3466,23 +3554,23 @@ var init_List2 = __esm({
|
|
|
3466
3554
|
});
|
|
3467
3555
|
|
|
3468
3556
|
// src/components/LoadingIndicator/LoadingIndicator.tsx
|
|
3469
|
-
var
|
|
3557
|
+
var import_dedupe34, import_icons8, import_LoadingIndicator, import_jsx_runtime40, LoadingIndicator;
|
|
3470
3558
|
var init_LoadingIndicator = __esm({
|
|
3471
3559
|
"src/components/LoadingIndicator/LoadingIndicator.tsx"() {
|
|
3472
3560
|
"use strict";
|
|
3473
|
-
|
|
3561
|
+
import_dedupe34 = __toESM(require("classnames/dedupe"));
|
|
3474
3562
|
import_icons8 = require("@simplybusiness/icons");
|
|
3475
3563
|
init_Icon2();
|
|
3476
3564
|
import_LoadingIndicator = require("@simplybusiness/mobius/src/components/LoadingIndicator/LoadingIndicator.css");
|
|
3477
|
-
|
|
3565
|
+
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3478
3566
|
LoadingIndicator = ({ ref, ...props }) => {
|
|
3479
3567
|
const { icon = import_icons8.loading, ...otherProps } = props;
|
|
3480
|
-
const classes = (0,
|
|
3568
|
+
const classes = (0, import_dedupe34.default)(
|
|
3481
3569
|
"mobius",
|
|
3482
3570
|
"mobius-loading-indicator",
|
|
3483
3571
|
otherProps.className
|
|
3484
3572
|
);
|
|
3485
|
-
return /* @__PURE__ */ (0,
|
|
3573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { icon, spin: true, ref, ...otherProps, className: classes });
|
|
3486
3574
|
};
|
|
3487
3575
|
LoadingIndicator.displayName = "LoadingIndicator";
|
|
3488
3576
|
}
|
|
@@ -3497,16 +3585,16 @@ var init_LoadingIndicator2 = __esm({
|
|
|
3497
3585
|
});
|
|
3498
3586
|
|
|
3499
3587
|
// src/components/Logo/Logo.tsx
|
|
3500
|
-
var
|
|
3588
|
+
var import_dedupe35, import_jsx_runtime41, Logo;
|
|
3501
3589
|
var init_Logo = __esm({
|
|
3502
3590
|
"src/components/Logo/Logo.tsx"() {
|
|
3503
3591
|
"use strict";
|
|
3504
|
-
|
|
3505
|
-
|
|
3592
|
+
import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3593
|
+
import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3506
3594
|
Logo = ({ ref, ...props }) => {
|
|
3507
3595
|
const { className, width, height, ...otherProps } = props;
|
|
3508
|
-
const classes = (0,
|
|
3509
|
-
return /* @__PURE__ */ (0,
|
|
3596
|
+
const classes = (0, import_dedupe35.default)("mobius", "mobius-logo", className);
|
|
3597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3510
3598
|
"svg",
|
|
3511
3599
|
{
|
|
3512
3600
|
width,
|
|
@@ -3516,7 +3604,7 @@ var init_Logo = __esm({
|
|
|
3516
3604
|
viewBox: "0 0 144 37",
|
|
3517
3605
|
...otherProps,
|
|
3518
3606
|
children: [
|
|
3519
|
-
/* @__PURE__ */ (0,
|
|
3607
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3520
3608
|
"linearGradient",
|
|
3521
3609
|
{
|
|
3522
3610
|
id: "logo-gradient",
|
|
@@ -3525,27 +3613,27 @@ var init_Logo = __esm({
|
|
|
3525
3613
|
y1: "76.042%",
|
|
3526
3614
|
y2: "26.973%",
|
|
3527
3615
|
children: [
|
|
3528
|
-
/* @__PURE__ */ (0,
|
|
3529
|
-
/* @__PURE__ */ (0,
|
|
3616
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { stopColor: "#4632D8", offset: "0%" }),
|
|
3617
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { stopColor: "#9084E8", offset: "100%" })
|
|
3530
3618
|
]
|
|
3531
3619
|
}
|
|
3532
3620
|
) }),
|
|
3533
|
-
/* @__PURE__ */ (0,
|
|
3534
|
-
/* @__PURE__ */ (0,
|
|
3621
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("g", { children: [
|
|
3622
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3535
3623
|
"path",
|
|
3536
3624
|
{
|
|
3537
3625
|
fill: "#0E0A2B",
|
|
3538
3626
|
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"
|
|
3539
3627
|
}
|
|
3540
3628
|
),
|
|
3541
|
-
/* @__PURE__ */ (0,
|
|
3629
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3542
3630
|
"path",
|
|
3543
3631
|
{
|
|
3544
3632
|
fill: "url(#logo-gradient)",
|
|
3545
3633
|
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"
|
|
3546
3634
|
}
|
|
3547
3635
|
),
|
|
3548
|
-
/* @__PURE__ */ (0,
|
|
3636
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3549
3637
|
"path",
|
|
3550
3638
|
{
|
|
3551
3639
|
fill: "#0E0A2B",
|
|
@@ -3570,23 +3658,23 @@ var init_Logo2 = __esm({
|
|
|
3570
3658
|
});
|
|
3571
3659
|
|
|
3572
3660
|
// src/components/Modal/Content.tsx
|
|
3573
|
-
var
|
|
3661
|
+
var import_jsx_runtime42, Content2;
|
|
3574
3662
|
var init_Content2 = __esm({
|
|
3575
3663
|
"src/components/Modal/Content.tsx"() {
|
|
3576
3664
|
"use strict";
|
|
3577
|
-
|
|
3578
|
-
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
3665
|
+
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3666
|
+
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { ref, ...otherProps, className: "mobius-modal__content", children });
|
|
3579
3667
|
Content2.displayName = "Content";
|
|
3580
3668
|
}
|
|
3581
3669
|
});
|
|
3582
3670
|
|
|
3583
3671
|
// src/components/Modal/ModalContext.tsx
|
|
3584
|
-
var
|
|
3672
|
+
var import_react28, ModalContext;
|
|
3585
3673
|
var init_ModalContext = __esm({
|
|
3586
3674
|
"src/components/Modal/ModalContext.tsx"() {
|
|
3587
3675
|
"use strict";
|
|
3588
|
-
|
|
3589
|
-
ModalContext = (0,
|
|
3676
|
+
import_react28 = require("react");
|
|
3677
|
+
ModalContext = (0, import_react28.createContext)({
|
|
3590
3678
|
onClose: () => {
|
|
3591
3679
|
},
|
|
3592
3680
|
closeLabel: void 0
|
|
@@ -3595,21 +3683,21 @@ var init_ModalContext = __esm({
|
|
|
3595
3683
|
});
|
|
3596
3684
|
|
|
3597
3685
|
// src/components/Modal/useModal.ts
|
|
3598
|
-
var
|
|
3686
|
+
var import_react29, useModal;
|
|
3599
3687
|
var init_useModal = __esm({
|
|
3600
3688
|
"src/components/Modal/useModal.ts"() {
|
|
3601
3689
|
"use strict";
|
|
3602
|
-
|
|
3690
|
+
import_react29 = require("react");
|
|
3603
3691
|
init_ModalContext();
|
|
3604
3692
|
useModal = () => {
|
|
3605
|
-
const { onClose, closeLabel } = (0,
|
|
3693
|
+
const { onClose, closeLabel } = (0, import_react29.useContext)(ModalContext);
|
|
3606
3694
|
return { onClose, closeLabel };
|
|
3607
3695
|
};
|
|
3608
3696
|
}
|
|
3609
3697
|
});
|
|
3610
3698
|
|
|
3611
3699
|
// src/components/Modal/Header.tsx
|
|
3612
|
-
var import_icons9,
|
|
3700
|
+
var import_icons9, import_jsx_runtime43, Header2;
|
|
3613
3701
|
var init_Header2 = __esm({
|
|
3614
3702
|
"src/components/Modal/Header.tsx"() {
|
|
3615
3703
|
"use strict";
|
|
@@ -3617,12 +3705,12 @@ var init_Header2 = __esm({
|
|
|
3617
3705
|
init_Button2();
|
|
3618
3706
|
init_Icon2();
|
|
3619
3707
|
init_useModal();
|
|
3620
|
-
|
|
3708
|
+
import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3621
3709
|
Header2 = ({ ref, children, ...otherProps }) => {
|
|
3622
3710
|
const { onClose, closeLabel } = useModal();
|
|
3623
|
-
return /* @__PURE__ */ (0,
|
|
3711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { ref, ...otherProps, className: "mobius-modal__header", children: [
|
|
3624
3712
|
children,
|
|
3625
|
-
/* @__PURE__ */ (0,
|
|
3713
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3626
3714
|
Button,
|
|
3627
3715
|
{
|
|
3628
3716
|
"aria-label": "Close",
|
|
@@ -3630,7 +3718,7 @@ var init_Header2 = __esm({
|
|
|
3630
3718
|
onPress: onClose,
|
|
3631
3719
|
className: "mobius-modal__close",
|
|
3632
3720
|
children: [
|
|
3633
|
-
/* @__PURE__ */ (0,
|
|
3721
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { icon: import_icons9.cross }),
|
|
3634
3722
|
" ",
|
|
3635
3723
|
closeLabel
|
|
3636
3724
|
]
|
|
@@ -3643,19 +3731,19 @@ var init_Header2 = __esm({
|
|
|
3643
3731
|
});
|
|
3644
3732
|
|
|
3645
3733
|
// src/components/Modal/Modal.tsx
|
|
3646
|
-
var
|
|
3734
|
+
var import_dedupe36, import_react30, import_Modal, import_jsx_runtime44, TRANSITION_CSS_VARIABLE2, Modal;
|
|
3647
3735
|
var init_Modal = __esm({
|
|
3648
3736
|
"src/components/Modal/Modal.tsx"() {
|
|
3649
3737
|
"use strict";
|
|
3650
3738
|
"use client";
|
|
3651
|
-
|
|
3652
|
-
|
|
3739
|
+
import_dedupe36 = __toESM(require("classnames/dedupe"));
|
|
3740
|
+
import_react30 = require("react");
|
|
3653
3741
|
init_hooks();
|
|
3654
3742
|
init_utils();
|
|
3655
3743
|
init_polyfill_tests();
|
|
3656
3744
|
init_ModalContext();
|
|
3657
3745
|
import_Modal = require("@simplybusiness/mobius/src/components/Modal/Modal.css");
|
|
3658
|
-
|
|
3746
|
+
import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3659
3747
|
TRANSITION_CSS_VARIABLE2 = "--modal-transition-duration";
|
|
3660
3748
|
Modal = ({ ref, ...props }) => {
|
|
3661
3749
|
const {
|
|
@@ -3669,11 +3757,11 @@ var init_Modal = __esm({
|
|
|
3669
3757
|
animation,
|
|
3670
3758
|
...rest
|
|
3671
3759
|
} = props;
|
|
3672
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3673
|
-
(0,
|
|
3760
|
+
const [shouldTransition, setShouldTransition] = (0, import_react30.useState)(false);
|
|
3761
|
+
(0, import_react30.useEffect)(() => {
|
|
3674
3762
|
setShouldTransition(supportsDialog());
|
|
3675
3763
|
}, []);
|
|
3676
|
-
const dialogRef = (0,
|
|
3764
|
+
const dialogRef = (0, import_react30.useRef)(null);
|
|
3677
3765
|
const { close } = useDialog({
|
|
3678
3766
|
ref: dialogRef,
|
|
3679
3767
|
isOpen,
|
|
@@ -3684,7 +3772,7 @@ var init_Modal = __esm({
|
|
|
3684
3772
|
CSSVariable: TRANSITION_CSS_VARIABLE2
|
|
3685
3773
|
}
|
|
3686
3774
|
});
|
|
3687
|
-
const modalClasses = (0,
|
|
3775
|
+
const modalClasses = (0, import_dedupe36.default)(
|
|
3688
3776
|
"mobius",
|
|
3689
3777
|
"mobius-modal",
|
|
3690
3778
|
{
|
|
@@ -3697,21 +3785,21 @@ var init_Modal = __esm({
|
|
|
3697
3785
|
},
|
|
3698
3786
|
className
|
|
3699
3787
|
);
|
|
3700
|
-
const contextValue = (0,
|
|
3788
|
+
const contextValue = (0, import_react30.useMemo)(
|
|
3701
3789
|
() => ({
|
|
3702
3790
|
onClose: close,
|
|
3703
3791
|
closeLabel
|
|
3704
3792
|
}),
|
|
3705
3793
|
[close, closeLabel]
|
|
3706
3794
|
);
|
|
3707
|
-
return /* @__PURE__ */ (0,
|
|
3795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3708
3796
|
"dialog",
|
|
3709
3797
|
{
|
|
3710
3798
|
ref: mergeRefs([dialogRef, ref]),
|
|
3711
3799
|
onCancel: close,
|
|
3712
3800
|
className: modalClasses,
|
|
3713
3801
|
...rest,
|
|
3714
|
-
children: /* @__PURE__ */ (0,
|
|
3802
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ModalContext.Provider, { value: contextValue, children })
|
|
3715
3803
|
}
|
|
3716
3804
|
);
|
|
3717
3805
|
};
|
|
@@ -3736,16 +3824,16 @@ var init_Modal2 = __esm({
|
|
|
3736
3824
|
});
|
|
3737
3825
|
|
|
3738
3826
|
// src/components/NumberField/NumberField.tsx
|
|
3739
|
-
var
|
|
3827
|
+
var import_dedupe37, import_react31, import_NumberField, import_jsx_runtime45, NumberField;
|
|
3740
3828
|
var init_NumberField = __esm({
|
|
3741
3829
|
"src/components/NumberField/NumberField.tsx"() {
|
|
3742
3830
|
"use strict";
|
|
3743
3831
|
"use client";
|
|
3744
|
-
|
|
3745
|
-
|
|
3832
|
+
import_dedupe37 = __toESM(require("classnames/dedupe"));
|
|
3833
|
+
import_react31 = require("react");
|
|
3746
3834
|
init_TextField2();
|
|
3747
3835
|
import_NumberField = require("@simplybusiness/mobius/src/components/NumberField/NumberField.css");
|
|
3748
|
-
|
|
3836
|
+
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3749
3837
|
NumberField = ({ ref, ...props }) => {
|
|
3750
3838
|
const {
|
|
3751
3839
|
minValue,
|
|
@@ -3761,15 +3849,15 @@ var init_NumberField = __esm({
|
|
|
3761
3849
|
onBlur: customOnBlur,
|
|
3762
3850
|
...rest
|
|
3763
3851
|
} = otherProps;
|
|
3764
|
-
const focusedInputRef = (0,
|
|
3765
|
-
const wheelHandler = (0,
|
|
3766
|
-
(0,
|
|
3852
|
+
const focusedInputRef = (0, import_react31.useRef)(null);
|
|
3853
|
+
const wheelHandler = (0, import_react31.useCallback)((ev) => ev.preventDefault(), []);
|
|
3854
|
+
(0, import_react31.useEffect)(() => {
|
|
3767
3855
|
return () => {
|
|
3768
3856
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
3769
3857
|
focusedInputRef.current = null;
|
|
3770
3858
|
};
|
|
3771
3859
|
}, [wheelHandler]);
|
|
3772
|
-
const containerClasses = (0,
|
|
3860
|
+
const containerClasses = (0, import_dedupe37.default)("mobius-number-field", className, {
|
|
3773
3861
|
"--hide-spin-buttons": hideSpinButtons
|
|
3774
3862
|
});
|
|
3775
3863
|
const handleBeforeInput = (event) => {
|
|
@@ -3813,7 +3901,7 @@ var init_NumberField = __esm({
|
|
|
3813
3901
|
},
|
|
3814
3902
|
onBlur: (e) => handleBlur(e)
|
|
3815
3903
|
};
|
|
3816
|
-
return /* @__PURE__ */ (0,
|
|
3904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3817
3905
|
TextField,
|
|
3818
3906
|
{
|
|
3819
3907
|
...forwardedProps,
|
|
@@ -3841,18 +3929,18 @@ var init_NumberField2 = __esm({
|
|
|
3841
3929
|
});
|
|
3842
3930
|
|
|
3843
3931
|
// src/components/Option/Option.tsx
|
|
3844
|
-
var
|
|
3932
|
+
var import_jsx_runtime46, Option2;
|
|
3845
3933
|
var init_Option2 = __esm({
|
|
3846
3934
|
"src/components/Option/Option.tsx"() {
|
|
3847
3935
|
"use strict";
|
|
3848
|
-
|
|
3936
|
+
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3849
3937
|
Option2 = ({ ref, ...props }) => {
|
|
3850
3938
|
const { isDisabled, ...rest } = props;
|
|
3851
3939
|
const mappedProps = {
|
|
3852
3940
|
...rest,
|
|
3853
3941
|
disabled: isDisabled
|
|
3854
3942
|
};
|
|
3855
|
-
return /* @__PURE__ */ (0,
|
|
3943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { ...mappedProps, ref });
|
|
3856
3944
|
};
|
|
3857
3945
|
Option2.displayName = "Option";
|
|
3858
3946
|
}
|
|
@@ -3867,17 +3955,17 @@ var init_Option3 = __esm({
|
|
|
3867
3955
|
});
|
|
3868
3956
|
|
|
3869
3957
|
// src/components/PasswordField/ShowHideButton.tsx
|
|
3870
|
-
var import_icons10,
|
|
3958
|
+
var import_icons10, import_jsx_runtime47, ShowHideButton;
|
|
3871
3959
|
var init_ShowHideButton = __esm({
|
|
3872
3960
|
"src/components/PasswordField/ShowHideButton.tsx"() {
|
|
3873
3961
|
"use strict";
|
|
3874
3962
|
import_icons10 = require("@simplybusiness/icons");
|
|
3875
3963
|
init_src();
|
|
3876
|
-
|
|
3964
|
+
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3877
3965
|
ShowHideButton = ({
|
|
3878
3966
|
show = false,
|
|
3879
3967
|
onClick
|
|
3880
|
-
}) => /* @__PURE__ */ (0,
|
|
3968
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3881
3969
|
"button",
|
|
3882
3970
|
{
|
|
3883
3971
|
className: "mobius-password-field__show-button",
|
|
@@ -3888,35 +3976,35 @@ var init_ShowHideButton = __esm({
|
|
|
3888
3976
|
},
|
|
3889
3977
|
"aria-label": `${show ? "Hide" : "Show"} password`,
|
|
3890
3978
|
"data-testid": "show-hide-button",
|
|
3891
|
-
children: /* @__PURE__ */ (0,
|
|
3979
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { icon: show ? import_icons10.eyeSlash : import_icons10.eye, "aria-hidden": "true" })
|
|
3892
3980
|
}
|
|
3893
3981
|
);
|
|
3894
3982
|
}
|
|
3895
3983
|
});
|
|
3896
3984
|
|
|
3897
3985
|
// src/components/PasswordField/PasswordField.tsx
|
|
3898
|
-
var
|
|
3986
|
+
var import_dedupe38, import_react32, import_PasswordField, import_jsx_runtime48, PasswordField;
|
|
3899
3987
|
var init_PasswordField = __esm({
|
|
3900
3988
|
"src/components/PasswordField/PasswordField.tsx"() {
|
|
3901
3989
|
"use strict";
|
|
3902
3990
|
"use client";
|
|
3903
|
-
|
|
3904
|
-
|
|
3991
|
+
import_dedupe38 = __toESM(require("classnames/dedupe"));
|
|
3992
|
+
import_react32 = require("react");
|
|
3905
3993
|
init_mergeRefs();
|
|
3906
3994
|
init_TextField2();
|
|
3907
3995
|
init_ShowHideButton();
|
|
3908
3996
|
import_PasswordField = require("@simplybusiness/mobius/src/components/PasswordField/PasswordField.css");
|
|
3909
|
-
|
|
3997
|
+
import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3910
3998
|
PasswordField = ({
|
|
3911
3999
|
ref,
|
|
3912
4000
|
className,
|
|
3913
4001
|
autoComplete = "current-password",
|
|
3914
4002
|
...props
|
|
3915
4003
|
}) => {
|
|
3916
|
-
const [show, setShow] = (0,
|
|
4004
|
+
const [show, setShow] = (0, import_react32.useState)(false);
|
|
3917
4005
|
const type = show ? "text" : "password";
|
|
3918
|
-
const classes = (0,
|
|
3919
|
-
const localRef = (0,
|
|
4006
|
+
const classes = (0, import_dedupe38.default)("mobius-password-field", className);
|
|
4007
|
+
const localRef = (0, import_react32.useRef)(null);
|
|
3920
4008
|
const handleShowHideButtonClick = () => {
|
|
3921
4009
|
const selectionStart = localRef.current?.selectionStart;
|
|
3922
4010
|
const selectionEnd = localRef.current?.selectionEnd;
|
|
@@ -3928,7 +4016,7 @@ var init_PasswordField = __esm({
|
|
|
3928
4016
|
}
|
|
3929
4017
|
});
|
|
3930
4018
|
};
|
|
3931
|
-
return /* @__PURE__ */ (0,
|
|
4019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3932
4020
|
TextField,
|
|
3933
4021
|
{
|
|
3934
4022
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -3936,7 +4024,7 @@ var init_PasswordField = __esm({
|
|
|
3936
4024
|
...props,
|
|
3937
4025
|
autoComplete,
|
|
3938
4026
|
type,
|
|
3939
|
-
suffixInside: /* @__PURE__ */ (0,
|
|
4027
|
+
suffixInside: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ShowHideButton, { onClick: handleShowHideButtonClick, show })
|
|
3940
4028
|
}
|
|
3941
4029
|
);
|
|
3942
4030
|
};
|
|
@@ -3953,17 +4041,17 @@ var init_PasswordField2 = __esm({
|
|
|
3953
4041
|
});
|
|
3954
4042
|
|
|
3955
4043
|
// src/components/Popover/Popover.tsx
|
|
3956
|
-
var
|
|
4044
|
+
var import_react33, import_icons11, import_dedupe39, import_react34, import_mobius_hooks6, import_Popover, import_jsx_runtime49;
|
|
3957
4045
|
var init_Popover = __esm({
|
|
3958
4046
|
"src/components/Popover/Popover.tsx"() {
|
|
3959
4047
|
"use strict";
|
|
3960
|
-
|
|
4048
|
+
import_react33 = require("@floating-ui/react");
|
|
3961
4049
|
import_icons11 = require("@simplybusiness/icons");
|
|
3962
|
-
|
|
3963
|
-
|
|
4050
|
+
import_dedupe39 = __toESM(require("classnames/dedupe"));
|
|
4051
|
+
import_react34 = require("react");
|
|
3964
4052
|
import_mobius_hooks6 = require("@simplybusiness/mobius-hooks");
|
|
3965
4053
|
import_Popover = require("@simplybusiness/mobius/src/components/Popover/Popover.css");
|
|
3966
|
-
|
|
4054
|
+
import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3967
4055
|
}
|
|
3968
4056
|
});
|
|
3969
4057
|
|
|
@@ -3987,17 +4075,17 @@ function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
|
3987
4075
|
console.warn("Progress value is greater than maxValue");
|
|
3988
4076
|
}
|
|
3989
4077
|
}
|
|
3990
|
-
var
|
|
4078
|
+
var import_dedupe40, import_react35, import_Progress, import_jsx_runtime50, sanitizedValue, getLabelComponent, DEFAULT_VALUE, DEFAULT_MIN_VALUE, DEFAULT_MAX_VALUE, Progress;
|
|
3991
4079
|
var init_Progress = __esm({
|
|
3992
4080
|
"src/components/Progress/Progress.tsx"() {
|
|
3993
4081
|
"use strict";
|
|
3994
4082
|
"use client";
|
|
3995
|
-
|
|
3996
|
-
|
|
4083
|
+
import_dedupe40 = __toESM(require("classnames/dedupe"));
|
|
4084
|
+
import_react35 = require("react");
|
|
3997
4085
|
init_Label2();
|
|
3998
4086
|
init_VisuallyHidden2();
|
|
3999
4087
|
import_Progress = require("@simplybusiness/mobius/src/components/Progress/Progress.css");
|
|
4000
|
-
|
|
4088
|
+
import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4001
4089
|
sanitizedValue = (value, defaultValue) => {
|
|
4002
4090
|
if (value === void 0 || Number.isNaN(value)) {
|
|
4003
4091
|
return defaultValue;
|
|
@@ -4006,7 +4094,7 @@ var init_Progress = __esm({
|
|
|
4006
4094
|
};
|
|
4007
4095
|
getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
4008
4096
|
if (showLabel) {
|
|
4009
|
-
return /* @__PURE__ */ (0,
|
|
4097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4010
4098
|
Label,
|
|
4011
4099
|
{
|
|
4012
4100
|
id: progressLabelId,
|
|
@@ -4016,7 +4104,7 @@ var init_Progress = __esm({
|
|
|
4016
4104
|
}
|
|
4017
4105
|
);
|
|
4018
4106
|
}
|
|
4019
|
-
return /* @__PURE__ */ (0,
|
|
4107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4020
4108
|
Label,
|
|
4021
4109
|
{
|
|
4022
4110
|
id: progressLabelId,
|
|
@@ -4030,8 +4118,8 @@ var init_Progress = __esm({
|
|
|
4030
4118
|
DEFAULT_MIN_VALUE = 0;
|
|
4031
4119
|
DEFAULT_MAX_VALUE = 100;
|
|
4032
4120
|
Progress = ({ ref, ...props }) => {
|
|
4033
|
-
const progressId = (0,
|
|
4034
|
-
const progressLabelId = (0,
|
|
4121
|
+
const progressId = (0, import_react35.useId)();
|
|
4122
|
+
const progressLabelId = (0, import_react35.useId)();
|
|
4035
4123
|
const {
|
|
4036
4124
|
id,
|
|
4037
4125
|
label,
|
|
@@ -4056,7 +4144,7 @@ var init_Progress = __esm({
|
|
|
4056
4144
|
100
|
|
4057
4145
|
);
|
|
4058
4146
|
const barWidth = `${percentage}%`;
|
|
4059
|
-
const classes = (0,
|
|
4147
|
+
const classes = (0, import_dedupe40.default)("mobius", "mobius-progress", className, {
|
|
4060
4148
|
"--is-primary": variant === "primary",
|
|
4061
4149
|
"--is-secondary": variant === "secondary"
|
|
4062
4150
|
});
|
|
@@ -4066,7 +4154,7 @@ var init_Progress = __esm({
|
|
|
4066
4154
|
progressBarProps["aria-valuenow"] = value.toString();
|
|
4067
4155
|
progressBarProps["aria-valuetext"] = valueFormatter instanceof Function ? valueFormatter(value, minValue, maxValue) : barWidth;
|
|
4068
4156
|
const labelComponent = getLabelComponent(label, progressLabelId, showLabel);
|
|
4069
|
-
return /* @__PURE__ */ (0,
|
|
4157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4070
4158
|
"div",
|
|
4071
4159
|
{
|
|
4072
4160
|
id: id || progressId,
|
|
@@ -4077,8 +4165,8 @@ var init_Progress = __esm({
|
|
|
4077
4165
|
"aria-labelledby": progressLabelId,
|
|
4078
4166
|
children: [
|
|
4079
4167
|
labelComponent,
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4081
|
-
showValueLabel && /* @__PURE__ */ (0,
|
|
4168
|
+
/* @__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 } }) }),
|
|
4169
|
+
showValueLabel && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
|
|
4082
4170
|
]
|
|
4083
4171
|
}
|
|
4084
4172
|
);
|
|
@@ -4096,17 +4184,17 @@ var init_Progress2 = __esm({
|
|
|
4096
4184
|
});
|
|
4097
4185
|
|
|
4098
4186
|
// src/components/Radio/Radio.tsx
|
|
4099
|
-
var
|
|
4187
|
+
var import_dedupe41, import_react36, import_Radio, import_jsx_runtime51, Radio;
|
|
4100
4188
|
var init_Radio = __esm({
|
|
4101
4189
|
"src/components/Radio/Radio.tsx"() {
|
|
4102
4190
|
"use strict";
|
|
4103
4191
|
"use client";
|
|
4104
|
-
|
|
4105
|
-
|
|
4192
|
+
import_dedupe41 = __toESM(require("classnames/dedupe"));
|
|
4193
|
+
import_react36 = require("react");
|
|
4106
4194
|
init_ErrorMessage2();
|
|
4107
4195
|
init_Label2();
|
|
4108
4196
|
import_Radio = require("@simplybusiness/mobius/src/components/Radio/Radio.css");
|
|
4109
|
-
|
|
4197
|
+
import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4110
4198
|
Radio = ({ ref, ...props }) => {
|
|
4111
4199
|
const {
|
|
4112
4200
|
children,
|
|
@@ -4130,19 +4218,19 @@ var init_Radio = __esm({
|
|
|
4130
4218
|
const isMultiline = label && children;
|
|
4131
4219
|
const isControlled = selected !== void 0;
|
|
4132
4220
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
4133
|
-
const contentRef = (0,
|
|
4134
|
-
const prevOverflowRef = (0,
|
|
4221
|
+
const contentRef = (0, import_react36.useRef)(null);
|
|
4222
|
+
const prevOverflowRef = (0, import_react36.useRef)({
|
|
4135
4223
|
vertical: false,
|
|
4136
4224
|
horizontal: false
|
|
4137
4225
|
});
|
|
4138
|
-
const hasIconFirst = (0,
|
|
4139
|
-
if (!children ||
|
|
4140
|
-
const firstChild =
|
|
4141
|
-
if (!(0,
|
|
4226
|
+
const hasIconFirst = (0, import_react36.useMemo)(() => {
|
|
4227
|
+
if (!children || import_react36.Children.count(children) === 0) return false;
|
|
4228
|
+
const firstChild = import_react36.Children.toArray(children)[0];
|
|
4229
|
+
if (!(0, import_react36.isValidElement)(firstChild)) return false;
|
|
4142
4230
|
const props2 = firstChild.props;
|
|
4143
4231
|
return "icon" in props2 && props2.icon !== void 0;
|
|
4144
4232
|
}, [children]);
|
|
4145
|
-
(0,
|
|
4233
|
+
(0, import_react36.useLayoutEffect)(() => {
|
|
4146
4234
|
if (!contentRef.current || !onOverflow) return;
|
|
4147
4235
|
if (orientation === "vertical") {
|
|
4148
4236
|
return;
|
|
@@ -4171,13 +4259,13 @@ var init_Radio = __esm({
|
|
|
4171
4259
|
"--is-multiline": !!isMultiline,
|
|
4172
4260
|
"--is-required": isRequired
|
|
4173
4261
|
};
|
|
4174
|
-
const containerClasses = (0,
|
|
4262
|
+
const containerClasses = (0, import_dedupe41.default)(
|
|
4175
4263
|
"mobius-radio__label",
|
|
4176
4264
|
radioClasses,
|
|
4177
4265
|
className,
|
|
4178
4266
|
{ "--has-icon-first": hasIconFirst }
|
|
4179
4267
|
);
|
|
4180
|
-
const inputClasses = (0,
|
|
4268
|
+
const inputClasses = (0, import_dedupe41.default)("mobius-radio__input", radioClasses);
|
|
4181
4269
|
const { "aria-describedby": _ariaDescribedBy, ...rest } = otherProps;
|
|
4182
4270
|
const handleChange = (event) => {
|
|
4183
4271
|
if (setSelected) {
|
|
@@ -4191,9 +4279,9 @@ var init_Radio = __esm({
|
|
|
4191
4279
|
onChange(adaptedEvent);
|
|
4192
4280
|
}
|
|
4193
4281
|
};
|
|
4194
|
-
return /* @__PURE__ */ (0,
|
|
4195
|
-
/* @__PURE__ */ (0,
|
|
4196
|
-
/* @__PURE__ */ (0,
|
|
4282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
4283
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Label, { className: containerClasses, children: [
|
|
4284
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4197
4285
|
"input",
|
|
4198
4286
|
{
|
|
4199
4287
|
"aria-describedby": otherProps["aria-describedby"],
|
|
@@ -4210,12 +4298,12 @@ var init_Radio = __esm({
|
|
|
4210
4298
|
...rest
|
|
4211
4299
|
}
|
|
4212
4300
|
),
|
|
4213
|
-
isMultiline ? /* @__PURE__ */ (0,
|
|
4214
|
-
/* @__PURE__ */ (0,
|
|
4215
|
-
/* @__PURE__ */ (0,
|
|
4216
|
-
] }) : /* @__PURE__ */ (0,
|
|
4301
|
+
isMultiline ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { ref: contentRef, className: "mobius-radio__content--multiline", children: [
|
|
4302
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mobius-radio__content-first-line", children: label }),
|
|
4303
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mobius-radio__extra-content", children })
|
|
4304
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { ref: contentRef, className: "mobius-radio__content", children: label || children })
|
|
4217
4305
|
] }),
|
|
4218
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
4306
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ErrorMessage, { errorMessage })
|
|
4219
4307
|
] });
|
|
4220
4308
|
};
|
|
4221
4309
|
Radio.displayName = "Radio";
|
|
@@ -4223,19 +4311,19 @@ var init_Radio = __esm({
|
|
|
4223
4311
|
});
|
|
4224
4312
|
|
|
4225
4313
|
// src/components/Radio/RadioGroup.tsx
|
|
4226
|
-
var
|
|
4314
|
+
var import_dedupe42, import_react37, import_jsx_runtime52, getDefaultVal, RadioGroup;
|
|
4227
4315
|
var init_RadioGroup = __esm({
|
|
4228
4316
|
"src/components/Radio/RadioGroup.tsx"() {
|
|
4229
4317
|
"use strict";
|
|
4230
4318
|
"use client";
|
|
4231
|
-
|
|
4232
|
-
|
|
4319
|
+
import_dedupe42 = __toESM(require("classnames/dedupe"));
|
|
4320
|
+
import_react37 = require("react");
|
|
4233
4321
|
init_hooks();
|
|
4234
4322
|
init_spaceDelimitedList();
|
|
4235
4323
|
init_ErrorMessage2();
|
|
4236
4324
|
init_Label2();
|
|
4237
4325
|
init_Stack2();
|
|
4238
|
-
|
|
4326
|
+
import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4239
4327
|
getDefaultVal = (children, defaultValue) => {
|
|
4240
4328
|
if (Array.isArray(children) && defaultValue) {
|
|
4241
4329
|
const option = children?.find((item) => item.props.value === defaultValue);
|
|
@@ -4263,15 +4351,15 @@ var init_RadioGroup = __esm({
|
|
|
4263
4351
|
...rest
|
|
4264
4352
|
} = props;
|
|
4265
4353
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
4266
|
-
const [selected, setSelected] = (0,
|
|
4267
|
-
const overflowsRef = (0,
|
|
4268
|
-
const [hasOverflow, setHasOverflow] = (0,
|
|
4269
|
-
(0,
|
|
4354
|
+
const [selected, setSelected] = (0, import_react37.useState)(defaultSelected);
|
|
4355
|
+
const overflowsRef = (0, import_react37.useRef)({});
|
|
4356
|
+
const [hasOverflow, setHasOverflow] = (0, import_react37.useState)(false);
|
|
4357
|
+
(0, import_react37.useEffect)(() => {
|
|
4270
4358
|
if (value !== void 0) {
|
|
4271
4359
|
setSelected(value);
|
|
4272
4360
|
}
|
|
4273
4361
|
}, [value]);
|
|
4274
|
-
const handleOverflow = (0,
|
|
4362
|
+
const handleOverflow = (0, import_react37.useCallback)(
|
|
4275
4363
|
(radioValue, overflow) => {
|
|
4276
4364
|
overflowsRef.current = {
|
|
4277
4365
|
...overflowsRef.current,
|
|
@@ -4295,26 +4383,26 @@ var init_RadioGroup = __esm({
|
|
|
4295
4383
|
[`--is-${effectiveOrientation}`]: true,
|
|
4296
4384
|
[className || ""]: true
|
|
4297
4385
|
};
|
|
4298
|
-
const radioGroupClasses = (0,
|
|
4386
|
+
const radioGroupClasses = (0, import_dedupe42.default)(
|
|
4299
4387
|
"mobius",
|
|
4300
4388
|
"mobius-radio-group",
|
|
4301
4389
|
radioClasses,
|
|
4302
4390
|
validationClasses
|
|
4303
4391
|
);
|
|
4304
|
-
const radioWrapperClasses = (0,
|
|
4392
|
+
const radioWrapperClasses = (0, import_dedupe42.default)("mobius-radio__wrapper", {
|
|
4305
4393
|
[`--is-${effectiveOrientation}`]: true
|
|
4306
4394
|
});
|
|
4307
|
-
const labelClasses = (0,
|
|
4308
|
-
const errorMessageId = (0,
|
|
4309
|
-
const defaultNameAttrId = (0,
|
|
4395
|
+
const labelClasses = (0, import_dedupe42.default)(radioClasses, validationClasses);
|
|
4396
|
+
const errorMessageId = (0, import_react37.useId)();
|
|
4397
|
+
const defaultNameAttrId = (0, import_react37.useId)();
|
|
4310
4398
|
const nameAttribute = name || defaultNameAttrId;
|
|
4311
4399
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4312
4400
|
const describedBy = spaceDelimitedList([
|
|
4313
4401
|
shouldErrorMessageShow,
|
|
4314
4402
|
props["aria-describedby"]
|
|
4315
4403
|
]);
|
|
4316
|
-
const labelId = (0,
|
|
4317
|
-
return /* @__PURE__ */ (0,
|
|
4404
|
+
const labelId = (0, import_react37.useId)();
|
|
4405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4318
4406
|
"div",
|
|
4319
4407
|
{
|
|
4320
4408
|
...rest,
|
|
@@ -4330,12 +4418,12 @@ var init_RadioGroup = __esm({
|
|
|
4330
4418
|
ref,
|
|
4331
4419
|
className: radioGroupClasses,
|
|
4332
4420
|
role: "radiogroup",
|
|
4333
|
-
children: /* @__PURE__ */ (0,
|
|
4334
|
-
label && /* @__PURE__ */ (0,
|
|
4335
|
-
/* @__PURE__ */ (0,
|
|
4336
|
-
if ((0,
|
|
4421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Stack, { gap: "xs", children: [
|
|
4422
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
4423
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: radioWrapperClasses, children: import_react37.Children.map(children, (child) => {
|
|
4424
|
+
if ((0, import_react37.isValidElement)(child)) {
|
|
4337
4425
|
const childValue = child.props.value;
|
|
4338
|
-
return (0,
|
|
4426
|
+
return (0, import_react37.cloneElement)(
|
|
4339
4427
|
child,
|
|
4340
4428
|
{
|
|
4341
4429
|
orientation: effectiveOrientation,
|
|
@@ -4353,7 +4441,7 @@ var init_RadioGroup = __esm({
|
|
|
4353
4441
|
}
|
|
4354
4442
|
return child;
|
|
4355
4443
|
}) }),
|
|
4356
|
-
/* @__PURE__ */ (0,
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4357
4445
|
] })
|
|
4358
4446
|
}
|
|
4359
4447
|
);
|
|
@@ -4372,47 +4460,47 @@ var init_Radio2 = __esm({
|
|
|
4372
4460
|
});
|
|
4373
4461
|
|
|
4374
4462
|
// src/components/Segment/SegmentGroup.tsx
|
|
4375
|
-
var
|
|
4463
|
+
var import_dedupe43, import_jsx_runtime53, SegmentGroup;
|
|
4376
4464
|
var init_SegmentGroup = __esm({
|
|
4377
4465
|
"src/components/Segment/SegmentGroup.tsx"() {
|
|
4378
4466
|
"use strict";
|
|
4379
|
-
|
|
4380
|
-
|
|
4467
|
+
import_dedupe43 = __toESM(require("classnames/dedupe"));
|
|
4468
|
+
import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4381
4469
|
SegmentGroup = (props) => {
|
|
4382
4470
|
const { children, horizontal, gap, className, ...rest } = props;
|
|
4383
4471
|
const gapClass = gap ? `gap-${gap}` : "";
|
|
4384
|
-
const classes = (0,
|
|
4472
|
+
const classes = (0, import_dedupe43.default)(
|
|
4385
4473
|
"mobius",
|
|
4386
4474
|
"mobius-segment-group",
|
|
4387
4475
|
className,
|
|
4388
4476
|
{ "--is-horizontal": horizontal },
|
|
4389
4477
|
gapClass
|
|
4390
4478
|
);
|
|
4391
|
-
return /* @__PURE__ */ (0,
|
|
4479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: classes, ...rest, children });
|
|
4392
4480
|
};
|
|
4393
4481
|
SegmentGroup.displayName = "SegmentGroup";
|
|
4394
4482
|
}
|
|
4395
4483
|
});
|
|
4396
4484
|
|
|
4397
4485
|
// src/components/Segment/Segment.tsx
|
|
4398
|
-
var
|
|
4486
|
+
var import_dedupe44, import_Segment, import_jsx_runtime54, Segment;
|
|
4399
4487
|
var init_Segment = __esm({
|
|
4400
4488
|
"src/components/Segment/Segment.tsx"() {
|
|
4401
4489
|
"use strict";
|
|
4402
|
-
|
|
4490
|
+
import_dedupe44 = __toESM(require("classnames/dedupe"));
|
|
4403
4491
|
import_Segment = require("@simplybusiness/mobius/src/components/Segment/Segment.css");
|
|
4404
|
-
|
|
4492
|
+
import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4405
4493
|
Segment = (props) => {
|
|
4406
4494
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
4407
|
-
const classes = (0,
|
|
4495
|
+
const classes = (0, import_dedupe44.default)(
|
|
4408
4496
|
"mobius",
|
|
4409
4497
|
"mobius-segment",
|
|
4410
4498
|
colour,
|
|
4411
4499
|
{ inverted },
|
|
4412
4500
|
className
|
|
4413
4501
|
);
|
|
4414
|
-
return /* @__PURE__ */ (0,
|
|
4415
|
-
heading && /* @__PURE__ */ (0,
|
|
4502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: classes, ...rest, children: [
|
|
4503
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mobius-segment__heading", children: heading }),
|
|
4416
4504
|
children
|
|
4417
4505
|
] });
|
|
4418
4506
|
};
|
|
@@ -4430,14 +4518,14 @@ var init_Segment2 = __esm({
|
|
|
4430
4518
|
});
|
|
4431
4519
|
|
|
4432
4520
|
// src/components/Select/Select.tsx
|
|
4433
|
-
var import_icons12,
|
|
4521
|
+
var import_icons12, import_dedupe45, import_react38, import_Select, import_jsx_runtime55, Select;
|
|
4434
4522
|
var init_Select = __esm({
|
|
4435
4523
|
"src/components/Select/Select.tsx"() {
|
|
4436
4524
|
"use strict";
|
|
4437
4525
|
"use client";
|
|
4438
4526
|
import_icons12 = require("@simplybusiness/icons");
|
|
4439
|
-
|
|
4440
|
-
|
|
4527
|
+
import_dedupe45 = __toESM(require("classnames/dedupe"));
|
|
4528
|
+
import_react38 = require("react");
|
|
4441
4529
|
init_hooks();
|
|
4442
4530
|
init_useLabel2();
|
|
4443
4531
|
init_spaceDelimitedList();
|
|
@@ -4446,7 +4534,7 @@ var init_Select = __esm({
|
|
|
4446
4534
|
init_Label2();
|
|
4447
4535
|
init_Stack2();
|
|
4448
4536
|
import_Select = require("@simplybusiness/mobius/src/components/Select/Select.css");
|
|
4449
|
-
|
|
4537
|
+
import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4450
4538
|
Select = ({ ref, ...props }) => {
|
|
4451
4539
|
const {
|
|
4452
4540
|
label,
|
|
@@ -4467,24 +4555,24 @@ var init_Select = __esm({
|
|
|
4467
4555
|
"--is-required": typeof isRequired === "boolean" && isRequired,
|
|
4468
4556
|
"--is-optional": typeof isRequired === "boolean" && !isRequired
|
|
4469
4557
|
};
|
|
4470
|
-
const sharedClasses = (0,
|
|
4471
|
-
const wrapperClasses = (0,
|
|
4558
|
+
const sharedClasses = (0, import_dedupe45.default)(validationClasses, stateClasses);
|
|
4559
|
+
const wrapperClasses = (0, import_dedupe45.default)(
|
|
4472
4560
|
"mobius-select__wrapper",
|
|
4473
4561
|
sharedClasses,
|
|
4474
4562
|
otherProps.className
|
|
4475
4563
|
);
|
|
4476
|
-
const selectClasses = (0,
|
|
4564
|
+
const selectClasses = (0, import_dedupe45.default)(
|
|
4477
4565
|
"mobius-select",
|
|
4478
4566
|
sharedClasses,
|
|
4479
4567
|
otherProps.className
|
|
4480
4568
|
);
|
|
4481
|
-
const labelClasses = (0,
|
|
4569
|
+
const labelClasses = (0, import_dedupe45.default)(
|
|
4482
4570
|
"mobius-label",
|
|
4483
4571
|
sharedClasses,
|
|
4484
4572
|
otherProps.className
|
|
4485
4573
|
);
|
|
4486
|
-
const iconClasses = (0,
|
|
4487
|
-
const errorMessageId = (0,
|
|
4574
|
+
const iconClasses = (0, import_dedupe45.default)("mobius-select__icon", sharedClasses);
|
|
4575
|
+
const errorMessageId = (0, import_react38.useId)();
|
|
4488
4576
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4489
4577
|
const describedBy = spaceDelimitedList([
|
|
4490
4578
|
shouldErrorMessageShow,
|
|
@@ -4495,10 +4583,10 @@ var init_Select = __esm({
|
|
|
4495
4583
|
onChange(e);
|
|
4496
4584
|
}
|
|
4497
4585
|
};
|
|
4498
|
-
return /* @__PURE__ */ (0,
|
|
4499
|
-
label && /* @__PURE__ */ (0,
|
|
4500
|
-
/* @__PURE__ */ (0,
|
|
4501
|
-
/* @__PURE__ */ (0,
|
|
4586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
|
|
4587
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
4588
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: wrapperClasses, children: [
|
|
4589
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4502
4590
|
"select",
|
|
4503
4591
|
{
|
|
4504
4592
|
...otherProps,
|
|
@@ -4514,9 +4602,9 @@ var init_Select = __esm({
|
|
|
4514
4602
|
onChange: handleChange
|
|
4515
4603
|
}
|
|
4516
4604
|
),
|
|
4517
|
-
/* @__PURE__ */ (0,
|
|
4605
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Icon, { icon: import_icons12.chevronDown }) })
|
|
4518
4606
|
] }),
|
|
4519
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
4607
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4520
4608
|
] });
|
|
4521
4609
|
};
|
|
4522
4610
|
Select.displayName = "Select";
|
|
@@ -4532,15 +4620,15 @@ var init_Select2 = __esm({
|
|
|
4532
4620
|
});
|
|
4533
4621
|
|
|
4534
4622
|
// src/components/Slider/Slider.tsx
|
|
4535
|
-
var
|
|
4623
|
+
var import_dedupe46, import_react39, import_Slider, import_jsx_runtime56;
|
|
4536
4624
|
var init_Slider = __esm({
|
|
4537
4625
|
"src/components/Slider/Slider.tsx"() {
|
|
4538
4626
|
"use strict";
|
|
4539
4627
|
"use client";
|
|
4540
|
-
|
|
4541
|
-
|
|
4628
|
+
import_dedupe46 = __toESM(require("classnames/dedupe"));
|
|
4629
|
+
import_react39 = require("react");
|
|
4542
4630
|
import_Slider = require("@simplybusiness/mobius/src/components/Slider/Slider.css");
|
|
4543
|
-
|
|
4631
|
+
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4544
4632
|
}
|
|
4545
4633
|
});
|
|
4546
4634
|
|
|
@@ -4553,19 +4641,19 @@ var init_Slider2 = __esm({
|
|
|
4553
4641
|
});
|
|
4554
4642
|
|
|
4555
4643
|
// src/components/SVG/SVG.tsx
|
|
4556
|
-
var
|
|
4644
|
+
var import_react40, import_dedupe47, import_jsx_runtime57, SVG;
|
|
4557
4645
|
var init_SVG = __esm({
|
|
4558
4646
|
"src/components/SVG/SVG.tsx"() {
|
|
4559
4647
|
"use strict";
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4648
|
+
import_react40 = require("react");
|
|
4649
|
+
import_dedupe47 = __toESM(require("classnames/dedupe"));
|
|
4650
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4563
4651
|
SVG = ({ ref, ...props }) => {
|
|
4564
4652
|
const { children, className, ...otherProps } = props;
|
|
4565
|
-
const classes = (0,
|
|
4566
|
-
const svgNode =
|
|
4653
|
+
const classes = (0, import_dedupe47.default)("mobius", "mobius-svg", className);
|
|
4654
|
+
const svgNode = import_react40.Children.only(children);
|
|
4567
4655
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
4568
|
-
return /* @__PURE__ */ (0,
|
|
4656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4569
4657
|
"svg",
|
|
4570
4658
|
{
|
|
4571
4659
|
viewBox,
|
|
@@ -4590,16 +4678,16 @@ var init_SVG2 = __esm({
|
|
|
4590
4678
|
});
|
|
4591
4679
|
|
|
4592
4680
|
// src/components/Switch/Switch.tsx
|
|
4593
|
-
var
|
|
4681
|
+
var import_react41, import_dedupe48, import_Switch, import_jsx_runtime58, Switch;
|
|
4594
4682
|
var init_Switch = __esm({
|
|
4595
4683
|
"src/components/Switch/Switch.tsx"() {
|
|
4596
4684
|
"use strict";
|
|
4597
4685
|
"use client";
|
|
4598
|
-
|
|
4599
|
-
|
|
4686
|
+
import_react41 = require("react");
|
|
4687
|
+
import_dedupe48 = __toESM(require("classnames/dedupe"));
|
|
4600
4688
|
init_VisuallyHidden2();
|
|
4601
4689
|
import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
|
|
4602
|
-
|
|
4690
|
+
import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4603
4691
|
Switch = ({ ref, ...props }) => {
|
|
4604
4692
|
const {
|
|
4605
4693
|
checked = false,
|
|
@@ -4608,11 +4696,11 @@ var init_Switch = __esm({
|
|
|
4608
4696
|
isDisabled = false,
|
|
4609
4697
|
...otherProps
|
|
4610
4698
|
} = props;
|
|
4611
|
-
const [enabled, setEnabled] = (0,
|
|
4612
|
-
(0,
|
|
4699
|
+
const [enabled, setEnabled] = (0, import_react41.useState)(checked);
|
|
4700
|
+
(0, import_react41.useEffect)(() => {
|
|
4613
4701
|
setEnabled(checked);
|
|
4614
4702
|
}, [checked]);
|
|
4615
|
-
const classes = (0,
|
|
4703
|
+
const classes = (0, import_dedupe48.default)(
|
|
4616
4704
|
"mobius",
|
|
4617
4705
|
"mobius-switch",
|
|
4618
4706
|
{
|
|
@@ -4627,9 +4715,9 @@ var init_Switch = __esm({
|
|
|
4627
4715
|
onChange(event);
|
|
4628
4716
|
}
|
|
4629
4717
|
};
|
|
4630
|
-
return /* @__PURE__ */ (0,
|
|
4631
|
-
/* @__PURE__ */ (0,
|
|
4632
|
-
/* @__PURE__ */ (0,
|
|
4718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("label", { ref, className: classes, children: [
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: enabled ? "On" : "Off" }) }),
|
|
4720
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4633
4721
|
"input",
|
|
4634
4722
|
{
|
|
4635
4723
|
type: "checkbox",
|
|
@@ -4640,7 +4728,7 @@ var init_Switch = __esm({
|
|
|
4640
4728
|
...otherProps
|
|
4641
4729
|
}
|
|
4642
4730
|
),
|
|
4643
|
-
/* @__PURE__ */ (0,
|
|
4731
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "mobius-switch__slider" })
|
|
4644
4732
|
] });
|
|
4645
4733
|
};
|
|
4646
4734
|
Switch.displayName = "Switch";
|
|
@@ -4656,114 +4744,114 @@ var init_Switch2 = __esm({
|
|
|
4656
4744
|
});
|
|
4657
4745
|
|
|
4658
4746
|
// src/components/Table/Table.tsx
|
|
4659
|
-
var
|
|
4747
|
+
var import_dedupe49, import_Table, import_jsx_runtime59, Table;
|
|
4660
4748
|
var init_Table = __esm({
|
|
4661
4749
|
"src/components/Table/Table.tsx"() {
|
|
4662
4750
|
"use strict";
|
|
4663
|
-
|
|
4751
|
+
import_dedupe49 = __toESM(require("classnames/dedupe"));
|
|
4664
4752
|
import_Table = require("@simplybusiness/mobius/src/components/Table/Table.css");
|
|
4665
|
-
|
|
4753
|
+
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4666
4754
|
Table = ({ ref, ...props }) => {
|
|
4667
|
-
const classes = (0,
|
|
4668
|
-
return /* @__PURE__ */ (0,
|
|
4755
|
+
const classes = (0, import_dedupe49.default)("mobius", "mobius-table", props.className);
|
|
4756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("table", { ref, ...props, className: classes });
|
|
4669
4757
|
};
|
|
4670
4758
|
Table.displayName = "Table";
|
|
4671
4759
|
}
|
|
4672
4760
|
});
|
|
4673
4761
|
|
|
4674
4762
|
// src/components/Table/Head.tsx
|
|
4675
|
-
var
|
|
4763
|
+
var import_dedupe50, import_jsx_runtime60, Head;
|
|
4676
4764
|
var init_Head = __esm({
|
|
4677
4765
|
"src/components/Table/Head.tsx"() {
|
|
4678
4766
|
"use strict";
|
|
4679
|
-
|
|
4680
|
-
|
|
4767
|
+
import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
4768
|
+
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4681
4769
|
Head = ({ ref, ...props }) => {
|
|
4682
|
-
const classes = (0,
|
|
4683
|
-
return /* @__PURE__ */ (0,
|
|
4770
|
+
const classes = (0, import_dedupe50.default)("mobius", "mobius-table__head", props.className);
|
|
4771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("thead", { ref, ...props, className: classes });
|
|
4684
4772
|
};
|
|
4685
4773
|
Head.displayName = "Table.Head";
|
|
4686
4774
|
}
|
|
4687
4775
|
});
|
|
4688
4776
|
|
|
4689
4777
|
// src/components/Table/Body.tsx
|
|
4690
|
-
var
|
|
4778
|
+
var import_dedupe51, import_jsx_runtime61, Body;
|
|
4691
4779
|
var init_Body = __esm({
|
|
4692
4780
|
"src/components/Table/Body.tsx"() {
|
|
4693
4781
|
"use strict";
|
|
4694
|
-
|
|
4695
|
-
|
|
4782
|
+
import_dedupe51 = __toESM(require("classnames/dedupe"));
|
|
4783
|
+
import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4696
4784
|
Body = ({ ref, ...props }) => {
|
|
4697
|
-
const classes = (0,
|
|
4698
|
-
return /* @__PURE__ */ (0,
|
|
4785
|
+
const classes = (0, import_dedupe51.default)("mobius", "mobius-table__body", props.className);
|
|
4786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("tbody", { ref, ...props, className: classes });
|
|
4699
4787
|
};
|
|
4700
4788
|
Body.displayName = "Table.Body";
|
|
4701
4789
|
}
|
|
4702
4790
|
});
|
|
4703
4791
|
|
|
4704
4792
|
// src/components/Table/Foot.tsx
|
|
4705
|
-
var
|
|
4793
|
+
var import_dedupe52, import_jsx_runtime62, Foot;
|
|
4706
4794
|
var init_Foot = __esm({
|
|
4707
4795
|
"src/components/Table/Foot.tsx"() {
|
|
4708
4796
|
"use strict";
|
|
4709
|
-
|
|
4710
|
-
|
|
4797
|
+
import_dedupe52 = __toESM(require("classnames/dedupe"));
|
|
4798
|
+
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4711
4799
|
Foot = ({ ref, ...props }) => {
|
|
4712
|
-
const classes = (0,
|
|
4713
|
-
return /* @__PURE__ */ (0,
|
|
4800
|
+
const classes = (0, import_dedupe52.default)("mobius", "mobius-table__foot", props.className);
|
|
4801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tfoot", { ref, ...props, className: classes });
|
|
4714
4802
|
};
|
|
4715
4803
|
Foot.displayName = "Table.Foot";
|
|
4716
4804
|
}
|
|
4717
4805
|
});
|
|
4718
4806
|
|
|
4719
4807
|
// src/components/Table/Row.tsx
|
|
4720
|
-
var
|
|
4808
|
+
var import_dedupe53, import_jsx_runtime63, Row;
|
|
4721
4809
|
var init_Row = __esm({
|
|
4722
4810
|
"src/components/Table/Row.tsx"() {
|
|
4723
4811
|
"use strict";
|
|
4724
|
-
|
|
4725
|
-
|
|
4812
|
+
import_dedupe53 = __toESM(require("classnames/dedupe"));
|
|
4813
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4726
4814
|
Row = ({ ref, ...props }) => {
|
|
4727
|
-
const classes = (0,
|
|
4728
|
-
return /* @__PURE__ */ (0,
|
|
4815
|
+
const classes = (0, import_dedupe53.default)("mobius", "mobius-table__row", props.className);
|
|
4816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("tr", { ref, ...props, className: classes });
|
|
4729
4817
|
};
|
|
4730
4818
|
Row.displayName = "Table.Row";
|
|
4731
4819
|
}
|
|
4732
4820
|
});
|
|
4733
4821
|
|
|
4734
4822
|
// src/components/Table/HeaderCell.tsx
|
|
4735
|
-
var
|
|
4823
|
+
var import_dedupe54, import_jsx_runtime64, HeaderCell;
|
|
4736
4824
|
var init_HeaderCell = __esm({
|
|
4737
4825
|
"src/components/Table/HeaderCell.tsx"() {
|
|
4738
4826
|
"use strict";
|
|
4739
|
-
|
|
4740
|
-
|
|
4827
|
+
import_dedupe54 = __toESM(require("classnames/dedupe"));
|
|
4828
|
+
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4741
4829
|
HeaderCell = ({ ref, ...props }) => {
|
|
4742
|
-
const classes = (0,
|
|
4830
|
+
const classes = (0, import_dedupe54.default)(
|
|
4743
4831
|
"mobius",
|
|
4744
4832
|
"mobius-table__head-cell",
|
|
4745
4833
|
props.className
|
|
4746
4834
|
);
|
|
4747
|
-
return /* @__PURE__ */ (0,
|
|
4835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("th", { ...props, ref, className: classes });
|
|
4748
4836
|
};
|
|
4749
4837
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
4750
4838
|
}
|
|
4751
4839
|
});
|
|
4752
4840
|
|
|
4753
4841
|
// src/components/Table/Cell.tsx
|
|
4754
|
-
var
|
|
4842
|
+
var import_dedupe55, import_jsx_runtime65, Cell;
|
|
4755
4843
|
var init_Cell = __esm({
|
|
4756
4844
|
"src/components/Table/Cell.tsx"() {
|
|
4757
4845
|
"use strict";
|
|
4758
|
-
|
|
4759
|
-
|
|
4846
|
+
import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
4847
|
+
import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4760
4848
|
Cell = ({ ref, ...props }) => {
|
|
4761
|
-
const classes = (0,
|
|
4849
|
+
const classes = (0, import_dedupe55.default)(
|
|
4762
4850
|
"mobius",
|
|
4763
4851
|
"mobius-table__body-cell",
|
|
4764
4852
|
props.className
|
|
4765
4853
|
);
|
|
4766
|
-
return /* @__PURE__ */ (0,
|
|
4854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("td", { ref, ...props, className: classes });
|
|
4767
4855
|
};
|
|
4768
4856
|
Cell.displayName = "Table.Cell";
|
|
4769
4857
|
}
|
|
@@ -4793,37 +4881,6 @@ var init_Table2 = __esm({
|
|
|
4793
4881
|
}
|
|
4794
4882
|
});
|
|
4795
4883
|
|
|
4796
|
-
// src/components/Text/Text.tsx
|
|
4797
|
-
var import_dedupe55, import_Text, import_jsx_runtime64, getElementType, Text;
|
|
4798
|
-
var init_Text = __esm({
|
|
4799
|
-
"src/components/Text/Text.tsx"() {
|
|
4800
|
-
"use strict";
|
|
4801
|
-
import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
4802
|
-
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
4803
|
-
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4804
|
-
getElementType = (variant, elementType) => {
|
|
4805
|
-
if (variant) {
|
|
4806
|
-
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
4807
|
-
}
|
|
4808
|
-
return elementType || "p";
|
|
4809
|
-
};
|
|
4810
|
-
Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
4811
|
-
const { variant, className, spacing, ...otherProps } = props;
|
|
4812
|
-
const elementType = getElementType(variant, Component);
|
|
4813
|
-
const variantType = variant || elementType;
|
|
4814
|
-
const classes = (0, import_dedupe55.default)(
|
|
4815
|
-
"mobius",
|
|
4816
|
-
"mobius-text",
|
|
4817
|
-
{ [`--is-${variantType}`]: variantType },
|
|
4818
|
-
{ [`--has-line-height-${spacing}`]: spacing },
|
|
4819
|
-
className
|
|
4820
|
-
);
|
|
4821
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
4822
|
-
};
|
|
4823
|
-
Text.displayName = "Text";
|
|
4824
|
-
}
|
|
4825
|
-
});
|
|
4826
|
-
|
|
4827
4884
|
// src/components/Text/index.tsx
|
|
4828
4885
|
var init_Text2 = __esm({
|
|
4829
4886
|
"src/components/Text/index.tsx"() {
|
|
@@ -4833,12 +4890,12 @@ var init_Text2 = __esm({
|
|
|
4833
4890
|
});
|
|
4834
4891
|
|
|
4835
4892
|
// src/components/TextAreaInput/TextAreaInput.tsx
|
|
4836
|
-
var import_dedupe56,
|
|
4893
|
+
var import_dedupe56, import_jsx_runtime66, TextAreaInput;
|
|
4837
4894
|
var init_TextAreaInput = __esm({
|
|
4838
4895
|
"src/components/TextAreaInput/TextAreaInput.tsx"() {
|
|
4839
4896
|
"use strict";
|
|
4840
4897
|
import_dedupe56 = __toESM(require("classnames/dedupe"));
|
|
4841
|
-
|
|
4898
|
+
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4842
4899
|
TextAreaInput = ({ ref, ...props }) => {
|
|
4843
4900
|
const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
|
|
4844
4901
|
const classes = (0, import_dedupe56.default)(
|
|
@@ -4851,7 +4908,7 @@ var init_TextAreaInput = __esm({
|
|
|
4851
4908
|
},
|
|
4852
4909
|
otherProps.className
|
|
4853
4910
|
);
|
|
4854
|
-
return /* @__PURE__ */ (0,
|
|
4911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4855
4912
|
"textarea",
|
|
4856
4913
|
{
|
|
4857
4914
|
ref,
|
|
@@ -4875,7 +4932,7 @@ var init_TextAreaInput2 = __esm({
|
|
|
4875
4932
|
});
|
|
4876
4933
|
|
|
4877
4934
|
// src/components/TextArea/TextArea.tsx
|
|
4878
|
-
var import_dedupe57, import_TextArea,
|
|
4935
|
+
var import_dedupe57, import_TextArea, import_jsx_runtime67, TextArea;
|
|
4879
4936
|
var init_TextArea = __esm({
|
|
4880
4937
|
"src/components/TextArea/TextArea.tsx"() {
|
|
4881
4938
|
"use strict";
|
|
@@ -4887,7 +4944,7 @@ var init_TextArea = __esm({
|
|
|
4887
4944
|
init_Stack2();
|
|
4888
4945
|
init_TextAreaInput2();
|
|
4889
4946
|
import_TextArea = require("@simplybusiness/mobius/src/components/TextArea/TextArea.css");
|
|
4890
|
-
|
|
4947
|
+
import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4891
4948
|
TextArea = ({ ref, ...props }) => {
|
|
4892
4949
|
const {
|
|
4893
4950
|
isDisabled,
|
|
@@ -4907,9 +4964,9 @@ var init_TextArea = __esm({
|
|
|
4907
4964
|
},
|
|
4908
4965
|
validationClasses
|
|
4909
4966
|
);
|
|
4910
|
-
return /* @__PURE__ */ (0,
|
|
4911
|
-
label && /* @__PURE__ */ (0,
|
|
4912
|
-
/* @__PURE__ */ (0,
|
|
4967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Stack, { className: classes, gap: "xs", children: [
|
|
4968
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Label, { ...labelProps, className: labelClasses, children: props.label }),
|
|
4969
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4913
4970
|
TextAreaInput,
|
|
4914
4971
|
{
|
|
4915
4972
|
...otherProps,
|
|
@@ -4920,7 +4977,7 @@ var init_TextArea = __esm({
|
|
|
4920
4977
|
"aria-invalid": errorMessage != null
|
|
4921
4978
|
}
|
|
4922
4979
|
),
|
|
4923
|
-
/* @__PURE__ */ (0,
|
|
4980
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
4924
4981
|
] });
|
|
4925
4982
|
};
|
|
4926
4983
|
TextArea.displayName = "TextArea";
|
|
@@ -4935,53 +4992,6 @@ var init_TextArea2 = __esm({
|
|
|
4935
4992
|
}
|
|
4936
4993
|
});
|
|
4937
4994
|
|
|
4938
|
-
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
4939
|
-
var import_react41, import_jsx_runtime67, isHTML, TextOrHTML;
|
|
4940
|
-
var init_TextOrHTML = __esm({
|
|
4941
|
-
"src/components/TextOrHTML/TextOrHTML.tsx"() {
|
|
4942
|
-
"use strict";
|
|
4943
|
-
import_react41 = require("react");
|
|
4944
|
-
init_Text();
|
|
4945
|
-
import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4946
|
-
isHTML = (text) => /^\s*<[a-z]/i.test(text);
|
|
4947
|
-
TextOrHTML = ({
|
|
4948
|
-
ref,
|
|
4949
|
-
text,
|
|
4950
|
-
htmlClassName,
|
|
4951
|
-
htmlElementType,
|
|
4952
|
-
textWrapper = false,
|
|
4953
|
-
autoDetect = false,
|
|
4954
|
-
...textProps
|
|
4955
|
-
}) => {
|
|
4956
|
-
const textIsHTML = autoDetect && isHTML(text);
|
|
4957
|
-
const shouldWrapInText = autoDetect ? textWrapper || !textIsHTML : textWrapper;
|
|
4958
|
-
const resolvedElementType = htmlElementType ?? (textIsHTML ? "div" : "span");
|
|
4959
|
-
const DangerousComponent = resolvedElementType;
|
|
4960
|
-
const dangerousHTML = (0, import_react41.useMemo)(() => ({ __html: text }), [text]);
|
|
4961
|
-
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4962
|
-
DangerousComponent,
|
|
4963
|
-
{
|
|
4964
|
-
className: htmlClassName,
|
|
4965
|
-
dangerouslySetInnerHTML: dangerousHTML
|
|
4966
|
-
}
|
|
4967
|
-
);
|
|
4968
|
-
if (shouldWrapInText) {
|
|
4969
|
-
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
4970
|
-
}
|
|
4971
|
-
return dangerousElement;
|
|
4972
|
-
};
|
|
4973
|
-
TextOrHTML.displayName = "TextOrHTML";
|
|
4974
|
-
}
|
|
4975
|
-
});
|
|
4976
|
-
|
|
4977
|
-
// src/components/TextOrHTML/index.tsx
|
|
4978
|
-
var init_TextOrHTML2 = __esm({
|
|
4979
|
-
"src/components/TextOrHTML/index.tsx"() {
|
|
4980
|
-
"use strict";
|
|
4981
|
-
init_TextOrHTML();
|
|
4982
|
-
}
|
|
4983
|
-
});
|
|
4984
|
-
|
|
4985
4995
|
// src/components/Title/Title.tsx
|
|
4986
4996
|
var import_dedupe58, import_Title, import_jsx_runtime68, Title;
|
|
4987
4997
|
var init_Title = __esm({
|