@simplybusiness/mobius 10.1.1 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/components/AddressLookup/AddressLookup.js +540 -526
- package/dist/cjs/components/AddressLookup/AddressLookup.js.map +4 -4
- package/dist/cjs/components/AddressLookup/index.js +540 -526
- package/dist/cjs/components/AddressLookup/index.js.map +4 -4
- package/dist/cjs/components/Alert/Alert.js +79 -11
- package/dist/cjs/components/Alert/Alert.js.map +4 -4
- package/dist/cjs/components/Alert/index.js +79 -11
- package/dist/cjs/components/Alert/index.js.map +4 -4
- package/dist/cjs/components/Checkbox/Checkbox.js +506 -492
- package/dist/cjs/components/Checkbox/Checkbox.js.map +4 -4
- package/dist/cjs/components/Checkbox/CheckboxGroup.js +506 -492
- package/dist/cjs/components/Checkbox/CheckboxGroup.js.map +4 -4
- package/dist/cjs/components/Checkbox/index.js +485 -471
- package/dist/cjs/components/Checkbox/index.js.map +4 -4
- package/dist/cjs/components/Combobox/Combobox.js +540 -526
- package/dist/cjs/components/Combobox/Combobox.js.map +4 -4
- package/dist/cjs/components/Combobox/index.js +540 -526
- package/dist/cjs/components/Combobox/index.js.map +4 -4
- package/dist/cjs/components/DateField/DateField.js +527 -513
- package/dist/cjs/components/DateField/DateField.js.map +4 -4
- package/dist/cjs/components/DateField/index.js +527 -513
- package/dist/cjs/components/DateField/index.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js +527 -513
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/index.js +527 -513
- package/dist/cjs/components/ErrorMessage/index.js.map +4 -4
- package/dist/cjs/components/ExpandableText/ExpandableText.js +527 -513
- package/dist/cjs/components/ExpandableText/ExpandableText.js.map +4 -4
- package/dist/cjs/components/ExpandableText/index.js +527 -513
- package/dist/cjs/components/ExpandableText/index.js.map +4 -4
- package/dist/cjs/components/MaskedField/MaskedField.js +537 -523
- package/dist/cjs/components/MaskedField/MaskedField.js.map +4 -4
- package/dist/cjs/components/MaskedField/index.js +537 -523
- package/dist/cjs/components/MaskedField/index.js.map +4 -4
- package/dist/cjs/components/NumberField/NumberField.js +528 -514
- package/dist/cjs/components/NumberField/NumberField.js.map +4 -4
- package/dist/cjs/components/NumberField/index.js +528 -514
- package/dist/cjs/components/NumberField/index.js.map +4 -4
- package/dist/cjs/components/PasswordField/PasswordField.js +524 -510
- package/dist/cjs/components/PasswordField/PasswordField.js.map +4 -4
- package/dist/cjs/components/PasswordField/ShowHideButton.js +523 -509
- package/dist/cjs/components/PasswordField/ShowHideButton.js.map +4 -4
- package/dist/cjs/components/PasswordField/index.js +524 -510
- package/dist/cjs/components/PasswordField/index.js.map +4 -4
- package/dist/cjs/components/Radio/Radio.js +506 -492
- package/dist/cjs/components/Radio/Radio.js.map +4 -4
- package/dist/cjs/components/Radio/RadioGroup.js +505 -491
- package/dist/cjs/components/Radio/RadioGroup.js.map +4 -4
- package/dist/cjs/components/Radio/index.js +484 -470
- package/dist/cjs/components/Radio/index.js.map +4 -4
- package/dist/cjs/components/Select/Select.js +511 -497
- package/dist/cjs/components/Select/Select.js.map +4 -4
- package/dist/cjs/components/Select/index.js +511 -497
- package/dist/cjs/components/Select/index.js.map +4 -4
- package/dist/cjs/components/TextArea/TextArea.js +521 -507
- package/dist/cjs/components/TextArea/TextArea.js.map +4 -4
- package/dist/cjs/components/TextArea/index.js +521 -507
- package/dist/cjs/components/TextArea/index.js.map +4 -4
- package/dist/cjs/components/TextField/TextField.js +537 -523
- package/dist/cjs/components/TextField/TextField.js.map +4 -4
- package/dist/cjs/components/TextField/index.js +537 -523
- package/dist/cjs/components/TextField/index.js.map +4 -4
- package/dist/cjs/components/index.js +567 -553
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/index.js +567 -553
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/meta.json +1372 -1305
- package/dist/esm/{chunk-FTSJNY4J.js → chunk-N5WGQAHM.js} +14 -2
- package/dist/esm/chunk-N5WGQAHM.js.map +7 -0
- package/dist/esm/{chunk-C4BILMFX.js → chunk-RR4UQSOZ.js} +5 -1
- package/dist/esm/chunk-RR4UQSOZ.js.map +7 -0
- package/dist/esm/components/AddressLookup/AddressLookup.js +2 -2
- package/dist/esm/components/AddressLookup/index.js +2 -2
- package/dist/esm/components/Alert/Alert.js +4 -1
- package/dist/esm/components/Alert/index.js +4 -1
- package/dist/esm/components/Checkbox/Checkbox.js +2 -2
- package/dist/esm/components/Checkbox/CheckboxGroup.js +2 -2
- package/dist/esm/components/Checkbox/index.js +2 -2
- package/dist/esm/components/Combobox/Combobox.js +2 -2
- package/dist/esm/components/Combobox/index.js +2 -2
- package/dist/esm/components/DateField/DateField.js +2 -2
- package/dist/esm/components/DateField/index.js +2 -2
- package/dist/esm/components/ErrorMessage/ErrorMessage.js +2 -2
- package/dist/esm/components/ErrorMessage/index.js +2 -2
- package/dist/esm/components/ExpandableText/ExpandableText.js +2 -2
- package/dist/esm/components/ExpandableText/index.js +2 -2
- package/dist/esm/components/MaskedField/MaskedField.js +2 -2
- package/dist/esm/components/MaskedField/index.js +2 -2
- package/dist/esm/components/NumberField/NumberField.js +2 -2
- package/dist/esm/components/NumberField/index.js +2 -2
- package/dist/esm/components/PasswordField/PasswordField.js +2 -2
- package/dist/esm/components/PasswordField/ShowHideButton.js +2 -2
- package/dist/esm/components/PasswordField/index.js +2 -2
- package/dist/esm/components/Radio/Radio.js +2 -2
- package/dist/esm/components/Radio/RadioGroup.js +2 -2
- package/dist/esm/components/Radio/index.js +2 -2
- package/dist/esm/components/Select/Select.js +2 -2
- package/dist/esm/components/Select/index.js +2 -2
- package/dist/esm/components/TextArea/TextArea.js +2 -2
- package/dist/esm/components/TextArea/index.js +2 -2
- package/dist/esm/components/TextField/TextField.js +2 -2
- package/dist/esm/components/TextField/index.js +2 -2
- package/dist/esm/components/index.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/meta.json +164 -131
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/AddressLookup/AddressLookup.test.tsx +76 -0
- package/src/components/AddressLookup/AddressLookup.tsx +9 -0
- package/src/components/Alert/Alert.tsx +10 -1
- package/src/components/Drawer/Drawer.css +24 -3
- package/src/components/Modal/Modal.css +42 -3
- package/dist/esm/chunk-C4BILMFX.js.map +0 -7
- package/dist/esm/chunk-FTSJNY4J.js.map +0 -7
|
@@ -2149,6 +2149,10 @@ var init_AddressLookup = __esm({
|
|
|
2149
2149
|
);
|
|
2150
2150
|
const handleSelected = (selected) => {
|
|
2151
2151
|
setError(null);
|
|
2152
|
+
const isEmpty = typeof selected === "string" ? selected === "" : !selected.id && !selected.value;
|
|
2153
|
+
if (isEmpty) {
|
|
2154
|
+
return Promise.resolve();
|
|
2155
|
+
}
|
|
2152
2156
|
if (typeof selected === "string" || !selected.id) {
|
|
2153
2157
|
setError(new Error("Selected option missing id"));
|
|
2154
2158
|
return Promise.resolve();
|
|
@@ -2196,19 +2200,98 @@ var init_AddressLookup2 = __esm({
|
|
|
2196
2200
|
}
|
|
2197
2201
|
});
|
|
2198
2202
|
|
|
2203
|
+
// src/components/Text/Text.tsx
|
|
2204
|
+
var import_dedupe14, import_Text, import_jsx_runtime15, getElementType, Text;
|
|
2205
|
+
var init_Text = __esm({
|
|
2206
|
+
"src/components/Text/Text.tsx"() {
|
|
2207
|
+
"use strict";
|
|
2208
|
+
import_dedupe14 = __toESM(require("classnames/dedupe"));
|
|
2209
|
+
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
2210
|
+
import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2211
|
+
getElementType = (variant, elementType) => {
|
|
2212
|
+
if (variant) {
|
|
2213
|
+
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
2214
|
+
}
|
|
2215
|
+
return elementType || "p";
|
|
2216
|
+
};
|
|
2217
|
+
Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
2218
|
+
const { variant, className, spacing, ...otherProps } = props;
|
|
2219
|
+
const elementType = getElementType(variant, Component);
|
|
2220
|
+
const variantType = variant || elementType;
|
|
2221
|
+
const classes = (0, import_dedupe14.default)(
|
|
2222
|
+
"mobius",
|
|
2223
|
+
"mobius-text",
|
|
2224
|
+
{ [`--is-${variantType}`]: variantType },
|
|
2225
|
+
{ [`--has-line-height-${spacing}`]: spacing },
|
|
2226
|
+
className
|
|
2227
|
+
);
|
|
2228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
2229
|
+
};
|
|
2230
|
+
Text.displayName = "Text";
|
|
2231
|
+
}
|
|
2232
|
+
});
|
|
2233
|
+
|
|
2234
|
+
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
2235
|
+
var import_react15, import_jsx_runtime16, isHTML, TextOrHTML;
|
|
2236
|
+
var init_TextOrHTML = __esm({
|
|
2237
|
+
"src/components/TextOrHTML/TextOrHTML.tsx"() {
|
|
2238
|
+
"use strict";
|
|
2239
|
+
import_react15 = require("react");
|
|
2240
|
+
init_Text();
|
|
2241
|
+
import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2242
|
+
isHTML = (text) => /^\s*<[a-z]/i.test(text);
|
|
2243
|
+
TextOrHTML = ({
|
|
2244
|
+
ref,
|
|
2245
|
+
text,
|
|
2246
|
+
htmlClassName,
|
|
2247
|
+
htmlElementType,
|
|
2248
|
+
textWrapper = false,
|
|
2249
|
+
autoDetect = false,
|
|
2250
|
+
...textProps
|
|
2251
|
+
}) => {
|
|
2252
|
+
const textIsHTML = autoDetect && isHTML(text);
|
|
2253
|
+
const shouldWrapInText = autoDetect ? textWrapper || !textIsHTML : textWrapper;
|
|
2254
|
+
const resolvedElementType = htmlElementType ?? (textIsHTML ? "div" : "span");
|
|
2255
|
+
const DangerousComponent = resolvedElementType;
|
|
2256
|
+
const dangerousHTML = (0, import_react15.useMemo)(() => ({ __html: text }), [text]);
|
|
2257
|
+
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2258
|
+
DangerousComponent,
|
|
2259
|
+
{
|
|
2260
|
+
className: htmlClassName,
|
|
2261
|
+
dangerouslySetInnerHTML: dangerousHTML
|
|
2262
|
+
}
|
|
2263
|
+
);
|
|
2264
|
+
if (shouldWrapInText) {
|
|
2265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
2266
|
+
}
|
|
2267
|
+
return dangerousElement;
|
|
2268
|
+
};
|
|
2269
|
+
TextOrHTML.displayName = "TextOrHTML";
|
|
2270
|
+
}
|
|
2271
|
+
});
|
|
2272
|
+
|
|
2273
|
+
// src/components/TextOrHTML/index.tsx
|
|
2274
|
+
var init_TextOrHTML2 = __esm({
|
|
2275
|
+
"src/components/TextOrHTML/index.tsx"() {
|
|
2276
|
+
"use strict";
|
|
2277
|
+
init_TextOrHTML();
|
|
2278
|
+
}
|
|
2279
|
+
});
|
|
2280
|
+
|
|
2199
2281
|
// src/components/Alert/Alert.tsx
|
|
2200
2282
|
function isAlertVariant(value) {
|
|
2201
2283
|
return value === "info" || value === "success" || value === "warning" || value === "error";
|
|
2202
2284
|
}
|
|
2203
|
-
var import_icons3,
|
|
2285
|
+
var import_icons3, import_dedupe15, import_Alert, import_jsx_runtime17, Alert;
|
|
2204
2286
|
var init_Alert = __esm({
|
|
2205
2287
|
"src/components/Alert/Alert.tsx"() {
|
|
2206
2288
|
"use strict";
|
|
2207
2289
|
import_icons3 = require("@simplybusiness/icons");
|
|
2208
|
-
|
|
2290
|
+
import_dedupe15 = __toESM(require("classnames/dedupe"));
|
|
2209
2291
|
init_Icon2();
|
|
2292
|
+
init_TextOrHTML2();
|
|
2210
2293
|
import_Alert = require("@simplybusiness/mobius/src/components/Alert/Alert.css");
|
|
2211
|
-
|
|
2294
|
+
import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2212
2295
|
Alert = ({ ref, ...props }) => {
|
|
2213
2296
|
const {
|
|
2214
2297
|
elementType: Element = "div",
|
|
@@ -2221,7 +2304,7 @@ var init_Alert = __esm({
|
|
|
2221
2304
|
if (!show) return null;
|
|
2222
2305
|
const variant = variantProp && isAlertVariant(variantProp) ? variantProp : "info";
|
|
2223
2306
|
const colorValue = variant === "success" ? `var(--color-valid)` : `var(--color-${variant})`;
|
|
2224
|
-
const classes = (0,
|
|
2307
|
+
const classes = (0, import_dedupe15.default)(
|
|
2225
2308
|
"mobius",
|
|
2226
2309
|
"mobius-alert",
|
|
2227
2310
|
{
|
|
@@ -2239,14 +2322,23 @@ var init_Alert = __esm({
|
|
|
2239
2322
|
warning: import_icons3.warning,
|
|
2240
2323
|
error: import_icons3.error
|
|
2241
2324
|
};
|
|
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
|
-
|
|
2325
|
+
const headerClasses = (0, import_dedupe15.default)("mobius", "mobius-alert__header");
|
|
2326
|
+
const iconClasses = (0, import_dedupe15.default)("mobius", "mobius-alert__icon");
|
|
2327
|
+
const contentClasses = (0, import_dedupe15.default)("mobius", "mobius-alert__content");
|
|
2328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Element, { ref, role: "alert", ...otherProps, className: classes, children: [
|
|
2329
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { icon: icon[variant], color: colorValue }) }),
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
2331
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2332
|
+
TextOrHTML,
|
|
2333
|
+
{
|
|
2334
|
+
autoDetect: true,
|
|
2335
|
+
htmlElementType: "span",
|
|
2336
|
+
className: headerClasses,
|
|
2337
|
+
htmlClassName: headerClasses,
|
|
2338
|
+
text: header
|
|
2339
|
+
}
|
|
2340
|
+
),
|
|
2341
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: contentClasses, children })
|
|
2250
2342
|
] })
|
|
2251
2343
|
] });
|
|
2252
2344
|
};
|
|
@@ -2263,14 +2355,14 @@ var init_Alert2 = __esm({
|
|
|
2263
2355
|
});
|
|
2264
2356
|
|
|
2265
2357
|
// src/components/Box/Box.tsx
|
|
2266
|
-
var
|
|
2358
|
+
var import_dedupe16, import_Box, import_jsx_runtime18, Box;
|
|
2267
2359
|
var init_Box = __esm({
|
|
2268
2360
|
"src/components/Box/Box.tsx"() {
|
|
2269
2361
|
"use strict";
|
|
2270
|
-
|
|
2362
|
+
import_dedupe16 = __toESM(require("classnames/dedupe"));
|
|
2271
2363
|
init_utils();
|
|
2272
2364
|
import_Box = require("@simplybusiness/mobius/src/components/Box/Box.css");
|
|
2273
|
-
|
|
2365
|
+
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2274
2366
|
Box = ({ ref, ...props }) => {
|
|
2275
2367
|
const {
|
|
2276
2368
|
elementType: Element = "div",
|
|
@@ -2296,7 +2388,7 @@ var init_Box = __esm({
|
|
|
2296
2388
|
style,
|
|
2297
2389
|
...otherProps
|
|
2298
2390
|
} = props;
|
|
2299
|
-
const classes = (0,
|
|
2391
|
+
const classes = (0, import_dedupe16.default)("mobius", "mobius-box", otherProps.className);
|
|
2300
2392
|
const styleProps = filterUndefinedProps({
|
|
2301
2393
|
padding: getSpacingValue(padding),
|
|
2302
2394
|
paddingInline: getSpacingValue(paddingInline || paddingX),
|
|
@@ -2313,7 +2405,7 @@ var init_Box = __esm({
|
|
|
2313
2405
|
height,
|
|
2314
2406
|
...style
|
|
2315
2407
|
});
|
|
2316
|
-
return /* @__PURE__ */ (0,
|
|
2408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Element, { ref, style: styleProps, ...otherProps, className: classes });
|
|
2317
2409
|
};
|
|
2318
2410
|
Box.displayName = "Box";
|
|
2319
2411
|
}
|
|
@@ -2328,27 +2420,27 @@ var init_Box2 = __esm({
|
|
|
2328
2420
|
});
|
|
2329
2421
|
|
|
2330
2422
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
2331
|
-
var
|
|
2423
|
+
var import_react16, import_dedupe17, import_Breadcrumbs, import_jsx_runtime19, Breadcrumbs;
|
|
2332
2424
|
var init_Breadcrumbs = __esm({
|
|
2333
2425
|
"src/components/Breadcrumbs/Breadcrumbs.tsx"() {
|
|
2334
2426
|
"use strict";
|
|
2335
2427
|
"use client";
|
|
2336
|
-
|
|
2337
|
-
|
|
2428
|
+
import_react16 = require("react");
|
|
2429
|
+
import_dedupe17 = __toESM(require("classnames/dedupe"));
|
|
2338
2430
|
import_Breadcrumbs = require("@simplybusiness/mobius/src/components/Breadcrumbs/Breadcrumbs.css");
|
|
2339
|
-
|
|
2431
|
+
import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2340
2432
|
Breadcrumbs = ({ ref, ...props }) => {
|
|
2341
2433
|
const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
|
|
2342
2434
|
const { navProps } = { navProps: { "aria-label": ariaLabel } };
|
|
2343
2435
|
const { children, ...otherProps } = props;
|
|
2344
|
-
const childArray =
|
|
2345
|
-
const classes = (0,
|
|
2436
|
+
const childArray = import_react16.Children.toArray(children);
|
|
2437
|
+
const classes = (0, import_dedupe17.default)(
|
|
2346
2438
|
"mobius",
|
|
2347
2439
|
"mobius-breadcrumb",
|
|
2348
2440
|
otherProps.className
|
|
2349
2441
|
);
|
|
2350
|
-
return /* @__PURE__ */ (0,
|
|
2351
|
-
(child, i) => (0,
|
|
2442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { children: childArray.map(
|
|
2443
|
+
(child, i) => (0, import_react16.cloneElement)(
|
|
2352
2444
|
child,
|
|
2353
2445
|
{
|
|
2354
2446
|
key: i,
|
|
@@ -2362,22 +2454,22 @@ var init_Breadcrumbs = __esm({
|
|
|
2362
2454
|
});
|
|
2363
2455
|
|
|
2364
2456
|
// src/components/Breadcrumbs/BreadcrumbItem.tsx
|
|
2365
|
-
var
|
|
2457
|
+
var import_react17, import_dedupe18, import_jsx_runtime20, BreadcrumbItem;
|
|
2366
2458
|
var init_BreadcrumbItem = __esm({
|
|
2367
2459
|
"src/components/Breadcrumbs/BreadcrumbItem.tsx"() {
|
|
2368
2460
|
"use strict";
|
|
2369
2461
|
"use client";
|
|
2370
|
-
|
|
2371
|
-
|
|
2462
|
+
import_react17 = require("react");
|
|
2463
|
+
import_dedupe18 = __toESM(require("classnames/dedupe"));
|
|
2372
2464
|
init_Box2();
|
|
2373
|
-
|
|
2465
|
+
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2374
2466
|
BreadcrumbItem = ({ ref, ...props }) => {
|
|
2375
2467
|
const {
|
|
2376
2468
|
isDisabled = false,
|
|
2377
2469
|
isCurrent = false,
|
|
2378
2470
|
"aria-current": ariaCurrent = "page",
|
|
2379
2471
|
children,
|
|
2380
|
-
separator = /* @__PURE__ */ (0,
|
|
2472
|
+
separator = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box, { className: "mobius-breadcrumb__separator", "aria-hidden": "true", children: ">" }),
|
|
2381
2473
|
...otherProps
|
|
2382
2474
|
} = props;
|
|
2383
2475
|
const { itemProps } = {
|
|
@@ -2387,14 +2479,14 @@ var init_BreadcrumbItem = __esm({
|
|
|
2387
2479
|
...otherProps
|
|
2388
2480
|
}
|
|
2389
2481
|
};
|
|
2390
|
-
const classes = (0,
|
|
2482
|
+
const classes = (0, import_dedupe18.default)(
|
|
2391
2483
|
"mobius",
|
|
2392
2484
|
"mobius-breadcrumb__item",
|
|
2393
2485
|
props.className
|
|
2394
2486
|
);
|
|
2395
|
-
const child = typeof children === "string" ? /* @__PURE__ */ (0,
|
|
2396
|
-
return /* @__PURE__ */ (0,
|
|
2397
|
-
(0,
|
|
2487
|
+
const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { ...itemProps, children }) : import_react17.Children.only(children);
|
|
2488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("li", { className: classes, children: [
|
|
2489
|
+
(0, import_react17.cloneElement)(child, {
|
|
2398
2490
|
...child.props,
|
|
2399
2491
|
...itemProps,
|
|
2400
2492
|
ref
|
|
@@ -2416,19 +2508,19 @@ var init_Breadcrumbs2 = __esm({
|
|
|
2416
2508
|
});
|
|
2417
2509
|
|
|
2418
2510
|
// src/components/Button/Loading.tsx
|
|
2419
|
-
var import_icons4,
|
|
2511
|
+
var import_icons4, import_jsx_runtime21, Loading;
|
|
2420
2512
|
var init_Loading = __esm({
|
|
2421
2513
|
"src/components/Button/Loading.tsx"() {
|
|
2422
2514
|
"use strict";
|
|
2423
2515
|
import_icons4 = require("@simplybusiness/icons");
|
|
2424
2516
|
init_Icon2();
|
|
2425
2517
|
init_VisuallyHidden2();
|
|
2426
|
-
|
|
2518
|
+
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2427
2519
|
Loading = (props) => {
|
|
2428
2520
|
const { children } = props;
|
|
2429
|
-
return /* @__PURE__ */ (0,
|
|
2430
|
-
/* @__PURE__ */ (0,
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2522
|
+
/* @__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" }) }),
|
|
2523
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(VisuallyHidden, { className: "mobius-button__loading-text", children: "Loading" }),
|
|
2432
2524
|
children
|
|
2433
2525
|
] });
|
|
2434
2526
|
};
|
|
@@ -2436,33 +2528,33 @@ var init_Loading = __esm({
|
|
|
2436
2528
|
});
|
|
2437
2529
|
|
|
2438
2530
|
// src/components/Button/Success.tsx
|
|
2439
|
-
var import_icons5,
|
|
2531
|
+
var import_icons5, import_jsx_runtime22, Success;
|
|
2440
2532
|
var init_Success = __esm({
|
|
2441
2533
|
"src/components/Button/Success.tsx"() {
|
|
2442
2534
|
"use strict";
|
|
2443
2535
|
import_icons5 = require("@simplybusiness/icons");
|
|
2444
2536
|
init_Icon2();
|
|
2445
2537
|
init_VisuallyHidden2();
|
|
2446
|
-
|
|
2447
|
-
Success = () => /* @__PURE__ */ (0,
|
|
2448
|
-
/* @__PURE__ */ (0,
|
|
2449
|
-
/* @__PURE__ */ (0,
|
|
2538
|
+
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2539
|
+
Success = () => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
2540
|
+
/* @__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" }) }),
|
|
2541
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VisuallyHidden, { className: "mobius-button__success-text", children: "Success" })
|
|
2450
2542
|
] });
|
|
2451
2543
|
}
|
|
2452
2544
|
});
|
|
2453
2545
|
|
|
2454
2546
|
// src/components/Button/Button.tsx
|
|
2455
|
-
var
|
|
2547
|
+
var import_dedupe19, import_Button, import_jsx_runtime23, Button;
|
|
2456
2548
|
var init_Button = __esm({
|
|
2457
2549
|
"src/components/Button/Button.tsx"() {
|
|
2458
2550
|
"use strict";
|
|
2459
2551
|
"use client";
|
|
2460
|
-
|
|
2552
|
+
import_dedupe19 = __toESM(require("classnames/dedupe"));
|
|
2461
2553
|
init_Loading();
|
|
2462
2554
|
init_useButton2();
|
|
2463
2555
|
init_Success();
|
|
2464
2556
|
import_Button = require("@simplybusiness/mobius/src/components/Button/Button.css");
|
|
2465
|
-
|
|
2557
|
+
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2466
2558
|
Button = ({ ref, ...props }) => {
|
|
2467
2559
|
const {
|
|
2468
2560
|
children,
|
|
@@ -2477,7 +2569,7 @@ var init_Button = __esm({
|
|
|
2477
2569
|
...otherProps
|
|
2478
2570
|
} = props;
|
|
2479
2571
|
const { buttonProps } = useButton(props);
|
|
2480
|
-
otherProps.className = (0,
|
|
2572
|
+
otherProps.className = (0, import_dedupe19.default)(
|
|
2481
2573
|
"mobius",
|
|
2482
2574
|
"mobius-button",
|
|
2483
2575
|
`--variant-${variant}`,
|
|
@@ -2489,9 +2581,9 @@ var init_Button = __esm({
|
|
|
2489
2581
|
},
|
|
2490
2582
|
otherProps.className
|
|
2491
2583
|
);
|
|
2492
|
-
return /* @__PURE__ */ (0,
|
|
2493
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2494
|
-
isSuccess && !isLoading && /* @__PURE__ */ (0,
|
|
2584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Component, { ref, ...buttonProps, ...otherProps, children: [
|
|
2585
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loading, { children }) : children,
|
|
2586
|
+
isSuccess && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Success, {})
|
|
2495
2587
|
] });
|
|
2496
2588
|
};
|
|
2497
2589
|
Button.displayName = "Button";
|
|
@@ -2507,13 +2599,13 @@ var init_Button2 = __esm({
|
|
|
2507
2599
|
});
|
|
2508
2600
|
|
|
2509
2601
|
// src/components/Checkbox/Checkbox.tsx
|
|
2510
|
-
var
|
|
2602
|
+
var import_react18, import_dedupe20, import_icons6, import_Checkbox, import_jsx_runtime24, Checkbox;
|
|
2511
2603
|
var init_Checkbox = __esm({
|
|
2512
2604
|
"src/components/Checkbox/Checkbox.tsx"() {
|
|
2513
2605
|
"use strict";
|
|
2514
2606
|
"use client";
|
|
2515
|
-
|
|
2516
|
-
|
|
2607
|
+
import_react18 = require("react");
|
|
2608
|
+
import_dedupe20 = __toESM(require("classnames/dedupe"));
|
|
2517
2609
|
import_icons6 = require("@simplybusiness/icons");
|
|
2518
2610
|
init_ErrorMessage2();
|
|
2519
2611
|
init_spaceDelimitedList();
|
|
@@ -2521,7 +2613,7 @@ var init_Checkbox = __esm({
|
|
|
2521
2613
|
init_Icon2();
|
|
2522
2614
|
init_Stack2();
|
|
2523
2615
|
import_Checkbox = require("@simplybusiness/mobius/src/components/Checkbox/Checkbox.css");
|
|
2524
|
-
|
|
2616
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2525
2617
|
Checkbox = ({ ref, ...props }) => {
|
|
2526
2618
|
const {
|
|
2527
2619
|
id,
|
|
@@ -2541,18 +2633,18 @@ var init_Checkbox = __esm({
|
|
|
2541
2633
|
["aria-describedby"]: ariaDescribedBy,
|
|
2542
2634
|
...rest
|
|
2543
2635
|
} = props;
|
|
2544
|
-
const [checked, setChecked] = (0,
|
|
2545
|
-
const fallbackRef = (0,
|
|
2636
|
+
const [checked, setChecked] = (0, import_react18.useState)(defaultSelected);
|
|
2637
|
+
const fallbackRef = (0, import_react18.useRef)(null);
|
|
2546
2638
|
const refObj = ref || fallbackRef;
|
|
2547
|
-
const inputId = (0,
|
|
2639
|
+
const inputId = (0, import_react18.useId)();
|
|
2548
2640
|
const isControlled = typeof selected === "boolean";
|
|
2549
|
-
(0,
|
|
2641
|
+
(0, import_react18.useEffect)(() => {
|
|
2550
2642
|
if (isControlled) {
|
|
2551
2643
|
setChecked(selected);
|
|
2552
2644
|
}
|
|
2553
2645
|
}, [selected, isControlled]);
|
|
2554
2646
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2555
|
-
const sharedClasses = (0,
|
|
2647
|
+
const sharedClasses = (0, import_dedupe20.default)(
|
|
2556
2648
|
{
|
|
2557
2649
|
"--is-disabled": isDisabled,
|
|
2558
2650
|
"--is-selected": checked,
|
|
@@ -2561,31 +2653,31 @@ var init_Checkbox = __esm({
|
|
|
2561
2653
|
},
|
|
2562
2654
|
validationClasses
|
|
2563
2655
|
);
|
|
2564
|
-
const wrapperClasses = (0,
|
|
2656
|
+
const wrapperClasses = (0, import_dedupe20.default)(
|
|
2565
2657
|
"mobius",
|
|
2566
2658
|
"mobius-checkbox",
|
|
2567
2659
|
sharedClasses,
|
|
2568
2660
|
className
|
|
2569
2661
|
);
|
|
2570
|
-
const labelClasses = (0,
|
|
2571
|
-
const inputClasses = (0,
|
|
2572
|
-
const iconClasses = (0,
|
|
2573
|
-
const errorMessageId = (0,
|
|
2662
|
+
const labelClasses = (0, import_dedupe20.default)("mobius-checkbox__label", sharedClasses);
|
|
2663
|
+
const inputClasses = (0, import_dedupe20.default)("mobius-checkbox__input", sharedClasses);
|
|
2664
|
+
const iconClasses = (0, import_dedupe20.default)("mobius-checkbox__icon", sharedClasses);
|
|
2665
|
+
const errorMessageId = (0, import_react18.useId)();
|
|
2574
2666
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2575
2667
|
const describedBy = spaceDelimitedList([
|
|
2576
2668
|
shouldErrorMessageShow,
|
|
2577
2669
|
ariaDescribedBy
|
|
2578
2670
|
]);
|
|
2579
|
-
const labelId = (0,
|
|
2671
|
+
const labelId = (0, import_react18.useId)();
|
|
2580
2672
|
const handleChange = (event) => {
|
|
2581
2673
|
setChecked(!checked);
|
|
2582
2674
|
if (onChange) {
|
|
2583
2675
|
onChange(event, isLastItem);
|
|
2584
2676
|
}
|
|
2585
2677
|
};
|
|
2586
|
-
return /* @__PURE__ */ (0,
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Stack, { gap: "xs", className: wrapperClasses, children: [
|
|
2679
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: labelClasses, children: [
|
|
2680
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2589
2681
|
"input",
|
|
2590
2682
|
{
|
|
2591
2683
|
"aria-describedby": describedBy,
|
|
@@ -2606,7 +2698,7 @@ var init_Checkbox = __esm({
|
|
|
2606
2698
|
...rest
|
|
2607
2699
|
}
|
|
2608
2700
|
),
|
|
2609
|
-
/* @__PURE__ */ (0,
|
|
2701
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2610
2702
|
Icon,
|
|
2611
2703
|
{
|
|
2612
2704
|
icon: checked ? import_icons6.squareTick : import_icons6.square,
|
|
@@ -2614,9 +2706,9 @@ var init_Checkbox = __esm({
|
|
|
2614
2706
|
className: iconClasses
|
|
2615
2707
|
}
|
|
2616
2708
|
),
|
|
2617
|
-
/* @__PURE__ */ (0,
|
|
2709
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { id: labelId, className: "mobius-checkbox__visible-label", children: label })
|
|
2618
2710
|
] }),
|
|
2619
|
-
/* @__PURE__ */ (0,
|
|
2711
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2620
2712
|
] });
|
|
2621
2713
|
};
|
|
2622
2714
|
Checkbox.displayName = "Checkbox";
|
|
@@ -2641,23 +2733,23 @@ var init_Checkbox2 = __esm({
|
|
|
2641
2733
|
});
|
|
2642
2734
|
|
|
2643
2735
|
// src/components/Container/Container.tsx
|
|
2644
|
-
var
|
|
2736
|
+
var import_dedupe21, import_Container, import_jsx_runtime25, Container;
|
|
2645
2737
|
var init_Container = __esm({
|
|
2646
2738
|
"src/components/Container/Container.tsx"() {
|
|
2647
2739
|
"use strict";
|
|
2648
|
-
|
|
2740
|
+
import_dedupe21 = __toESM(require("classnames/dedupe"));
|
|
2649
2741
|
init_utils();
|
|
2650
2742
|
import_Container = require("@simplybusiness/mobius/src/components/Container/Container.css");
|
|
2651
|
-
|
|
2743
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2652
2744
|
Container = ({ ref, ...props }) => {
|
|
2653
2745
|
const { elementType: Element = "div", size = "md", ...otherProps } = props;
|
|
2654
|
-
const classes = (0,
|
|
2746
|
+
const classes = (0, import_dedupe21.default)(
|
|
2655
2747
|
"mobius",
|
|
2656
2748
|
"mobius-container",
|
|
2657
2749
|
sizeClasses(size),
|
|
2658
2750
|
otherProps.className
|
|
2659
2751
|
);
|
|
2660
|
-
return /* @__PURE__ */ (0,
|
|
2752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
2661
2753
|
};
|
|
2662
2754
|
Container.displayName = "Container";
|
|
2663
2755
|
}
|
|
@@ -2710,17 +2802,17 @@ var init_validation = __esm({
|
|
|
2710
2802
|
});
|
|
2711
2803
|
|
|
2712
2804
|
// src/components/DateField/DateField.tsx
|
|
2713
|
-
var
|
|
2805
|
+
var import_dedupe22, import_react19, import_jsx_runtime26, MIN_MAX_ERROR, DateField;
|
|
2714
2806
|
var init_DateField = __esm({
|
|
2715
2807
|
"src/components/DateField/DateField.tsx"() {
|
|
2716
2808
|
"use strict";
|
|
2717
2809
|
"use client";
|
|
2718
|
-
|
|
2719
|
-
|
|
2810
|
+
import_dedupe22 = __toESM(require("classnames/dedupe"));
|
|
2811
|
+
import_react19 = require("react");
|
|
2720
2812
|
init_mergeRefs();
|
|
2721
2813
|
init_TextField2();
|
|
2722
2814
|
init_validation();
|
|
2723
|
-
|
|
2815
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2724
2816
|
MIN_MAX_ERROR = '"min" value should not be greater than "max" value.';
|
|
2725
2817
|
DateField = ({ ref, ...props }) => {
|
|
2726
2818
|
const {
|
|
@@ -2733,10 +2825,10 @@ var init_DateField = __esm({
|
|
|
2733
2825
|
value,
|
|
2734
2826
|
...otherProps
|
|
2735
2827
|
} = props;
|
|
2736
|
-
const [error3, setError] = (0,
|
|
2737
|
-
const [isInvalid, setIsInvalid] = (0,
|
|
2738
|
-
const localRef = (0,
|
|
2739
|
-
const classes = (0,
|
|
2828
|
+
const [error3, setError] = (0, import_react19.useState)(errorMessage);
|
|
2829
|
+
const [isInvalid, setIsInvalid] = (0, import_react19.useState)(void 0);
|
|
2830
|
+
const localRef = (0, import_react19.useRef)(null);
|
|
2831
|
+
const classes = (0, import_dedupe22.default)("mobius-date-field", className);
|
|
2740
2832
|
const formattedMin = min ? convertToDateFormat(min, format) : void 0;
|
|
2741
2833
|
const formattedMax = max ? convertToDateFormat(max, format) : void 0;
|
|
2742
2834
|
const formattedDefaultValue = defaultValue ? convertToDateFormat(defaultValue, format) : void 0;
|
|
@@ -2749,7 +2841,7 @@ var init_DateField = __esm({
|
|
|
2749
2841
|
setError(props.errorMessage);
|
|
2750
2842
|
setIsInvalid(false);
|
|
2751
2843
|
};
|
|
2752
|
-
(0,
|
|
2844
|
+
(0, import_react19.useEffect)(() => {
|
|
2753
2845
|
if (!isValidDate(min, format)) {
|
|
2754
2846
|
setInvalidState(`Invalid min date: ${min}`);
|
|
2755
2847
|
return;
|
|
@@ -2782,7 +2874,7 @@ var init_DateField = __esm({
|
|
|
2782
2874
|
validate();
|
|
2783
2875
|
otherProps.onBlur?.(event);
|
|
2784
2876
|
};
|
|
2785
|
-
return /* @__PURE__ */ (0,
|
|
2877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2786
2878
|
TextField,
|
|
2787
2879
|
{
|
|
2788
2880
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -2813,23 +2905,23 @@ var init_DateField2 = __esm({
|
|
|
2813
2905
|
});
|
|
2814
2906
|
|
|
2815
2907
|
// src/components/Drawer/Content.tsx
|
|
2816
|
-
var
|
|
2908
|
+
var import_jsx_runtime27, Content;
|
|
2817
2909
|
var init_Content = __esm({
|
|
2818
2910
|
"src/components/Drawer/Content.tsx"() {
|
|
2819
2911
|
"use strict";
|
|
2820
|
-
|
|
2821
|
-
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
2912
|
+
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2913
|
+
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, ...otherProps, className: "mobius-drawer__content", children });
|
|
2822
2914
|
Content.displayName = "Content";
|
|
2823
2915
|
}
|
|
2824
2916
|
});
|
|
2825
2917
|
|
|
2826
2918
|
// src/components/Drawer/DrawerContext.tsx
|
|
2827
|
-
var
|
|
2919
|
+
var import_react20, DrawerContext;
|
|
2828
2920
|
var init_DrawerContext = __esm({
|
|
2829
2921
|
"src/components/Drawer/DrawerContext.tsx"() {
|
|
2830
2922
|
"use strict";
|
|
2831
|
-
|
|
2832
|
-
DrawerContext = (0,
|
|
2923
|
+
import_react20 = require("react");
|
|
2924
|
+
DrawerContext = (0, import_react20.createContext)({
|
|
2833
2925
|
onClose: () => {
|
|
2834
2926
|
},
|
|
2835
2927
|
closeLabel: void 0,
|
|
@@ -2839,19 +2931,19 @@ var init_DrawerContext = __esm({
|
|
|
2839
2931
|
});
|
|
2840
2932
|
|
|
2841
2933
|
// src/components/Drawer/Drawer.tsx
|
|
2842
|
-
var
|
|
2934
|
+
var import_dedupe23, import_react21, import_Drawer, import_jsx_runtime28, TRANSITION_CSS_VARIABLE, Drawer;
|
|
2843
2935
|
var init_Drawer = __esm({
|
|
2844
2936
|
"src/components/Drawer/Drawer.tsx"() {
|
|
2845
2937
|
"use strict";
|
|
2846
2938
|
"use client";
|
|
2847
|
-
|
|
2848
|
-
|
|
2939
|
+
import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
2940
|
+
import_react21 = require("react");
|
|
2849
2941
|
init_hooks();
|
|
2850
2942
|
init_utils();
|
|
2851
2943
|
init_VisuallyHidden2();
|
|
2852
2944
|
init_DrawerContext();
|
|
2853
2945
|
import_Drawer = require("@simplybusiness/mobius/src/components/Drawer/Drawer.css");
|
|
2854
|
-
|
|
2946
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2855
2947
|
TRANSITION_CSS_VARIABLE = "--drawer-transition-duration";
|
|
2856
2948
|
Drawer = ({ ref, ...props }) => {
|
|
2857
2949
|
const {
|
|
@@ -2864,8 +2956,8 @@ var init_Drawer = __esm({
|
|
|
2864
2956
|
onClose,
|
|
2865
2957
|
children
|
|
2866
2958
|
} = props;
|
|
2867
|
-
const dialogRef = (0,
|
|
2868
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
2959
|
+
const dialogRef = (0, import_react21.useRef)(null);
|
|
2960
|
+
const [shouldTransition, setShouldTransition] = (0, import_react21.useState)(false);
|
|
2869
2961
|
const { close } = useDialog({
|
|
2870
2962
|
ref: dialogRef,
|
|
2871
2963
|
isOpen,
|
|
@@ -2876,9 +2968,9 @@ var init_Drawer = __esm({
|
|
|
2876
2968
|
CSSVariable: TRANSITION_CSS_VARIABLE
|
|
2877
2969
|
}
|
|
2878
2970
|
});
|
|
2879
|
-
const hiddenId = `dialog-screen-reader-announce-${(0,
|
|
2880
|
-
const headerId = `dialog-header-${(0,
|
|
2881
|
-
const dialogClasses = (0,
|
|
2971
|
+
const hiddenId = `dialog-screen-reader-announce-${(0, import_react21.useId)()}`;
|
|
2972
|
+
const headerId = `dialog-header-${(0, import_react21.useId)()}`;
|
|
2973
|
+
const dialogClasses = (0, import_dedupe23.default)(
|
|
2882
2974
|
"mobius",
|
|
2883
2975
|
"mobius-drawer",
|
|
2884
2976
|
`--${direction}`,
|
|
@@ -2887,10 +2979,10 @@ var init_Drawer = __esm({
|
|
|
2887
2979
|
"--should-transition": shouldTransition
|
|
2888
2980
|
}
|
|
2889
2981
|
);
|
|
2890
|
-
(0,
|
|
2982
|
+
(0, import_react21.useEffect)(() => {
|
|
2891
2983
|
setShouldTransition(supportsDialog());
|
|
2892
2984
|
}, []);
|
|
2893
|
-
const contextValue = (0,
|
|
2985
|
+
const contextValue = (0, import_react21.useMemo)(
|
|
2894
2986
|
() => ({
|
|
2895
2987
|
onClose: close,
|
|
2896
2988
|
closeLabel,
|
|
@@ -2898,18 +2990,18 @@ var init_Drawer = __esm({
|
|
|
2898
2990
|
}),
|
|
2899
2991
|
[close, closeLabel, headerId]
|
|
2900
2992
|
);
|
|
2901
|
-
return /* @__PURE__ */ (0,
|
|
2993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2902
2994
|
"dialog",
|
|
2903
2995
|
{
|
|
2904
|
-
id: (0,
|
|
2996
|
+
id: (0, import_react21.useId)(),
|
|
2905
2997
|
ref: mergeRefs([dialogRef, ref]),
|
|
2906
2998
|
onCancel: close,
|
|
2907
2999
|
className: dialogClasses,
|
|
2908
3000
|
"aria-describedby": hiddenId,
|
|
2909
3001
|
"aria-labelledby": headerId,
|
|
2910
3002
|
children: [
|
|
2911
|
-
/* @__PURE__ */ (0,
|
|
2912
|
-
/* @__PURE__ */ (0,
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { id: hiddenId, children: announce }) }),
|
|
3004
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DrawerContext.Provider, { value: contextValue, children })
|
|
2913
3005
|
]
|
|
2914
3006
|
}
|
|
2915
3007
|
);
|
|
@@ -2919,21 +3011,21 @@ var init_Drawer = __esm({
|
|
|
2919
3011
|
});
|
|
2920
3012
|
|
|
2921
3013
|
// src/components/Drawer/useDrawer.ts
|
|
2922
|
-
var
|
|
3014
|
+
var import_react22, useDrawer;
|
|
2923
3015
|
var init_useDrawer = __esm({
|
|
2924
3016
|
"src/components/Drawer/useDrawer.ts"() {
|
|
2925
3017
|
"use strict";
|
|
2926
|
-
|
|
3018
|
+
import_react22 = require("react");
|
|
2927
3019
|
init_DrawerContext();
|
|
2928
3020
|
useDrawer = () => {
|
|
2929
|
-
const { onClose, closeLabel, headerId } = (0,
|
|
3021
|
+
const { onClose, closeLabel, headerId } = (0, import_react22.useContext)(DrawerContext);
|
|
2930
3022
|
return { onClose, closeLabel, headerId };
|
|
2931
3023
|
};
|
|
2932
3024
|
}
|
|
2933
3025
|
});
|
|
2934
3026
|
|
|
2935
3027
|
// src/components/Drawer/Header.tsx
|
|
2936
|
-
var import_icons7,
|
|
3028
|
+
var import_icons7, import_jsx_runtime29, Header;
|
|
2937
3029
|
var init_Header = __esm({
|
|
2938
3030
|
"src/components/Drawer/Header.tsx"() {
|
|
2939
3031
|
"use strict";
|
|
@@ -2941,12 +3033,12 @@ var init_Header = __esm({
|
|
|
2941
3033
|
init_Button2();
|
|
2942
3034
|
init_Icon2();
|
|
2943
3035
|
init_useDrawer();
|
|
2944
|
-
|
|
3036
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2945
3037
|
Header = ({ ref, children, ...otherProps }) => {
|
|
2946
3038
|
const { onClose, closeLabel, headerId } = useDrawer();
|
|
2947
|
-
return /* @__PURE__ */ (0,
|
|
2948
|
-
/* @__PURE__ */ (0,
|
|
2949
|
-
/* @__PURE__ */ (0,
|
|
3039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("header", { ref, ...otherProps, className: "mobius-drawer__header", children: [
|
|
3040
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h2", { id: headerId, children }),
|
|
3041
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2950
3042
|
Button,
|
|
2951
3043
|
{
|
|
2952
3044
|
"aria-label": "Close",
|
|
@@ -2955,7 +3047,7 @@ var init_Header = __esm({
|
|
|
2955
3047
|
className: "mobius-drawer__close",
|
|
2956
3048
|
size: "sm",
|
|
2957
3049
|
children: [
|
|
2958
|
-
/* @__PURE__ */ (0,
|
|
3050
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { icon: import_icons7.cross }),
|
|
2959
3051
|
" ",
|
|
2960
3052
|
closeLabel
|
|
2961
3053
|
]
|
|
@@ -2984,17 +3076,17 @@ var init_Drawer2 = __esm({
|
|
|
2984
3076
|
});
|
|
2985
3077
|
|
|
2986
3078
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2987
|
-
var
|
|
3079
|
+
var import_react23, import_react_accessible_dropdown_menu_hook, import_dedupe24, import_DropdownMenu, import_jsx_runtime30, DropdownMenu;
|
|
2988
3080
|
var init_DropdownMenu = __esm({
|
|
2989
3081
|
"src/components/DropdownMenu/DropdownMenu.tsx"() {
|
|
2990
3082
|
"use strict";
|
|
2991
3083
|
"use client";
|
|
2992
|
-
|
|
3084
|
+
import_react23 = require("react");
|
|
2993
3085
|
import_react_accessible_dropdown_menu_hook = __toESM(require("react-accessible-dropdown-menu-hook"));
|
|
2994
|
-
|
|
3086
|
+
import_dedupe24 = __toESM(require("classnames/dedupe"));
|
|
2995
3087
|
init_Button2();
|
|
2996
3088
|
import_DropdownMenu = require("@simplybusiness/mobius/src/components/DropdownMenu/DropdownMenu.css");
|
|
2997
|
-
|
|
3089
|
+
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2998
3090
|
DropdownMenu = ({ ref, ...props }) => {
|
|
2999
3091
|
const {
|
|
3000
3092
|
elementType: Element = "nav",
|
|
@@ -3003,21 +3095,21 @@ var init_DropdownMenu = __esm({
|
|
|
3003
3095
|
children,
|
|
3004
3096
|
...otherProps
|
|
3005
3097
|
} = props;
|
|
3006
|
-
const [activeId, setActiveId] = (0,
|
|
3007
|
-
const numberOfItems =
|
|
3098
|
+
const [activeId, setActiveId] = (0, import_react23.useState)(null);
|
|
3099
|
+
const numberOfItems = import_react23.Children.count(children);
|
|
3008
3100
|
const {
|
|
3009
3101
|
buttonProps,
|
|
3010
3102
|
itemProps,
|
|
3011
3103
|
isOpen: open,
|
|
3012
3104
|
setIsOpen
|
|
3013
3105
|
} = (0, import_react_accessible_dropdown_menu_hook.default)(numberOfItems);
|
|
3014
|
-
const classes = (0,
|
|
3106
|
+
const classes = (0, import_dedupe24.default)(
|
|
3015
3107
|
"mobius",
|
|
3016
3108
|
"mobius-dropdown-menu",
|
|
3017
3109
|
otherProps.className
|
|
3018
3110
|
);
|
|
3019
|
-
const triggerClasses = (0,
|
|
3020
|
-
const listClasses = (0,
|
|
3111
|
+
const triggerClasses = (0, import_dedupe24.default)("mobius", "mobius-dropdown-menu__trigger");
|
|
3112
|
+
const listClasses = (0, import_dedupe24.default)("mobius", "mobius-dropdown-menu__list", {
|
|
3021
3113
|
"--is-open": open
|
|
3022
3114
|
});
|
|
3023
3115
|
const handleChildClick = ({ onClick }, index) => {
|
|
@@ -3027,16 +3119,16 @@ var init_DropdownMenu = __esm({
|
|
|
3027
3119
|
onClick();
|
|
3028
3120
|
}
|
|
3029
3121
|
};
|
|
3030
|
-
return /* @__PURE__ */ (0,
|
|
3031
|
-
trigger ? (0,
|
|
3122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Element, { ref, ...otherProps, className: classes, children: [
|
|
3123
|
+
trigger ? (0, import_react23.cloneElement)(trigger, {
|
|
3032
3124
|
className: triggerClasses,
|
|
3033
3125
|
open,
|
|
3034
3126
|
label,
|
|
3035
3127
|
...buttonProps
|
|
3036
|
-
}) : /* @__PURE__ */ (0,
|
|
3037
|
-
/* @__PURE__ */ (0,
|
|
3038
|
-
if ((0,
|
|
3039
|
-
return (0,
|
|
3128
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
3129
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ul", { className: listClasses, role: "menu", children: import_react23.Children.map(children, (child, index) => {
|
|
3130
|
+
if ((0, import_react23.isValidElement)(child)) {
|
|
3131
|
+
return (0, import_react23.cloneElement)(child, {
|
|
3040
3132
|
onClick: () => handleChildClick(child.props, index),
|
|
3041
3133
|
active: index === activeId,
|
|
3042
3134
|
...itemProps[index]
|
|
@@ -3051,13 +3143,13 @@ var init_DropdownMenu = __esm({
|
|
|
3051
3143
|
});
|
|
3052
3144
|
|
|
3053
3145
|
// src/components/DropdownMenu/Item.tsx
|
|
3054
|
-
var
|
|
3146
|
+
var import_react24, import_dedupe25, import_jsx_runtime31, Item;
|
|
3055
3147
|
var init_Item = __esm({
|
|
3056
3148
|
"src/components/DropdownMenu/Item.tsx"() {
|
|
3057
3149
|
"use strict";
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3150
|
+
import_react24 = require("react");
|
|
3151
|
+
import_dedupe25 = __toESM(require("classnames/dedupe"));
|
|
3152
|
+
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3061
3153
|
Item = ({ ref, ...props }) => {
|
|
3062
3154
|
const {
|
|
3063
3155
|
elementType: Element = "li",
|
|
@@ -3066,26 +3158,26 @@ var init_Item = __esm({
|
|
|
3066
3158
|
children,
|
|
3067
3159
|
...otherProps
|
|
3068
3160
|
} = props;
|
|
3069
|
-
const classes = (0,
|
|
3161
|
+
const classes = (0, import_dedupe25.default)(
|
|
3070
3162
|
"mobius",
|
|
3071
3163
|
"mobius-dropdown-menu__item",
|
|
3072
3164
|
{ "--is-active": active },
|
|
3073
3165
|
otherProps.className
|
|
3074
3166
|
);
|
|
3075
|
-
return /* @__PURE__ */ (0,
|
|
3076
|
-
if ((0,
|
|
3077
|
-
const childClasses = (0,
|
|
3167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Element, { ref, onClick, ...otherProps, children: import_react24.Children.map(children, (child) => {
|
|
3168
|
+
if ((0, import_react24.isValidElement)(child)) {
|
|
3169
|
+
const childClasses = (0, import_dedupe25.default)(
|
|
3078
3170
|
child.props.className,
|
|
3079
3171
|
classes
|
|
3080
3172
|
);
|
|
3081
|
-
return (0,
|
|
3173
|
+
return (0, import_react24.cloneElement)(
|
|
3082
3174
|
child,
|
|
3083
3175
|
{
|
|
3084
3176
|
className: childClasses
|
|
3085
3177
|
}
|
|
3086
3178
|
);
|
|
3087
3179
|
}
|
|
3088
|
-
return /* @__PURE__ */ (0,
|
|
3180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: classes, children: child });
|
|
3089
3181
|
}) });
|
|
3090
3182
|
};
|
|
3091
3183
|
Item.displayName = "DropdownMenu.Item";
|
|
@@ -3110,23 +3202,23 @@ var init_DropdownMenu2 = __esm({
|
|
|
3110
3202
|
});
|
|
3111
3203
|
|
|
3112
3204
|
// src/components/Fieldset/Fieldset.tsx
|
|
3113
|
-
var
|
|
3205
|
+
var import_dedupe26, import_react25, import_Fieldset, import_jsx_runtime32, useFieldset, Fieldset;
|
|
3114
3206
|
var init_Fieldset = __esm({
|
|
3115
3207
|
"src/components/Fieldset/Fieldset.tsx"() {
|
|
3116
3208
|
"use strict";
|
|
3117
3209
|
"use client";
|
|
3118
|
-
|
|
3119
|
-
|
|
3210
|
+
import_dedupe26 = __toESM(require("classnames/dedupe"));
|
|
3211
|
+
import_react25 = require("react");
|
|
3120
3212
|
init_Flex2();
|
|
3121
3213
|
import_Fieldset = require("@simplybusiness/mobius/src/components/Fieldset/Fieldset.css");
|
|
3122
|
-
|
|
3214
|
+
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3123
3215
|
useFieldset = (props) => {
|
|
3124
3216
|
const { legend } = props;
|
|
3125
3217
|
let legendProps = {};
|
|
3126
3218
|
let containerProps = {
|
|
3127
3219
|
role: "group"
|
|
3128
3220
|
};
|
|
3129
|
-
const legendId = (0,
|
|
3221
|
+
const legendId = (0, import_react25.useId)();
|
|
3130
3222
|
if (legend) {
|
|
3131
3223
|
legendProps = {
|
|
3132
3224
|
...legendProps,
|
|
@@ -3146,14 +3238,14 @@ var init_Fieldset = __esm({
|
|
|
3146
3238
|
const {
|
|
3147
3239
|
children,
|
|
3148
3240
|
legend,
|
|
3149
|
-
legendComponent = /* @__PURE__ */ (0,
|
|
3241
|
+
legendComponent = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("legend", {}),
|
|
3150
3242
|
...otherProps
|
|
3151
3243
|
} = props;
|
|
3152
3244
|
const { legendProps, containerProps } = useFieldset(props);
|
|
3153
|
-
const classes = (0,
|
|
3245
|
+
const classes = (0, import_dedupe26.default)("mobius", "mobius-fieldset", props.className);
|
|
3154
3246
|
legendProps.className = "mobius-fieldset__legend";
|
|
3155
|
-
return /* @__PURE__ */ (0,
|
|
3156
|
-
legend && (0,
|
|
3247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
3248
|
+
legend && (0, import_react25.cloneElement)(legendComponent, { ...legendProps }, [legend]),
|
|
3157
3249
|
children
|
|
3158
3250
|
] });
|
|
3159
3251
|
};
|
|
@@ -3170,13 +3262,13 @@ var init_Fieldset2 = __esm({
|
|
|
3170
3262
|
});
|
|
3171
3263
|
|
|
3172
3264
|
// src/components/Grid/Grid.tsx
|
|
3173
|
-
var
|
|
3265
|
+
var import_dedupe27, import_jsx_runtime33, Grid;
|
|
3174
3266
|
var init_Grid = __esm({
|
|
3175
3267
|
"src/components/Grid/Grid.tsx"() {
|
|
3176
3268
|
"use strict";
|
|
3177
|
-
|
|
3269
|
+
import_dedupe27 = __toESM(require("classnames/dedupe"));
|
|
3178
3270
|
init_utils();
|
|
3179
|
-
|
|
3271
|
+
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3180
3272
|
Grid = ({ ref: _ref, ...props }) => {
|
|
3181
3273
|
const {
|
|
3182
3274
|
columns = 12,
|
|
@@ -3191,7 +3283,7 @@ var init_Grid = __esm({
|
|
|
3191
3283
|
style,
|
|
3192
3284
|
...rest
|
|
3193
3285
|
} = props;
|
|
3194
|
-
const classes = (0,
|
|
3286
|
+
const classes = (0, import_dedupe27.default)("mobius", "mobius-grid", className);
|
|
3195
3287
|
const styles = filterUndefinedProps({
|
|
3196
3288
|
boxSizing: "border-box",
|
|
3197
3289
|
display: "grid",
|
|
@@ -3205,22 +3297,22 @@ var init_Grid = __esm({
|
|
|
3205
3297
|
justifyItems,
|
|
3206
3298
|
...style
|
|
3207
3299
|
});
|
|
3208
|
-
return /* @__PURE__ */ (0,
|
|
3300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: styles, className: classes, ...rest });
|
|
3209
3301
|
};
|
|
3210
3302
|
Grid.displayName = "Grid";
|
|
3211
3303
|
}
|
|
3212
3304
|
});
|
|
3213
3305
|
|
|
3214
3306
|
// src/components/Grid/Item.tsx
|
|
3215
|
-
var
|
|
3307
|
+
var import_react26, import_dedupe28, import_jsx_runtime34, getBreakpointMap, DEFAULT_SPAN, GridItem;
|
|
3216
3308
|
var init_Item2 = __esm({
|
|
3217
3309
|
"src/components/Grid/Item.tsx"() {
|
|
3218
3310
|
"use strict";
|
|
3219
3311
|
"use client";
|
|
3220
|
-
|
|
3221
|
-
|
|
3312
|
+
import_react26 = require("react");
|
|
3313
|
+
import_dedupe28 = __toESM(require("classnames/dedupe"));
|
|
3222
3314
|
init_hooks();
|
|
3223
|
-
|
|
3315
|
+
import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3224
3316
|
getBreakpointMap = (config) => Object.entries(config).reduce(
|
|
3225
3317
|
(prev, [key, value]) => {
|
|
3226
3318
|
const previous = Object.values(prev);
|
|
@@ -3255,9 +3347,9 @@ var init_Item2 = __esm({
|
|
|
3255
3347
|
xl,
|
|
3256
3348
|
xxl
|
|
3257
3349
|
});
|
|
3258
|
-
const [responsiveSpan, setResponsiveSpan] = (0,
|
|
3259
|
-
const classes = (0,
|
|
3260
|
-
(0,
|
|
3350
|
+
const [responsiveSpan, setResponsiveSpan] = (0, import_react26.useState)();
|
|
3351
|
+
const classes = (0, import_dedupe28.default)("mobius-grid__item", className);
|
|
3352
|
+
(0, import_react26.useEffect)(() => {
|
|
3261
3353
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
3262
3354
|
}, [breakpointSize, breakpointMap]);
|
|
3263
3355
|
const styles = {
|
|
@@ -3265,7 +3357,7 @@ var init_Item2 = __esm({
|
|
|
3265
3357
|
alignSelf,
|
|
3266
3358
|
justifySelf
|
|
3267
3359
|
};
|
|
3268
|
-
return /* @__PURE__ */ (0,
|
|
3360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { style: { ...styles }, className: classes, ...rest });
|
|
3269
3361
|
};
|
|
3270
3362
|
GridItem.displayName = "GridItem";
|
|
3271
3363
|
}
|
|
@@ -3286,20 +3378,20 @@ var init_Grid2 = __esm({
|
|
|
3286
3378
|
});
|
|
3287
3379
|
|
|
3288
3380
|
// src/components/Image/Image.tsx
|
|
3289
|
-
var
|
|
3381
|
+
var import_dedupe29, import_jsx_runtime35, Image;
|
|
3290
3382
|
var init_Image = __esm({
|
|
3291
3383
|
"src/components/Image/Image.tsx"() {
|
|
3292
3384
|
"use strict";
|
|
3293
|
-
|
|
3294
|
-
|
|
3385
|
+
import_dedupe29 = __toESM(require("classnames/dedupe"));
|
|
3386
|
+
import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3295
3387
|
Image = ({
|
|
3296
3388
|
ref,
|
|
3297
3389
|
alt,
|
|
3298
3390
|
elementType: Component = "img",
|
|
3299
3391
|
...otherProps
|
|
3300
3392
|
}) => {
|
|
3301
|
-
const classes = (0,
|
|
3302
|
-
return /* @__PURE__ */ (0,
|
|
3393
|
+
const classes = (0, import_dedupe29.default)("mobius", "mobius-image", otherProps.className);
|
|
3394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Component, { alt, ref, ...otherProps, className: classes });
|
|
3303
3395
|
};
|
|
3304
3396
|
Image.displayName = "Image";
|
|
3305
3397
|
}
|
|
@@ -3314,13 +3406,13 @@ var init_Image2 = __esm({
|
|
|
3314
3406
|
});
|
|
3315
3407
|
|
|
3316
3408
|
// src/components/Link/Link.tsx
|
|
3317
|
-
var
|
|
3409
|
+
var import_dedupe30, import_Link, import_jsx_runtime36, Link;
|
|
3318
3410
|
var init_Link = __esm({
|
|
3319
3411
|
"src/components/Link/Link.tsx"() {
|
|
3320
3412
|
"use strict";
|
|
3321
|
-
|
|
3413
|
+
import_dedupe30 = __toESM(require("classnames/dedupe"));
|
|
3322
3414
|
import_Link = require("@simplybusiness/mobius/src/components/Link/Link.css");
|
|
3323
|
-
|
|
3415
|
+
import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3324
3416
|
Link = ({ ref, ...props }) => {
|
|
3325
3417
|
const {
|
|
3326
3418
|
isDisabled = false,
|
|
@@ -3334,7 +3426,7 @@ var init_Link = __esm({
|
|
|
3334
3426
|
pointerEvents: "none"
|
|
3335
3427
|
};
|
|
3336
3428
|
const styles = { ...style, ...isDisabled && disabledStyles };
|
|
3337
|
-
const classes = (0,
|
|
3429
|
+
const classes = (0, import_dedupe30.default)(
|
|
3338
3430
|
"mobius",
|
|
3339
3431
|
"mobius-link",
|
|
3340
3432
|
className,
|
|
@@ -3343,7 +3435,7 @@ var init_Link = __esm({
|
|
|
3343
3435
|
"--is-disabled": isDisabled
|
|
3344
3436
|
}
|
|
3345
3437
|
);
|
|
3346
|
-
return /* @__PURE__ */ (0,
|
|
3438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3347
3439
|
Component,
|
|
3348
3440
|
{
|
|
3349
3441
|
ref,
|
|
@@ -3368,12 +3460,12 @@ var init_Link2 = __esm({
|
|
|
3368
3460
|
});
|
|
3369
3461
|
|
|
3370
3462
|
// src/components/LinkButton/LinkButton.tsx
|
|
3371
|
-
var
|
|
3463
|
+
var import_dedupe31, import_jsx_runtime37;
|
|
3372
3464
|
var init_LinkButton = __esm({
|
|
3373
3465
|
"src/components/LinkButton/LinkButton.tsx"() {
|
|
3374
3466
|
"use strict";
|
|
3375
|
-
|
|
3376
|
-
|
|
3467
|
+
import_dedupe31 = __toESM(require("classnames/dedupe"));
|
|
3468
|
+
import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3377
3469
|
}
|
|
3378
3470
|
});
|
|
3379
3471
|
|
|
@@ -3386,14 +3478,14 @@ var init_LinkButton2 = __esm({
|
|
|
3386
3478
|
});
|
|
3387
3479
|
|
|
3388
3480
|
// src/components/List/List.tsx
|
|
3389
|
-
var
|
|
3481
|
+
var import_react27, import_dedupe32, import_List, import_jsx_runtime38, List;
|
|
3390
3482
|
var init_List = __esm({
|
|
3391
3483
|
"src/components/List/List.tsx"() {
|
|
3392
3484
|
"use strict";
|
|
3393
|
-
|
|
3394
|
-
|
|
3485
|
+
import_react27 = require("react");
|
|
3486
|
+
import_dedupe32 = __toESM(require("classnames/dedupe"));
|
|
3395
3487
|
import_List = require("@simplybusiness/mobius/src/components/List/List.css");
|
|
3396
|
-
|
|
3488
|
+
import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3397
3489
|
List = ({ ref, ...props }) => {
|
|
3398
3490
|
const Component = props.isOrdered ? "ol" : "ul";
|
|
3399
3491
|
const { children, icon, ...otherProps } = props;
|
|
@@ -3402,7 +3494,7 @@ var init_List = __esm({
|
|
|
3402
3494
|
...restProps,
|
|
3403
3495
|
reversed: isReversed
|
|
3404
3496
|
};
|
|
3405
|
-
const classes = (0,
|
|
3497
|
+
const classes = (0, import_dedupe32.default)(
|
|
3406
3498
|
"mobius",
|
|
3407
3499
|
"mobius-list",
|
|
3408
3500
|
{
|
|
@@ -3411,9 +3503,9 @@ var init_List = __esm({
|
|
|
3411
3503
|
},
|
|
3412
3504
|
otherProps.className
|
|
3413
3505
|
);
|
|
3414
|
-
return /* @__PURE__ */ (0,
|
|
3415
|
-
if ((0,
|
|
3416
|
-
return (0,
|
|
3506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Component, { ref, ...mappedProps, className: classes, children: import_react27.Children.map(children, (child) => {
|
|
3507
|
+
if ((0, import_react27.isValidElement)(child)) {
|
|
3508
|
+
return (0, import_react27.cloneElement)(child, {
|
|
3417
3509
|
parentIcon: icon
|
|
3418
3510
|
});
|
|
3419
3511
|
}
|
|
@@ -3425,16 +3517,16 @@ var init_List = __esm({
|
|
|
3425
3517
|
});
|
|
3426
3518
|
|
|
3427
3519
|
// src/components/List/ListItem.tsx
|
|
3428
|
-
var
|
|
3520
|
+
var import_dedupe33, import_jsx_runtime39, ListItem;
|
|
3429
3521
|
var init_ListItem = __esm({
|
|
3430
3522
|
"src/components/List/ListItem.tsx"() {
|
|
3431
3523
|
"use strict";
|
|
3432
|
-
|
|
3433
|
-
|
|
3524
|
+
import_dedupe33 = __toESM(require("classnames/dedupe"));
|
|
3525
|
+
import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3434
3526
|
ListItem = ({ ref, ...props }) => {
|
|
3435
3527
|
const { parentIcon, icon, children, ...otherProps } = props;
|
|
3436
3528
|
const iconContent = icon || parentIcon;
|
|
3437
|
-
const classes = (0,
|
|
3529
|
+
const classes = (0, import_dedupe33.default)(
|
|
3438
3530
|
"mobius",
|
|
3439
3531
|
"mobius-list__item",
|
|
3440
3532
|
{
|
|
@@ -3442,15 +3534,15 @@ var init_ListItem = __esm({
|
|
|
3442
3534
|
},
|
|
3443
3535
|
props.className
|
|
3444
3536
|
);
|
|
3445
|
-
const contentClasses = (0,
|
|
3446
|
-
const iconClasses = (0,
|
|
3537
|
+
const contentClasses = (0, import_dedupe33.default)("mobius", "mobius-list__item-content");
|
|
3538
|
+
const iconClasses = (0, import_dedupe33.default)("mobius", "mobius-list__icon");
|
|
3447
3539
|
if (iconContent) {
|
|
3448
|
-
return /* @__PURE__ */ (0,
|
|
3449
|
-
/* @__PURE__ */ (0,
|
|
3540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: contentClasses, children: [
|
|
3541
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: iconClasses, children: iconContent }),
|
|
3450
3542
|
children
|
|
3451
3543
|
] }) });
|
|
3452
3544
|
}
|
|
3453
|
-
return /* @__PURE__ */ (0,
|
|
3545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { ref, ...otherProps, className: classes, children });
|
|
3454
3546
|
};
|
|
3455
3547
|
ListItem.displayName = "ListItem";
|
|
3456
3548
|
}
|
|
@@ -3466,23 +3558,23 @@ var init_List2 = __esm({
|
|
|
3466
3558
|
});
|
|
3467
3559
|
|
|
3468
3560
|
// src/components/LoadingIndicator/LoadingIndicator.tsx
|
|
3469
|
-
var
|
|
3561
|
+
var import_dedupe34, import_icons8, import_LoadingIndicator, import_jsx_runtime40, LoadingIndicator;
|
|
3470
3562
|
var init_LoadingIndicator = __esm({
|
|
3471
3563
|
"src/components/LoadingIndicator/LoadingIndicator.tsx"() {
|
|
3472
3564
|
"use strict";
|
|
3473
|
-
|
|
3565
|
+
import_dedupe34 = __toESM(require("classnames/dedupe"));
|
|
3474
3566
|
import_icons8 = require("@simplybusiness/icons");
|
|
3475
3567
|
init_Icon2();
|
|
3476
3568
|
import_LoadingIndicator = require("@simplybusiness/mobius/src/components/LoadingIndicator/LoadingIndicator.css");
|
|
3477
|
-
|
|
3569
|
+
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3478
3570
|
LoadingIndicator = ({ ref, ...props }) => {
|
|
3479
3571
|
const { icon = import_icons8.loading, ...otherProps } = props;
|
|
3480
|
-
const classes = (0,
|
|
3572
|
+
const classes = (0, import_dedupe34.default)(
|
|
3481
3573
|
"mobius",
|
|
3482
3574
|
"mobius-loading-indicator",
|
|
3483
3575
|
otherProps.className
|
|
3484
3576
|
);
|
|
3485
|
-
return /* @__PURE__ */ (0,
|
|
3577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { icon, spin: true, ref, ...otherProps, className: classes });
|
|
3486
3578
|
};
|
|
3487
3579
|
LoadingIndicator.displayName = "LoadingIndicator";
|
|
3488
3580
|
}
|
|
@@ -3497,16 +3589,16 @@ var init_LoadingIndicator2 = __esm({
|
|
|
3497
3589
|
});
|
|
3498
3590
|
|
|
3499
3591
|
// src/components/Logo/Logo.tsx
|
|
3500
|
-
var
|
|
3592
|
+
var import_dedupe35, import_jsx_runtime41, Logo;
|
|
3501
3593
|
var init_Logo = __esm({
|
|
3502
3594
|
"src/components/Logo/Logo.tsx"() {
|
|
3503
3595
|
"use strict";
|
|
3504
|
-
|
|
3505
|
-
|
|
3596
|
+
import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3597
|
+
import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3506
3598
|
Logo = ({ ref, ...props }) => {
|
|
3507
3599
|
const { className, width, height, ...otherProps } = props;
|
|
3508
|
-
const classes = (0,
|
|
3509
|
-
return /* @__PURE__ */ (0,
|
|
3600
|
+
const classes = (0, import_dedupe35.default)("mobius", "mobius-logo", className);
|
|
3601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3510
3602
|
"svg",
|
|
3511
3603
|
{
|
|
3512
3604
|
width,
|
|
@@ -3516,7 +3608,7 @@ var init_Logo = __esm({
|
|
|
3516
3608
|
viewBox: "0 0 144 37",
|
|
3517
3609
|
...otherProps,
|
|
3518
3610
|
children: [
|
|
3519
|
-
/* @__PURE__ */ (0,
|
|
3611
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3520
3612
|
"linearGradient",
|
|
3521
3613
|
{
|
|
3522
3614
|
id: "logo-gradient",
|
|
@@ -3525,27 +3617,27 @@ var init_Logo = __esm({
|
|
|
3525
3617
|
y1: "76.042%",
|
|
3526
3618
|
y2: "26.973%",
|
|
3527
3619
|
children: [
|
|
3528
|
-
/* @__PURE__ */ (0,
|
|
3529
|
-
/* @__PURE__ */ (0,
|
|
3620
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { stopColor: "#4632D8", offset: "0%" }),
|
|
3621
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { stopColor: "#9084E8", offset: "100%" })
|
|
3530
3622
|
]
|
|
3531
3623
|
}
|
|
3532
3624
|
) }),
|
|
3533
|
-
/* @__PURE__ */ (0,
|
|
3534
|
-
/* @__PURE__ */ (0,
|
|
3625
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("g", { children: [
|
|
3626
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3535
3627
|
"path",
|
|
3536
3628
|
{
|
|
3537
3629
|
fill: "#0E0A2B",
|
|
3538
3630
|
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
3631
|
}
|
|
3540
3632
|
),
|
|
3541
|
-
/* @__PURE__ */ (0,
|
|
3633
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3542
3634
|
"path",
|
|
3543
3635
|
{
|
|
3544
3636
|
fill: "url(#logo-gradient)",
|
|
3545
3637
|
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
3638
|
}
|
|
3547
3639
|
),
|
|
3548
|
-
/* @__PURE__ */ (0,
|
|
3640
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3549
3641
|
"path",
|
|
3550
3642
|
{
|
|
3551
3643
|
fill: "#0E0A2B",
|
|
@@ -3570,23 +3662,23 @@ var init_Logo2 = __esm({
|
|
|
3570
3662
|
});
|
|
3571
3663
|
|
|
3572
3664
|
// src/components/Modal/Content.tsx
|
|
3573
|
-
var
|
|
3665
|
+
var import_jsx_runtime42, Content2;
|
|
3574
3666
|
var init_Content2 = __esm({
|
|
3575
3667
|
"src/components/Modal/Content.tsx"() {
|
|
3576
3668
|
"use strict";
|
|
3577
|
-
|
|
3578
|
-
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
3669
|
+
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3670
|
+
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { ref, ...otherProps, className: "mobius-modal__content", children });
|
|
3579
3671
|
Content2.displayName = "Content";
|
|
3580
3672
|
}
|
|
3581
3673
|
});
|
|
3582
3674
|
|
|
3583
3675
|
// src/components/Modal/ModalContext.tsx
|
|
3584
|
-
var
|
|
3676
|
+
var import_react28, ModalContext;
|
|
3585
3677
|
var init_ModalContext = __esm({
|
|
3586
3678
|
"src/components/Modal/ModalContext.tsx"() {
|
|
3587
3679
|
"use strict";
|
|
3588
|
-
|
|
3589
|
-
ModalContext = (0,
|
|
3680
|
+
import_react28 = require("react");
|
|
3681
|
+
ModalContext = (0, import_react28.createContext)({
|
|
3590
3682
|
onClose: () => {
|
|
3591
3683
|
},
|
|
3592
3684
|
closeLabel: void 0
|
|
@@ -3595,21 +3687,21 @@ var init_ModalContext = __esm({
|
|
|
3595
3687
|
});
|
|
3596
3688
|
|
|
3597
3689
|
// src/components/Modal/useModal.ts
|
|
3598
|
-
var
|
|
3690
|
+
var import_react29, useModal;
|
|
3599
3691
|
var init_useModal = __esm({
|
|
3600
3692
|
"src/components/Modal/useModal.ts"() {
|
|
3601
3693
|
"use strict";
|
|
3602
|
-
|
|
3694
|
+
import_react29 = require("react");
|
|
3603
3695
|
init_ModalContext();
|
|
3604
3696
|
useModal = () => {
|
|
3605
|
-
const { onClose, closeLabel } = (0,
|
|
3697
|
+
const { onClose, closeLabel } = (0, import_react29.useContext)(ModalContext);
|
|
3606
3698
|
return { onClose, closeLabel };
|
|
3607
3699
|
};
|
|
3608
3700
|
}
|
|
3609
3701
|
});
|
|
3610
3702
|
|
|
3611
3703
|
// src/components/Modal/Header.tsx
|
|
3612
|
-
var import_icons9,
|
|
3704
|
+
var import_icons9, import_jsx_runtime43, Header2;
|
|
3613
3705
|
var init_Header2 = __esm({
|
|
3614
3706
|
"src/components/Modal/Header.tsx"() {
|
|
3615
3707
|
"use strict";
|
|
@@ -3617,12 +3709,12 @@ var init_Header2 = __esm({
|
|
|
3617
3709
|
init_Button2();
|
|
3618
3710
|
init_Icon2();
|
|
3619
3711
|
init_useModal();
|
|
3620
|
-
|
|
3712
|
+
import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3621
3713
|
Header2 = ({ ref, children, ...otherProps }) => {
|
|
3622
3714
|
const { onClose, closeLabel } = useModal();
|
|
3623
|
-
return /* @__PURE__ */ (0,
|
|
3715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { ref, ...otherProps, className: "mobius-modal__header", children: [
|
|
3624
3716
|
children,
|
|
3625
|
-
/* @__PURE__ */ (0,
|
|
3717
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3626
3718
|
Button,
|
|
3627
3719
|
{
|
|
3628
3720
|
"aria-label": "Close",
|
|
@@ -3630,7 +3722,7 @@ var init_Header2 = __esm({
|
|
|
3630
3722
|
onPress: onClose,
|
|
3631
3723
|
className: "mobius-modal__close",
|
|
3632
3724
|
children: [
|
|
3633
|
-
/* @__PURE__ */ (0,
|
|
3725
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { icon: import_icons9.cross }),
|
|
3634
3726
|
" ",
|
|
3635
3727
|
closeLabel
|
|
3636
3728
|
]
|
|
@@ -3643,19 +3735,19 @@ var init_Header2 = __esm({
|
|
|
3643
3735
|
});
|
|
3644
3736
|
|
|
3645
3737
|
// src/components/Modal/Modal.tsx
|
|
3646
|
-
var
|
|
3738
|
+
var import_dedupe36, import_react30, import_Modal, import_jsx_runtime44, TRANSITION_CSS_VARIABLE2, Modal;
|
|
3647
3739
|
var init_Modal = __esm({
|
|
3648
3740
|
"src/components/Modal/Modal.tsx"() {
|
|
3649
3741
|
"use strict";
|
|
3650
3742
|
"use client";
|
|
3651
|
-
|
|
3652
|
-
|
|
3743
|
+
import_dedupe36 = __toESM(require("classnames/dedupe"));
|
|
3744
|
+
import_react30 = require("react");
|
|
3653
3745
|
init_hooks();
|
|
3654
3746
|
init_utils();
|
|
3655
3747
|
init_polyfill_tests();
|
|
3656
3748
|
init_ModalContext();
|
|
3657
3749
|
import_Modal = require("@simplybusiness/mobius/src/components/Modal/Modal.css");
|
|
3658
|
-
|
|
3750
|
+
import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3659
3751
|
TRANSITION_CSS_VARIABLE2 = "--modal-transition-duration";
|
|
3660
3752
|
Modal = ({ ref, ...props }) => {
|
|
3661
3753
|
const {
|
|
@@ -3669,11 +3761,11 @@ var init_Modal = __esm({
|
|
|
3669
3761
|
animation,
|
|
3670
3762
|
...rest
|
|
3671
3763
|
} = props;
|
|
3672
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3673
|
-
(0,
|
|
3764
|
+
const [shouldTransition, setShouldTransition] = (0, import_react30.useState)(false);
|
|
3765
|
+
(0, import_react30.useEffect)(() => {
|
|
3674
3766
|
setShouldTransition(supportsDialog());
|
|
3675
3767
|
}, []);
|
|
3676
|
-
const dialogRef = (0,
|
|
3768
|
+
const dialogRef = (0, import_react30.useRef)(null);
|
|
3677
3769
|
const { close } = useDialog({
|
|
3678
3770
|
ref: dialogRef,
|
|
3679
3771
|
isOpen,
|
|
@@ -3684,7 +3776,7 @@ var init_Modal = __esm({
|
|
|
3684
3776
|
CSSVariable: TRANSITION_CSS_VARIABLE2
|
|
3685
3777
|
}
|
|
3686
3778
|
});
|
|
3687
|
-
const modalClasses = (0,
|
|
3779
|
+
const modalClasses = (0, import_dedupe36.default)(
|
|
3688
3780
|
"mobius",
|
|
3689
3781
|
"mobius-modal",
|
|
3690
3782
|
{
|
|
@@ -3697,21 +3789,21 @@ var init_Modal = __esm({
|
|
|
3697
3789
|
},
|
|
3698
3790
|
className
|
|
3699
3791
|
);
|
|
3700
|
-
const contextValue = (0,
|
|
3792
|
+
const contextValue = (0, import_react30.useMemo)(
|
|
3701
3793
|
() => ({
|
|
3702
3794
|
onClose: close,
|
|
3703
3795
|
closeLabel
|
|
3704
3796
|
}),
|
|
3705
3797
|
[close, closeLabel]
|
|
3706
3798
|
);
|
|
3707
|
-
return /* @__PURE__ */ (0,
|
|
3799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3708
3800
|
"dialog",
|
|
3709
3801
|
{
|
|
3710
3802
|
ref: mergeRefs([dialogRef, ref]),
|
|
3711
3803
|
onCancel: close,
|
|
3712
3804
|
className: modalClasses,
|
|
3713
3805
|
...rest,
|
|
3714
|
-
children: /* @__PURE__ */ (0,
|
|
3806
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ModalContext.Provider, { value: contextValue, children })
|
|
3715
3807
|
}
|
|
3716
3808
|
);
|
|
3717
3809
|
};
|
|
@@ -3736,16 +3828,16 @@ var init_Modal2 = __esm({
|
|
|
3736
3828
|
});
|
|
3737
3829
|
|
|
3738
3830
|
// src/components/NumberField/NumberField.tsx
|
|
3739
|
-
var
|
|
3831
|
+
var import_dedupe37, import_react31, import_NumberField, import_jsx_runtime45, NumberField;
|
|
3740
3832
|
var init_NumberField = __esm({
|
|
3741
3833
|
"src/components/NumberField/NumberField.tsx"() {
|
|
3742
3834
|
"use strict";
|
|
3743
3835
|
"use client";
|
|
3744
|
-
|
|
3745
|
-
|
|
3836
|
+
import_dedupe37 = __toESM(require("classnames/dedupe"));
|
|
3837
|
+
import_react31 = require("react");
|
|
3746
3838
|
init_TextField2();
|
|
3747
3839
|
import_NumberField = require("@simplybusiness/mobius/src/components/NumberField/NumberField.css");
|
|
3748
|
-
|
|
3840
|
+
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3749
3841
|
NumberField = ({ ref, ...props }) => {
|
|
3750
3842
|
const {
|
|
3751
3843
|
minValue,
|
|
@@ -3761,15 +3853,15 @@ var init_NumberField = __esm({
|
|
|
3761
3853
|
onBlur: customOnBlur,
|
|
3762
3854
|
...rest
|
|
3763
3855
|
} = otherProps;
|
|
3764
|
-
const focusedInputRef = (0,
|
|
3765
|
-
const wheelHandler = (0,
|
|
3766
|
-
(0,
|
|
3856
|
+
const focusedInputRef = (0, import_react31.useRef)(null);
|
|
3857
|
+
const wheelHandler = (0, import_react31.useCallback)((ev) => ev.preventDefault(), []);
|
|
3858
|
+
(0, import_react31.useEffect)(() => {
|
|
3767
3859
|
return () => {
|
|
3768
3860
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
3769
3861
|
focusedInputRef.current = null;
|
|
3770
3862
|
};
|
|
3771
3863
|
}, [wheelHandler]);
|
|
3772
|
-
const containerClasses = (0,
|
|
3864
|
+
const containerClasses = (0, import_dedupe37.default)("mobius-number-field", className, {
|
|
3773
3865
|
"--hide-spin-buttons": hideSpinButtons
|
|
3774
3866
|
});
|
|
3775
3867
|
const handleBeforeInput = (event) => {
|
|
@@ -3813,7 +3905,7 @@ var init_NumberField = __esm({
|
|
|
3813
3905
|
},
|
|
3814
3906
|
onBlur: (e) => handleBlur(e)
|
|
3815
3907
|
};
|
|
3816
|
-
return /* @__PURE__ */ (0,
|
|
3908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3817
3909
|
TextField,
|
|
3818
3910
|
{
|
|
3819
3911
|
...forwardedProps,
|
|
@@ -3841,18 +3933,18 @@ var init_NumberField2 = __esm({
|
|
|
3841
3933
|
});
|
|
3842
3934
|
|
|
3843
3935
|
// src/components/Option/Option.tsx
|
|
3844
|
-
var
|
|
3936
|
+
var import_jsx_runtime46, Option2;
|
|
3845
3937
|
var init_Option2 = __esm({
|
|
3846
3938
|
"src/components/Option/Option.tsx"() {
|
|
3847
3939
|
"use strict";
|
|
3848
|
-
|
|
3940
|
+
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3849
3941
|
Option2 = ({ ref, ...props }) => {
|
|
3850
3942
|
const { isDisabled, ...rest } = props;
|
|
3851
3943
|
const mappedProps = {
|
|
3852
3944
|
...rest,
|
|
3853
3945
|
disabled: isDisabled
|
|
3854
3946
|
};
|
|
3855
|
-
return /* @__PURE__ */ (0,
|
|
3947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { ...mappedProps, ref });
|
|
3856
3948
|
};
|
|
3857
3949
|
Option2.displayName = "Option";
|
|
3858
3950
|
}
|
|
@@ -3867,17 +3959,17 @@ var init_Option3 = __esm({
|
|
|
3867
3959
|
});
|
|
3868
3960
|
|
|
3869
3961
|
// src/components/PasswordField/ShowHideButton.tsx
|
|
3870
|
-
var import_icons10,
|
|
3962
|
+
var import_icons10, import_jsx_runtime47, ShowHideButton;
|
|
3871
3963
|
var init_ShowHideButton = __esm({
|
|
3872
3964
|
"src/components/PasswordField/ShowHideButton.tsx"() {
|
|
3873
3965
|
"use strict";
|
|
3874
3966
|
import_icons10 = require("@simplybusiness/icons");
|
|
3875
3967
|
init_src();
|
|
3876
|
-
|
|
3968
|
+
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3877
3969
|
ShowHideButton = ({
|
|
3878
3970
|
show = false,
|
|
3879
3971
|
onClick
|
|
3880
|
-
}) => /* @__PURE__ */ (0,
|
|
3972
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3881
3973
|
"button",
|
|
3882
3974
|
{
|
|
3883
3975
|
className: "mobius-password-field__show-button",
|
|
@@ -3888,35 +3980,35 @@ var init_ShowHideButton = __esm({
|
|
|
3888
3980
|
},
|
|
3889
3981
|
"aria-label": `${show ? "Hide" : "Show"} password`,
|
|
3890
3982
|
"data-testid": "show-hide-button",
|
|
3891
|
-
children: /* @__PURE__ */ (0,
|
|
3983
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { icon: show ? import_icons10.eyeSlash : import_icons10.eye, "aria-hidden": "true" })
|
|
3892
3984
|
}
|
|
3893
3985
|
);
|
|
3894
3986
|
}
|
|
3895
3987
|
});
|
|
3896
3988
|
|
|
3897
3989
|
// src/components/PasswordField/PasswordField.tsx
|
|
3898
|
-
var
|
|
3990
|
+
var import_dedupe38, import_react32, import_PasswordField, import_jsx_runtime48, PasswordField;
|
|
3899
3991
|
var init_PasswordField = __esm({
|
|
3900
3992
|
"src/components/PasswordField/PasswordField.tsx"() {
|
|
3901
3993
|
"use strict";
|
|
3902
3994
|
"use client";
|
|
3903
|
-
|
|
3904
|
-
|
|
3995
|
+
import_dedupe38 = __toESM(require("classnames/dedupe"));
|
|
3996
|
+
import_react32 = require("react");
|
|
3905
3997
|
init_mergeRefs();
|
|
3906
3998
|
init_TextField2();
|
|
3907
3999
|
init_ShowHideButton();
|
|
3908
4000
|
import_PasswordField = require("@simplybusiness/mobius/src/components/PasswordField/PasswordField.css");
|
|
3909
|
-
|
|
4001
|
+
import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3910
4002
|
PasswordField = ({
|
|
3911
4003
|
ref,
|
|
3912
4004
|
className,
|
|
3913
4005
|
autoComplete = "current-password",
|
|
3914
4006
|
...props
|
|
3915
4007
|
}) => {
|
|
3916
|
-
const [show, setShow] = (0,
|
|
4008
|
+
const [show, setShow] = (0, import_react32.useState)(false);
|
|
3917
4009
|
const type = show ? "text" : "password";
|
|
3918
|
-
const classes = (0,
|
|
3919
|
-
const localRef = (0,
|
|
4010
|
+
const classes = (0, import_dedupe38.default)("mobius-password-field", className);
|
|
4011
|
+
const localRef = (0, import_react32.useRef)(null);
|
|
3920
4012
|
const handleShowHideButtonClick = () => {
|
|
3921
4013
|
const selectionStart = localRef.current?.selectionStart;
|
|
3922
4014
|
const selectionEnd = localRef.current?.selectionEnd;
|
|
@@ -3928,7 +4020,7 @@ var init_PasswordField = __esm({
|
|
|
3928
4020
|
}
|
|
3929
4021
|
});
|
|
3930
4022
|
};
|
|
3931
|
-
return /* @__PURE__ */ (0,
|
|
4023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3932
4024
|
TextField,
|
|
3933
4025
|
{
|
|
3934
4026
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -3936,7 +4028,7 @@ var init_PasswordField = __esm({
|
|
|
3936
4028
|
...props,
|
|
3937
4029
|
autoComplete,
|
|
3938
4030
|
type,
|
|
3939
|
-
suffixInside: /* @__PURE__ */ (0,
|
|
4031
|
+
suffixInside: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ShowHideButton, { onClick: handleShowHideButtonClick, show })
|
|
3940
4032
|
}
|
|
3941
4033
|
);
|
|
3942
4034
|
};
|
|
@@ -3953,17 +4045,17 @@ var init_PasswordField2 = __esm({
|
|
|
3953
4045
|
});
|
|
3954
4046
|
|
|
3955
4047
|
// src/components/Popover/Popover.tsx
|
|
3956
|
-
var
|
|
4048
|
+
var import_react33, import_icons11, import_dedupe39, import_react34, import_mobius_hooks6, import_Popover, import_jsx_runtime49;
|
|
3957
4049
|
var init_Popover = __esm({
|
|
3958
4050
|
"src/components/Popover/Popover.tsx"() {
|
|
3959
4051
|
"use strict";
|
|
3960
|
-
|
|
4052
|
+
import_react33 = require("@floating-ui/react");
|
|
3961
4053
|
import_icons11 = require("@simplybusiness/icons");
|
|
3962
|
-
|
|
3963
|
-
|
|
4054
|
+
import_dedupe39 = __toESM(require("classnames/dedupe"));
|
|
4055
|
+
import_react34 = require("react");
|
|
3964
4056
|
import_mobius_hooks6 = require("@simplybusiness/mobius-hooks");
|
|
3965
4057
|
import_Popover = require("@simplybusiness/mobius/src/components/Popover/Popover.css");
|
|
3966
|
-
|
|
4058
|
+
import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3967
4059
|
}
|
|
3968
4060
|
});
|
|
3969
4061
|
|
|
@@ -3987,17 +4079,17 @@ function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
|
3987
4079
|
console.warn("Progress value is greater than maxValue");
|
|
3988
4080
|
}
|
|
3989
4081
|
}
|
|
3990
|
-
var
|
|
4082
|
+
var import_dedupe40, import_react35, import_Progress, import_jsx_runtime50, sanitizedValue, getLabelComponent, DEFAULT_VALUE, DEFAULT_MIN_VALUE, DEFAULT_MAX_VALUE, Progress;
|
|
3991
4083
|
var init_Progress = __esm({
|
|
3992
4084
|
"src/components/Progress/Progress.tsx"() {
|
|
3993
4085
|
"use strict";
|
|
3994
4086
|
"use client";
|
|
3995
|
-
|
|
3996
|
-
|
|
4087
|
+
import_dedupe40 = __toESM(require("classnames/dedupe"));
|
|
4088
|
+
import_react35 = require("react");
|
|
3997
4089
|
init_Label2();
|
|
3998
4090
|
init_VisuallyHidden2();
|
|
3999
4091
|
import_Progress = require("@simplybusiness/mobius/src/components/Progress/Progress.css");
|
|
4000
|
-
|
|
4092
|
+
import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4001
4093
|
sanitizedValue = (value, defaultValue) => {
|
|
4002
4094
|
if (value === void 0 || Number.isNaN(value)) {
|
|
4003
4095
|
return defaultValue;
|
|
@@ -4006,7 +4098,7 @@ var init_Progress = __esm({
|
|
|
4006
4098
|
};
|
|
4007
4099
|
getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
4008
4100
|
if (showLabel) {
|
|
4009
|
-
return /* @__PURE__ */ (0,
|
|
4101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4010
4102
|
Label,
|
|
4011
4103
|
{
|
|
4012
4104
|
id: progressLabelId,
|
|
@@ -4016,7 +4108,7 @@ var init_Progress = __esm({
|
|
|
4016
4108
|
}
|
|
4017
4109
|
);
|
|
4018
4110
|
}
|
|
4019
|
-
return /* @__PURE__ */ (0,
|
|
4111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4020
4112
|
Label,
|
|
4021
4113
|
{
|
|
4022
4114
|
id: progressLabelId,
|
|
@@ -4030,8 +4122,8 @@ var init_Progress = __esm({
|
|
|
4030
4122
|
DEFAULT_MIN_VALUE = 0;
|
|
4031
4123
|
DEFAULT_MAX_VALUE = 100;
|
|
4032
4124
|
Progress = ({ ref, ...props }) => {
|
|
4033
|
-
const progressId = (0,
|
|
4034
|
-
const progressLabelId = (0,
|
|
4125
|
+
const progressId = (0, import_react35.useId)();
|
|
4126
|
+
const progressLabelId = (0, import_react35.useId)();
|
|
4035
4127
|
const {
|
|
4036
4128
|
id,
|
|
4037
4129
|
label,
|
|
@@ -4056,7 +4148,7 @@ var init_Progress = __esm({
|
|
|
4056
4148
|
100
|
|
4057
4149
|
);
|
|
4058
4150
|
const barWidth = `${percentage}%`;
|
|
4059
|
-
const classes = (0,
|
|
4151
|
+
const classes = (0, import_dedupe40.default)("mobius", "mobius-progress", className, {
|
|
4060
4152
|
"--is-primary": variant === "primary",
|
|
4061
4153
|
"--is-secondary": variant === "secondary"
|
|
4062
4154
|
});
|
|
@@ -4066,7 +4158,7 @@ var init_Progress = __esm({
|
|
|
4066
4158
|
progressBarProps["aria-valuenow"] = value.toString();
|
|
4067
4159
|
progressBarProps["aria-valuetext"] = valueFormatter instanceof Function ? valueFormatter(value, minValue, maxValue) : barWidth;
|
|
4068
4160
|
const labelComponent = getLabelComponent(label, progressLabelId, showLabel);
|
|
4069
|
-
return /* @__PURE__ */ (0,
|
|
4161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4070
4162
|
"div",
|
|
4071
4163
|
{
|
|
4072
4164
|
id: id || progressId,
|
|
@@ -4077,8 +4169,8 @@ var init_Progress = __esm({
|
|
|
4077
4169
|
"aria-labelledby": progressLabelId,
|
|
4078
4170
|
children: [
|
|
4079
4171
|
labelComponent,
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4081
|
-
showValueLabel && /* @__PURE__ */ (0,
|
|
4172
|
+
/* @__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 } }) }),
|
|
4173
|
+
showValueLabel && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
|
|
4082
4174
|
]
|
|
4083
4175
|
}
|
|
4084
4176
|
);
|
|
@@ -4096,17 +4188,17 @@ var init_Progress2 = __esm({
|
|
|
4096
4188
|
});
|
|
4097
4189
|
|
|
4098
4190
|
// src/components/Radio/Radio.tsx
|
|
4099
|
-
var
|
|
4191
|
+
var import_dedupe41, import_react36, import_Radio, import_jsx_runtime51, Radio;
|
|
4100
4192
|
var init_Radio = __esm({
|
|
4101
4193
|
"src/components/Radio/Radio.tsx"() {
|
|
4102
4194
|
"use strict";
|
|
4103
4195
|
"use client";
|
|
4104
|
-
|
|
4105
|
-
|
|
4196
|
+
import_dedupe41 = __toESM(require("classnames/dedupe"));
|
|
4197
|
+
import_react36 = require("react");
|
|
4106
4198
|
init_ErrorMessage2();
|
|
4107
4199
|
init_Label2();
|
|
4108
4200
|
import_Radio = require("@simplybusiness/mobius/src/components/Radio/Radio.css");
|
|
4109
|
-
|
|
4201
|
+
import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4110
4202
|
Radio = ({ ref, ...props }) => {
|
|
4111
4203
|
const {
|
|
4112
4204
|
children,
|
|
@@ -4130,19 +4222,19 @@ var init_Radio = __esm({
|
|
|
4130
4222
|
const isMultiline = label && children;
|
|
4131
4223
|
const isControlled = selected !== void 0;
|
|
4132
4224
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
4133
|
-
const contentRef = (0,
|
|
4134
|
-
const prevOverflowRef = (0,
|
|
4225
|
+
const contentRef = (0, import_react36.useRef)(null);
|
|
4226
|
+
const prevOverflowRef = (0, import_react36.useRef)({
|
|
4135
4227
|
vertical: false,
|
|
4136
4228
|
horizontal: false
|
|
4137
4229
|
});
|
|
4138
|
-
const hasIconFirst = (0,
|
|
4139
|
-
if (!children ||
|
|
4140
|
-
const firstChild =
|
|
4141
|
-
if (!(0,
|
|
4230
|
+
const hasIconFirst = (0, import_react36.useMemo)(() => {
|
|
4231
|
+
if (!children || import_react36.Children.count(children) === 0) return false;
|
|
4232
|
+
const firstChild = import_react36.Children.toArray(children)[0];
|
|
4233
|
+
if (!(0, import_react36.isValidElement)(firstChild)) return false;
|
|
4142
4234
|
const props2 = firstChild.props;
|
|
4143
4235
|
return "icon" in props2 && props2.icon !== void 0;
|
|
4144
4236
|
}, [children]);
|
|
4145
|
-
(0,
|
|
4237
|
+
(0, import_react36.useLayoutEffect)(() => {
|
|
4146
4238
|
if (!contentRef.current || !onOverflow) return;
|
|
4147
4239
|
if (orientation === "vertical") {
|
|
4148
4240
|
return;
|
|
@@ -4171,13 +4263,13 @@ var init_Radio = __esm({
|
|
|
4171
4263
|
"--is-multiline": !!isMultiline,
|
|
4172
4264
|
"--is-required": isRequired
|
|
4173
4265
|
};
|
|
4174
|
-
const containerClasses = (0,
|
|
4266
|
+
const containerClasses = (0, import_dedupe41.default)(
|
|
4175
4267
|
"mobius-radio__label",
|
|
4176
4268
|
radioClasses,
|
|
4177
4269
|
className,
|
|
4178
4270
|
{ "--has-icon-first": hasIconFirst }
|
|
4179
4271
|
);
|
|
4180
|
-
const inputClasses = (0,
|
|
4272
|
+
const inputClasses = (0, import_dedupe41.default)("mobius-radio__input", radioClasses);
|
|
4181
4273
|
const { "aria-describedby": _ariaDescribedBy, ...rest } = otherProps;
|
|
4182
4274
|
const handleChange = (event) => {
|
|
4183
4275
|
if (setSelected) {
|
|
@@ -4191,9 +4283,9 @@ var init_Radio = __esm({
|
|
|
4191
4283
|
onChange(adaptedEvent);
|
|
4192
4284
|
}
|
|
4193
4285
|
};
|
|
4194
|
-
return /* @__PURE__ */ (0,
|
|
4195
|
-
/* @__PURE__ */ (0,
|
|
4196
|
-
/* @__PURE__ */ (0,
|
|
4286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
4287
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Label, { className: containerClasses, children: [
|
|
4288
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4197
4289
|
"input",
|
|
4198
4290
|
{
|
|
4199
4291
|
"aria-describedby": otherProps["aria-describedby"],
|
|
@@ -4210,12 +4302,12 @@ var init_Radio = __esm({
|
|
|
4210
4302
|
...rest
|
|
4211
4303
|
}
|
|
4212
4304
|
),
|
|
4213
|
-
isMultiline ? /* @__PURE__ */ (0,
|
|
4214
|
-
/* @__PURE__ */ (0,
|
|
4215
|
-
/* @__PURE__ */ (0,
|
|
4216
|
-
] }) : /* @__PURE__ */ (0,
|
|
4305
|
+
isMultiline ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { ref: contentRef, className: "mobius-radio__content--multiline", children: [
|
|
4306
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mobius-radio__content-first-line", children: label }),
|
|
4307
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mobius-radio__extra-content", children })
|
|
4308
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { ref: contentRef, className: "mobius-radio__content", children: label || children })
|
|
4217
4309
|
] }),
|
|
4218
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
4310
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ErrorMessage, { errorMessage })
|
|
4219
4311
|
] });
|
|
4220
4312
|
};
|
|
4221
4313
|
Radio.displayName = "Radio";
|
|
@@ -4223,19 +4315,19 @@ var init_Radio = __esm({
|
|
|
4223
4315
|
});
|
|
4224
4316
|
|
|
4225
4317
|
// src/components/Radio/RadioGroup.tsx
|
|
4226
|
-
var
|
|
4318
|
+
var import_dedupe42, import_react37, import_jsx_runtime52, getDefaultVal, RadioGroup;
|
|
4227
4319
|
var init_RadioGroup = __esm({
|
|
4228
4320
|
"src/components/Radio/RadioGroup.tsx"() {
|
|
4229
4321
|
"use strict";
|
|
4230
4322
|
"use client";
|
|
4231
|
-
|
|
4232
|
-
|
|
4323
|
+
import_dedupe42 = __toESM(require("classnames/dedupe"));
|
|
4324
|
+
import_react37 = require("react");
|
|
4233
4325
|
init_hooks();
|
|
4234
4326
|
init_spaceDelimitedList();
|
|
4235
4327
|
init_ErrorMessage2();
|
|
4236
4328
|
init_Label2();
|
|
4237
4329
|
init_Stack2();
|
|
4238
|
-
|
|
4330
|
+
import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4239
4331
|
getDefaultVal = (children, defaultValue) => {
|
|
4240
4332
|
if (Array.isArray(children) && defaultValue) {
|
|
4241
4333
|
const option = children?.find((item) => item.props.value === defaultValue);
|
|
@@ -4263,15 +4355,15 @@ var init_RadioGroup = __esm({
|
|
|
4263
4355
|
...rest
|
|
4264
4356
|
} = props;
|
|
4265
4357
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
4266
|
-
const [selected, setSelected] = (0,
|
|
4267
|
-
const overflowsRef = (0,
|
|
4268
|
-
const [hasOverflow, setHasOverflow] = (0,
|
|
4269
|
-
(0,
|
|
4358
|
+
const [selected, setSelected] = (0, import_react37.useState)(defaultSelected);
|
|
4359
|
+
const overflowsRef = (0, import_react37.useRef)({});
|
|
4360
|
+
const [hasOverflow, setHasOverflow] = (0, import_react37.useState)(false);
|
|
4361
|
+
(0, import_react37.useEffect)(() => {
|
|
4270
4362
|
if (value !== void 0) {
|
|
4271
4363
|
setSelected(value);
|
|
4272
4364
|
}
|
|
4273
4365
|
}, [value]);
|
|
4274
|
-
const handleOverflow = (0,
|
|
4366
|
+
const handleOverflow = (0, import_react37.useCallback)(
|
|
4275
4367
|
(radioValue, overflow) => {
|
|
4276
4368
|
overflowsRef.current = {
|
|
4277
4369
|
...overflowsRef.current,
|
|
@@ -4295,26 +4387,26 @@ var init_RadioGroup = __esm({
|
|
|
4295
4387
|
[`--is-${effectiveOrientation}`]: true,
|
|
4296
4388
|
[className || ""]: true
|
|
4297
4389
|
};
|
|
4298
|
-
const radioGroupClasses = (0,
|
|
4390
|
+
const radioGroupClasses = (0, import_dedupe42.default)(
|
|
4299
4391
|
"mobius",
|
|
4300
4392
|
"mobius-radio-group",
|
|
4301
4393
|
radioClasses,
|
|
4302
4394
|
validationClasses
|
|
4303
4395
|
);
|
|
4304
|
-
const radioWrapperClasses = (0,
|
|
4396
|
+
const radioWrapperClasses = (0, import_dedupe42.default)("mobius-radio__wrapper", {
|
|
4305
4397
|
[`--is-${effectiveOrientation}`]: true
|
|
4306
4398
|
});
|
|
4307
|
-
const labelClasses = (0,
|
|
4308
|
-
const errorMessageId = (0,
|
|
4309
|
-
const defaultNameAttrId = (0,
|
|
4399
|
+
const labelClasses = (0, import_dedupe42.default)(radioClasses, validationClasses);
|
|
4400
|
+
const errorMessageId = (0, import_react37.useId)();
|
|
4401
|
+
const defaultNameAttrId = (0, import_react37.useId)();
|
|
4310
4402
|
const nameAttribute = name || defaultNameAttrId;
|
|
4311
4403
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4312
4404
|
const describedBy = spaceDelimitedList([
|
|
4313
4405
|
shouldErrorMessageShow,
|
|
4314
4406
|
props["aria-describedby"]
|
|
4315
4407
|
]);
|
|
4316
|
-
const labelId = (0,
|
|
4317
|
-
return /* @__PURE__ */ (0,
|
|
4408
|
+
const labelId = (0, import_react37.useId)();
|
|
4409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4318
4410
|
"div",
|
|
4319
4411
|
{
|
|
4320
4412
|
...rest,
|
|
@@ -4330,12 +4422,12 @@ var init_RadioGroup = __esm({
|
|
|
4330
4422
|
ref,
|
|
4331
4423
|
className: radioGroupClasses,
|
|
4332
4424
|
role: "radiogroup",
|
|
4333
|
-
children: /* @__PURE__ */ (0,
|
|
4334
|
-
label && /* @__PURE__ */ (0,
|
|
4335
|
-
/* @__PURE__ */ (0,
|
|
4336
|
-
if ((0,
|
|
4425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Stack, { gap: "xs", children: [
|
|
4426
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
4427
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: radioWrapperClasses, children: import_react37.Children.map(children, (child) => {
|
|
4428
|
+
if ((0, import_react37.isValidElement)(child)) {
|
|
4337
4429
|
const childValue = child.props.value;
|
|
4338
|
-
return (0,
|
|
4430
|
+
return (0, import_react37.cloneElement)(
|
|
4339
4431
|
child,
|
|
4340
4432
|
{
|
|
4341
4433
|
orientation: effectiveOrientation,
|
|
@@ -4353,7 +4445,7 @@ var init_RadioGroup = __esm({
|
|
|
4353
4445
|
}
|
|
4354
4446
|
return child;
|
|
4355
4447
|
}) }),
|
|
4356
|
-
/* @__PURE__ */ (0,
|
|
4448
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4357
4449
|
] })
|
|
4358
4450
|
}
|
|
4359
4451
|
);
|
|
@@ -4372,47 +4464,47 @@ var init_Radio2 = __esm({
|
|
|
4372
4464
|
});
|
|
4373
4465
|
|
|
4374
4466
|
// src/components/Segment/SegmentGroup.tsx
|
|
4375
|
-
var
|
|
4467
|
+
var import_dedupe43, import_jsx_runtime53, SegmentGroup;
|
|
4376
4468
|
var init_SegmentGroup = __esm({
|
|
4377
4469
|
"src/components/Segment/SegmentGroup.tsx"() {
|
|
4378
4470
|
"use strict";
|
|
4379
|
-
|
|
4380
|
-
|
|
4471
|
+
import_dedupe43 = __toESM(require("classnames/dedupe"));
|
|
4472
|
+
import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4381
4473
|
SegmentGroup = (props) => {
|
|
4382
4474
|
const { children, horizontal, gap, className, ...rest } = props;
|
|
4383
4475
|
const gapClass = gap ? `gap-${gap}` : "";
|
|
4384
|
-
const classes = (0,
|
|
4476
|
+
const classes = (0, import_dedupe43.default)(
|
|
4385
4477
|
"mobius",
|
|
4386
4478
|
"mobius-segment-group",
|
|
4387
4479
|
className,
|
|
4388
4480
|
{ "--is-horizontal": horizontal },
|
|
4389
4481
|
gapClass
|
|
4390
4482
|
);
|
|
4391
|
-
return /* @__PURE__ */ (0,
|
|
4483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: classes, ...rest, children });
|
|
4392
4484
|
};
|
|
4393
4485
|
SegmentGroup.displayName = "SegmentGroup";
|
|
4394
4486
|
}
|
|
4395
4487
|
});
|
|
4396
4488
|
|
|
4397
4489
|
// src/components/Segment/Segment.tsx
|
|
4398
|
-
var
|
|
4490
|
+
var import_dedupe44, import_Segment, import_jsx_runtime54, Segment;
|
|
4399
4491
|
var init_Segment = __esm({
|
|
4400
4492
|
"src/components/Segment/Segment.tsx"() {
|
|
4401
4493
|
"use strict";
|
|
4402
|
-
|
|
4494
|
+
import_dedupe44 = __toESM(require("classnames/dedupe"));
|
|
4403
4495
|
import_Segment = require("@simplybusiness/mobius/src/components/Segment/Segment.css");
|
|
4404
|
-
|
|
4496
|
+
import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4405
4497
|
Segment = (props) => {
|
|
4406
4498
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
4407
|
-
const classes = (0,
|
|
4499
|
+
const classes = (0, import_dedupe44.default)(
|
|
4408
4500
|
"mobius",
|
|
4409
4501
|
"mobius-segment",
|
|
4410
4502
|
colour,
|
|
4411
4503
|
{ inverted },
|
|
4412
4504
|
className
|
|
4413
4505
|
);
|
|
4414
|
-
return /* @__PURE__ */ (0,
|
|
4415
|
-
heading && /* @__PURE__ */ (0,
|
|
4506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: classes, ...rest, children: [
|
|
4507
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mobius-segment__heading", children: heading }),
|
|
4416
4508
|
children
|
|
4417
4509
|
] });
|
|
4418
4510
|
};
|
|
@@ -4430,14 +4522,14 @@ var init_Segment2 = __esm({
|
|
|
4430
4522
|
});
|
|
4431
4523
|
|
|
4432
4524
|
// src/components/Select/Select.tsx
|
|
4433
|
-
var import_icons12,
|
|
4525
|
+
var import_icons12, import_dedupe45, import_react38, import_Select, import_jsx_runtime55, Select;
|
|
4434
4526
|
var init_Select = __esm({
|
|
4435
4527
|
"src/components/Select/Select.tsx"() {
|
|
4436
4528
|
"use strict";
|
|
4437
4529
|
"use client";
|
|
4438
4530
|
import_icons12 = require("@simplybusiness/icons");
|
|
4439
|
-
|
|
4440
|
-
|
|
4531
|
+
import_dedupe45 = __toESM(require("classnames/dedupe"));
|
|
4532
|
+
import_react38 = require("react");
|
|
4441
4533
|
init_hooks();
|
|
4442
4534
|
init_useLabel2();
|
|
4443
4535
|
init_spaceDelimitedList();
|
|
@@ -4446,7 +4538,7 @@ var init_Select = __esm({
|
|
|
4446
4538
|
init_Label2();
|
|
4447
4539
|
init_Stack2();
|
|
4448
4540
|
import_Select = require("@simplybusiness/mobius/src/components/Select/Select.css");
|
|
4449
|
-
|
|
4541
|
+
import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4450
4542
|
Select = ({ ref, ...props }) => {
|
|
4451
4543
|
const {
|
|
4452
4544
|
label,
|
|
@@ -4467,24 +4559,24 @@ var init_Select = __esm({
|
|
|
4467
4559
|
"--is-required": typeof isRequired === "boolean" && isRequired,
|
|
4468
4560
|
"--is-optional": typeof isRequired === "boolean" && !isRequired
|
|
4469
4561
|
};
|
|
4470
|
-
const sharedClasses = (0,
|
|
4471
|
-
const wrapperClasses = (0,
|
|
4562
|
+
const sharedClasses = (0, import_dedupe45.default)(validationClasses, stateClasses);
|
|
4563
|
+
const wrapperClasses = (0, import_dedupe45.default)(
|
|
4472
4564
|
"mobius-select__wrapper",
|
|
4473
4565
|
sharedClasses,
|
|
4474
4566
|
otherProps.className
|
|
4475
4567
|
);
|
|
4476
|
-
const selectClasses = (0,
|
|
4568
|
+
const selectClasses = (0, import_dedupe45.default)(
|
|
4477
4569
|
"mobius-select",
|
|
4478
4570
|
sharedClasses,
|
|
4479
4571
|
otherProps.className
|
|
4480
4572
|
);
|
|
4481
|
-
const labelClasses = (0,
|
|
4573
|
+
const labelClasses = (0, import_dedupe45.default)(
|
|
4482
4574
|
"mobius-label",
|
|
4483
4575
|
sharedClasses,
|
|
4484
4576
|
otherProps.className
|
|
4485
4577
|
);
|
|
4486
|
-
const iconClasses = (0,
|
|
4487
|
-
const errorMessageId = (0,
|
|
4578
|
+
const iconClasses = (0, import_dedupe45.default)("mobius-select__icon", sharedClasses);
|
|
4579
|
+
const errorMessageId = (0, import_react38.useId)();
|
|
4488
4580
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4489
4581
|
const describedBy = spaceDelimitedList([
|
|
4490
4582
|
shouldErrorMessageShow,
|
|
@@ -4495,10 +4587,10 @@ var init_Select = __esm({
|
|
|
4495
4587
|
onChange(e);
|
|
4496
4588
|
}
|
|
4497
4589
|
};
|
|
4498
|
-
return /* @__PURE__ */ (0,
|
|
4499
|
-
label && /* @__PURE__ */ (0,
|
|
4500
|
-
/* @__PURE__ */ (0,
|
|
4501
|
-
/* @__PURE__ */ (0,
|
|
4590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
|
|
4591
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
4592
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: wrapperClasses, children: [
|
|
4593
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4502
4594
|
"select",
|
|
4503
4595
|
{
|
|
4504
4596
|
...otherProps,
|
|
@@ -4514,9 +4606,9 @@ var init_Select = __esm({
|
|
|
4514
4606
|
onChange: handleChange
|
|
4515
4607
|
}
|
|
4516
4608
|
),
|
|
4517
|
-
/* @__PURE__ */ (0,
|
|
4609
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Icon, { icon: import_icons12.chevronDown }) })
|
|
4518
4610
|
] }),
|
|
4519
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
4611
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4520
4612
|
] });
|
|
4521
4613
|
};
|
|
4522
4614
|
Select.displayName = "Select";
|
|
@@ -4532,15 +4624,15 @@ var init_Select2 = __esm({
|
|
|
4532
4624
|
});
|
|
4533
4625
|
|
|
4534
4626
|
// src/components/Slider/Slider.tsx
|
|
4535
|
-
var
|
|
4627
|
+
var import_dedupe46, import_react39, import_Slider, import_jsx_runtime56;
|
|
4536
4628
|
var init_Slider = __esm({
|
|
4537
4629
|
"src/components/Slider/Slider.tsx"() {
|
|
4538
4630
|
"use strict";
|
|
4539
4631
|
"use client";
|
|
4540
|
-
|
|
4541
|
-
|
|
4632
|
+
import_dedupe46 = __toESM(require("classnames/dedupe"));
|
|
4633
|
+
import_react39 = require("react");
|
|
4542
4634
|
import_Slider = require("@simplybusiness/mobius/src/components/Slider/Slider.css");
|
|
4543
|
-
|
|
4635
|
+
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4544
4636
|
}
|
|
4545
4637
|
});
|
|
4546
4638
|
|
|
@@ -4553,19 +4645,19 @@ var init_Slider2 = __esm({
|
|
|
4553
4645
|
});
|
|
4554
4646
|
|
|
4555
4647
|
// src/components/SVG/SVG.tsx
|
|
4556
|
-
var
|
|
4648
|
+
var import_react40, import_dedupe47, import_jsx_runtime57, SVG;
|
|
4557
4649
|
var init_SVG = __esm({
|
|
4558
4650
|
"src/components/SVG/SVG.tsx"() {
|
|
4559
4651
|
"use strict";
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4652
|
+
import_react40 = require("react");
|
|
4653
|
+
import_dedupe47 = __toESM(require("classnames/dedupe"));
|
|
4654
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4563
4655
|
SVG = ({ ref, ...props }) => {
|
|
4564
4656
|
const { children, className, ...otherProps } = props;
|
|
4565
|
-
const classes = (0,
|
|
4566
|
-
const svgNode =
|
|
4657
|
+
const classes = (0, import_dedupe47.default)("mobius", "mobius-svg", className);
|
|
4658
|
+
const svgNode = import_react40.Children.only(children);
|
|
4567
4659
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
4568
|
-
return /* @__PURE__ */ (0,
|
|
4660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4569
4661
|
"svg",
|
|
4570
4662
|
{
|
|
4571
4663
|
viewBox,
|
|
@@ -4590,16 +4682,16 @@ var init_SVG2 = __esm({
|
|
|
4590
4682
|
});
|
|
4591
4683
|
|
|
4592
4684
|
// src/components/Switch/Switch.tsx
|
|
4593
|
-
var
|
|
4685
|
+
var import_react41, import_dedupe48, import_Switch, import_jsx_runtime58, Switch;
|
|
4594
4686
|
var init_Switch = __esm({
|
|
4595
4687
|
"src/components/Switch/Switch.tsx"() {
|
|
4596
4688
|
"use strict";
|
|
4597
4689
|
"use client";
|
|
4598
|
-
|
|
4599
|
-
|
|
4690
|
+
import_react41 = require("react");
|
|
4691
|
+
import_dedupe48 = __toESM(require("classnames/dedupe"));
|
|
4600
4692
|
init_VisuallyHidden2();
|
|
4601
4693
|
import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
|
|
4602
|
-
|
|
4694
|
+
import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4603
4695
|
Switch = ({ ref, ...props }) => {
|
|
4604
4696
|
const {
|
|
4605
4697
|
checked = false,
|
|
@@ -4608,11 +4700,11 @@ var init_Switch = __esm({
|
|
|
4608
4700
|
isDisabled = false,
|
|
4609
4701
|
...otherProps
|
|
4610
4702
|
} = props;
|
|
4611
|
-
const [enabled, setEnabled] = (0,
|
|
4612
|
-
(0,
|
|
4703
|
+
const [enabled, setEnabled] = (0, import_react41.useState)(checked);
|
|
4704
|
+
(0, import_react41.useEffect)(() => {
|
|
4613
4705
|
setEnabled(checked);
|
|
4614
4706
|
}, [checked]);
|
|
4615
|
-
const classes = (0,
|
|
4707
|
+
const classes = (0, import_dedupe48.default)(
|
|
4616
4708
|
"mobius",
|
|
4617
4709
|
"mobius-switch",
|
|
4618
4710
|
{
|
|
@@ -4627,9 +4719,9 @@ var init_Switch = __esm({
|
|
|
4627
4719
|
onChange(event);
|
|
4628
4720
|
}
|
|
4629
4721
|
};
|
|
4630
|
-
return /* @__PURE__ */ (0,
|
|
4631
|
-
/* @__PURE__ */ (0,
|
|
4632
|
-
/* @__PURE__ */ (0,
|
|
4722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("label", { ref, className: classes, children: [
|
|
4723
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: enabled ? "On" : "Off" }) }),
|
|
4724
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4633
4725
|
"input",
|
|
4634
4726
|
{
|
|
4635
4727
|
type: "checkbox",
|
|
@@ -4640,7 +4732,7 @@ var init_Switch = __esm({
|
|
|
4640
4732
|
...otherProps
|
|
4641
4733
|
}
|
|
4642
4734
|
),
|
|
4643
|
-
/* @__PURE__ */ (0,
|
|
4735
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "mobius-switch__slider" })
|
|
4644
4736
|
] });
|
|
4645
4737
|
};
|
|
4646
4738
|
Switch.displayName = "Switch";
|
|
@@ -4656,114 +4748,114 @@ var init_Switch2 = __esm({
|
|
|
4656
4748
|
});
|
|
4657
4749
|
|
|
4658
4750
|
// src/components/Table/Table.tsx
|
|
4659
|
-
var
|
|
4751
|
+
var import_dedupe49, import_Table, import_jsx_runtime59, Table;
|
|
4660
4752
|
var init_Table = __esm({
|
|
4661
4753
|
"src/components/Table/Table.tsx"() {
|
|
4662
4754
|
"use strict";
|
|
4663
|
-
|
|
4755
|
+
import_dedupe49 = __toESM(require("classnames/dedupe"));
|
|
4664
4756
|
import_Table = require("@simplybusiness/mobius/src/components/Table/Table.css");
|
|
4665
|
-
|
|
4757
|
+
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4666
4758
|
Table = ({ ref, ...props }) => {
|
|
4667
|
-
const classes = (0,
|
|
4668
|
-
return /* @__PURE__ */ (0,
|
|
4759
|
+
const classes = (0, import_dedupe49.default)("mobius", "mobius-table", props.className);
|
|
4760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("table", { ref, ...props, className: classes });
|
|
4669
4761
|
};
|
|
4670
4762
|
Table.displayName = "Table";
|
|
4671
4763
|
}
|
|
4672
4764
|
});
|
|
4673
4765
|
|
|
4674
4766
|
// src/components/Table/Head.tsx
|
|
4675
|
-
var
|
|
4767
|
+
var import_dedupe50, import_jsx_runtime60, Head;
|
|
4676
4768
|
var init_Head = __esm({
|
|
4677
4769
|
"src/components/Table/Head.tsx"() {
|
|
4678
4770
|
"use strict";
|
|
4679
|
-
|
|
4680
|
-
|
|
4771
|
+
import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
4772
|
+
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4681
4773
|
Head = ({ ref, ...props }) => {
|
|
4682
|
-
const classes = (0,
|
|
4683
|
-
return /* @__PURE__ */ (0,
|
|
4774
|
+
const classes = (0, import_dedupe50.default)("mobius", "mobius-table__head", props.className);
|
|
4775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("thead", { ref, ...props, className: classes });
|
|
4684
4776
|
};
|
|
4685
4777
|
Head.displayName = "Table.Head";
|
|
4686
4778
|
}
|
|
4687
4779
|
});
|
|
4688
4780
|
|
|
4689
4781
|
// src/components/Table/Body.tsx
|
|
4690
|
-
var
|
|
4782
|
+
var import_dedupe51, import_jsx_runtime61, Body;
|
|
4691
4783
|
var init_Body = __esm({
|
|
4692
4784
|
"src/components/Table/Body.tsx"() {
|
|
4693
4785
|
"use strict";
|
|
4694
|
-
|
|
4695
|
-
|
|
4786
|
+
import_dedupe51 = __toESM(require("classnames/dedupe"));
|
|
4787
|
+
import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4696
4788
|
Body = ({ ref, ...props }) => {
|
|
4697
|
-
const classes = (0,
|
|
4698
|
-
return /* @__PURE__ */ (0,
|
|
4789
|
+
const classes = (0, import_dedupe51.default)("mobius", "mobius-table__body", props.className);
|
|
4790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("tbody", { ref, ...props, className: classes });
|
|
4699
4791
|
};
|
|
4700
4792
|
Body.displayName = "Table.Body";
|
|
4701
4793
|
}
|
|
4702
4794
|
});
|
|
4703
4795
|
|
|
4704
4796
|
// src/components/Table/Foot.tsx
|
|
4705
|
-
var
|
|
4797
|
+
var import_dedupe52, import_jsx_runtime62, Foot;
|
|
4706
4798
|
var init_Foot = __esm({
|
|
4707
4799
|
"src/components/Table/Foot.tsx"() {
|
|
4708
4800
|
"use strict";
|
|
4709
|
-
|
|
4710
|
-
|
|
4801
|
+
import_dedupe52 = __toESM(require("classnames/dedupe"));
|
|
4802
|
+
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4711
4803
|
Foot = ({ ref, ...props }) => {
|
|
4712
|
-
const classes = (0,
|
|
4713
|
-
return /* @__PURE__ */ (0,
|
|
4804
|
+
const classes = (0, import_dedupe52.default)("mobius", "mobius-table__foot", props.className);
|
|
4805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tfoot", { ref, ...props, className: classes });
|
|
4714
4806
|
};
|
|
4715
4807
|
Foot.displayName = "Table.Foot";
|
|
4716
4808
|
}
|
|
4717
4809
|
});
|
|
4718
4810
|
|
|
4719
4811
|
// src/components/Table/Row.tsx
|
|
4720
|
-
var
|
|
4812
|
+
var import_dedupe53, import_jsx_runtime63, Row;
|
|
4721
4813
|
var init_Row = __esm({
|
|
4722
4814
|
"src/components/Table/Row.tsx"() {
|
|
4723
4815
|
"use strict";
|
|
4724
|
-
|
|
4725
|
-
|
|
4816
|
+
import_dedupe53 = __toESM(require("classnames/dedupe"));
|
|
4817
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4726
4818
|
Row = ({ ref, ...props }) => {
|
|
4727
|
-
const classes = (0,
|
|
4728
|
-
return /* @__PURE__ */ (0,
|
|
4819
|
+
const classes = (0, import_dedupe53.default)("mobius", "mobius-table__row", props.className);
|
|
4820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("tr", { ref, ...props, className: classes });
|
|
4729
4821
|
};
|
|
4730
4822
|
Row.displayName = "Table.Row";
|
|
4731
4823
|
}
|
|
4732
4824
|
});
|
|
4733
4825
|
|
|
4734
4826
|
// src/components/Table/HeaderCell.tsx
|
|
4735
|
-
var
|
|
4827
|
+
var import_dedupe54, import_jsx_runtime64, HeaderCell;
|
|
4736
4828
|
var init_HeaderCell = __esm({
|
|
4737
4829
|
"src/components/Table/HeaderCell.tsx"() {
|
|
4738
4830
|
"use strict";
|
|
4739
|
-
|
|
4740
|
-
|
|
4831
|
+
import_dedupe54 = __toESM(require("classnames/dedupe"));
|
|
4832
|
+
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4741
4833
|
HeaderCell = ({ ref, ...props }) => {
|
|
4742
|
-
const classes = (0,
|
|
4834
|
+
const classes = (0, import_dedupe54.default)(
|
|
4743
4835
|
"mobius",
|
|
4744
4836
|
"mobius-table__head-cell",
|
|
4745
4837
|
props.className
|
|
4746
4838
|
);
|
|
4747
|
-
return /* @__PURE__ */ (0,
|
|
4839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("th", { ...props, ref, className: classes });
|
|
4748
4840
|
};
|
|
4749
4841
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
4750
4842
|
}
|
|
4751
4843
|
});
|
|
4752
4844
|
|
|
4753
4845
|
// src/components/Table/Cell.tsx
|
|
4754
|
-
var
|
|
4846
|
+
var import_dedupe55, import_jsx_runtime65, Cell;
|
|
4755
4847
|
var init_Cell = __esm({
|
|
4756
4848
|
"src/components/Table/Cell.tsx"() {
|
|
4757
4849
|
"use strict";
|
|
4758
|
-
|
|
4759
|
-
|
|
4850
|
+
import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
4851
|
+
import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4760
4852
|
Cell = ({ ref, ...props }) => {
|
|
4761
|
-
const classes = (0,
|
|
4853
|
+
const classes = (0, import_dedupe55.default)(
|
|
4762
4854
|
"mobius",
|
|
4763
4855
|
"mobius-table__body-cell",
|
|
4764
4856
|
props.className
|
|
4765
4857
|
);
|
|
4766
|
-
return /* @__PURE__ */ (0,
|
|
4858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("td", { ref, ...props, className: classes });
|
|
4767
4859
|
};
|
|
4768
4860
|
Cell.displayName = "Table.Cell";
|
|
4769
4861
|
}
|
|
@@ -4793,37 +4885,6 @@ var init_Table2 = __esm({
|
|
|
4793
4885
|
}
|
|
4794
4886
|
});
|
|
4795
4887
|
|
|
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
4888
|
// src/components/Text/index.tsx
|
|
4828
4889
|
var init_Text2 = __esm({
|
|
4829
4890
|
"src/components/Text/index.tsx"() {
|
|
@@ -4833,12 +4894,12 @@ var init_Text2 = __esm({
|
|
|
4833
4894
|
});
|
|
4834
4895
|
|
|
4835
4896
|
// src/components/TextAreaInput/TextAreaInput.tsx
|
|
4836
|
-
var import_dedupe56,
|
|
4897
|
+
var import_dedupe56, import_jsx_runtime66, TextAreaInput;
|
|
4837
4898
|
var init_TextAreaInput = __esm({
|
|
4838
4899
|
"src/components/TextAreaInput/TextAreaInput.tsx"() {
|
|
4839
4900
|
"use strict";
|
|
4840
4901
|
import_dedupe56 = __toESM(require("classnames/dedupe"));
|
|
4841
|
-
|
|
4902
|
+
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4842
4903
|
TextAreaInput = ({ ref, ...props }) => {
|
|
4843
4904
|
const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
|
|
4844
4905
|
const classes = (0, import_dedupe56.default)(
|
|
@@ -4851,7 +4912,7 @@ var init_TextAreaInput = __esm({
|
|
|
4851
4912
|
},
|
|
4852
4913
|
otherProps.className
|
|
4853
4914
|
);
|
|
4854
|
-
return /* @__PURE__ */ (0,
|
|
4915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4855
4916
|
"textarea",
|
|
4856
4917
|
{
|
|
4857
4918
|
ref,
|
|
@@ -4875,7 +4936,7 @@ var init_TextAreaInput2 = __esm({
|
|
|
4875
4936
|
});
|
|
4876
4937
|
|
|
4877
4938
|
// src/components/TextArea/TextArea.tsx
|
|
4878
|
-
var import_dedupe57, import_TextArea,
|
|
4939
|
+
var import_dedupe57, import_TextArea, import_jsx_runtime67, TextArea;
|
|
4879
4940
|
var init_TextArea = __esm({
|
|
4880
4941
|
"src/components/TextArea/TextArea.tsx"() {
|
|
4881
4942
|
"use strict";
|
|
@@ -4887,7 +4948,7 @@ var init_TextArea = __esm({
|
|
|
4887
4948
|
init_Stack2();
|
|
4888
4949
|
init_TextAreaInput2();
|
|
4889
4950
|
import_TextArea = require("@simplybusiness/mobius/src/components/TextArea/TextArea.css");
|
|
4890
|
-
|
|
4951
|
+
import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4891
4952
|
TextArea = ({ ref, ...props }) => {
|
|
4892
4953
|
const {
|
|
4893
4954
|
isDisabled,
|
|
@@ -4907,9 +4968,9 @@ var init_TextArea = __esm({
|
|
|
4907
4968
|
},
|
|
4908
4969
|
validationClasses
|
|
4909
4970
|
);
|
|
4910
|
-
return /* @__PURE__ */ (0,
|
|
4911
|
-
label && /* @__PURE__ */ (0,
|
|
4912
|
-
/* @__PURE__ */ (0,
|
|
4971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Stack, { className: classes, gap: "xs", children: [
|
|
4972
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Label, { ...labelProps, className: labelClasses, children: props.label }),
|
|
4973
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4913
4974
|
TextAreaInput,
|
|
4914
4975
|
{
|
|
4915
4976
|
...otherProps,
|
|
@@ -4920,7 +4981,7 @@ var init_TextArea = __esm({
|
|
|
4920
4981
|
"aria-invalid": errorMessage != null
|
|
4921
4982
|
}
|
|
4922
4983
|
),
|
|
4923
|
-
/* @__PURE__ */ (0,
|
|
4984
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
4924
4985
|
] });
|
|
4925
4986
|
};
|
|
4926
4987
|
TextArea.displayName = "TextArea";
|
|
@@ -4935,53 +4996,6 @@ var init_TextArea2 = __esm({
|
|
|
4935
4996
|
}
|
|
4936
4997
|
});
|
|
4937
4998
|
|
|
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
4999
|
// src/components/Title/Title.tsx
|
|
4986
5000
|
var import_dedupe58, import_Title, import_jsx_runtime68, Title;
|
|
4987
5001
|
var init_Title = __esm({
|