@simplybusiness/mobius 6.4.4 → 6.5.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 +12 -0
- package/dist/cjs/index.js +687 -622
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/index.js +540 -470
- package/dist/types/src/components/ErrorMessage/ErrorMessage.stories.d.ts +1 -0
- package/dist/types/src/components/ExpandableText/ExpandableText.d.ts +1 -1
- package/dist/types/src/components/TextOrHTML/TextOrHTML.d.ts +17 -0
- package/dist/types/src/components/TextOrHTML/TextOrHTML.stories.d.ts +14 -0
- package/dist/types/src/components/TextOrHTML/TextOrHTML.test.d.ts +1 -0
- package/dist/types/src/components/TextOrHTML/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ErrorMessage/ErrorMessage.css +18 -0
- package/src/components/ErrorMessage/ErrorMessage.stories.tsx +8 -0
- package/src/components/ErrorMessage/ErrorMessage.tsx +6 -4
- package/src/components/ExpandableText/ExpandableText.tsx +6 -10
- package/src/components/NumberField/NumberField.test.tsx +73 -28
- package/src/components/NumberField/NumberField.tsx +77 -21
- package/src/components/TextOrHTML/TextOrHTML.stories.tsx +229 -0
- package/src/components/TextOrHTML/TextOrHTML.test.tsx +127 -0
- package/src/components/TextOrHTML/TextOrHTML.tsx +56 -0
- package/src/components/TextOrHTML/index.tsx +1 -0
- package/src/components/index.tsx +1 -0
package/dist/cjs/index.js
CHANGED
|
@@ -83,6 +83,7 @@ __export(index_exports, {
|
|
|
83
83
|
TextArea: () => TextArea,
|
|
84
84
|
TextAreaInput: () => TextAreaInput,
|
|
85
85
|
TextField: () => TextField,
|
|
86
|
+
TextOrHTML: () => TextOrHTML,
|
|
86
87
|
Title: () => Title,
|
|
87
88
|
Trust: () => Trust,
|
|
88
89
|
VisuallyHidden: () => VisuallyHidden,
|
|
@@ -1018,58 +1019,29 @@ Accordion.displayName = "Accordion";
|
|
|
1018
1019
|
|
|
1019
1020
|
// src/components/AddressLookup/AddressLookup.tsx
|
|
1020
1021
|
var import_icons3 = require("@simplybusiness/icons");
|
|
1021
|
-
var
|
|
1022
|
+
var import_react25 = require("react");
|
|
1022
1023
|
|
|
1023
1024
|
// src/components/Combobox/Combobox.tsx
|
|
1024
|
-
var
|
|
1025
|
-
var
|
|
1025
|
+
var import_dedupe10 = __toESM(require("classnames/dedupe"));
|
|
1026
|
+
var import_react24 = require("react");
|
|
1026
1027
|
|
|
1027
1028
|
// src/components/TextField/TextField.tsx
|
|
1028
|
-
var
|
|
1029
|
-
var
|
|
1029
|
+
var import_dedupe8 = __toESM(require("classnames/dedupe"));
|
|
1030
|
+
var import_react20 = require("react");
|
|
1030
1031
|
|
|
1031
1032
|
// src/components/ErrorMessage/ErrorMessage.tsx
|
|
1032
1033
|
var import_icons2 = require("@simplybusiness/icons");
|
|
1033
|
-
var import_dedupe6 = __toESM(require("classnames/dedupe"));
|
|
1034
|
-
|
|
1035
|
-
// src/components/Text/Text.tsx
|
|
1036
|
-
var import_react17 = require("react");
|
|
1037
1034
|
var import_dedupe5 = __toESM(require("classnames/dedupe"));
|
|
1038
1035
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1039
|
-
var getElementType = (variant, elementType) => {
|
|
1040
|
-
if (variant) {
|
|
1041
|
-
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
1042
|
-
}
|
|
1043
|
-
return elementType || "p";
|
|
1044
|
-
};
|
|
1045
|
-
var Text = (0, import_react17.forwardRef)(
|
|
1046
|
-
({ elementType: Component = "p", ...props }, ref) => {
|
|
1047
|
-
const { variant, className, spacing, ...otherProps } = props;
|
|
1048
|
-
const elementType = getElementType(variant, Component);
|
|
1049
|
-
const variantType = variant || elementType;
|
|
1050
|
-
const classes = (0, import_dedupe5.default)(
|
|
1051
|
-
"mobius",
|
|
1052
|
-
"mobius-text",
|
|
1053
|
-
{ [`--is-${variantType}`]: variantType },
|
|
1054
|
-
{ [`--has-line-height-${spacing}`]: spacing },
|
|
1055
|
-
className
|
|
1056
|
-
);
|
|
1057
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
1058
|
-
}
|
|
1059
|
-
);
|
|
1060
|
-
Text.displayName = "Text";
|
|
1061
|
-
|
|
1062
|
-
// src/components/ErrorMessage/ErrorMessage.tsx
|
|
1063
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1064
1036
|
var ErrorMessage = ({
|
|
1065
1037
|
id,
|
|
1066
1038
|
errorMessage,
|
|
1067
1039
|
className
|
|
1068
1040
|
}) => {
|
|
1069
|
-
const classes = (0,
|
|
1041
|
+
const classes = (0, import_dedupe5.default)("mobius", "mobius-error-message", className);
|
|
1070
1042
|
if (!errorMessage) return null;
|
|
1071
|
-
return /* @__PURE__ */ (0,
|
|
1072
|
-
/* @__PURE__ */ (0,
|
|
1043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { id, className: classes, "data-testid": "ErrorMessage", role: "alert", children: [
|
|
1044
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1073
1045
|
Icon,
|
|
1074
1046
|
{
|
|
1075
1047
|
icon: import_icons2.error,
|
|
@@ -1077,32 +1049,39 @@ var ErrorMessage = ({
|
|
|
1077
1049
|
"aria-hidden": "true"
|
|
1078
1050
|
}
|
|
1079
1051
|
),
|
|
1080
|
-
/* @__PURE__ */ (0,
|
|
1052
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1053
|
+
TextOrHTML,
|
|
1054
|
+
{
|
|
1055
|
+
elementType: "span",
|
|
1056
|
+
className: "mobius-error-message__text",
|
|
1057
|
+
text: errorMessage
|
|
1058
|
+
}
|
|
1059
|
+
)
|
|
1081
1060
|
] });
|
|
1082
1061
|
};
|
|
1083
1062
|
ErrorMessage.displayName = "ErrorMessage";
|
|
1084
1063
|
|
|
1085
1064
|
// src/components/Label/Label.tsx
|
|
1086
|
-
var
|
|
1087
|
-
var
|
|
1088
|
-
var
|
|
1089
|
-
var Label = (0,
|
|
1065
|
+
var import_react17 = require("react");
|
|
1066
|
+
var import_dedupe6 = __toESM(require("classnames/dedupe"));
|
|
1067
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1068
|
+
var Label = (0, import_react17.forwardRef)(
|
|
1090
1069
|
(props, ref) => {
|
|
1091
1070
|
const { elementType: Element = "label", children, ...otherProps } = props;
|
|
1092
|
-
const classes = (0,
|
|
1071
|
+
const classes = (0, import_dedupe6.default)("mobius", "mobius-label", props.className);
|
|
1093
1072
|
otherProps.className = classes;
|
|
1094
|
-
return /* @__PURE__ */ (0,
|
|
1073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Element, { ref, ...otherProps, className: classes, children });
|
|
1095
1074
|
}
|
|
1096
1075
|
);
|
|
1097
1076
|
Label.displayName = "Label";
|
|
1098
1077
|
|
|
1099
1078
|
// src/components/Stack/Stack.tsx
|
|
1100
|
-
var
|
|
1101
|
-
var
|
|
1102
|
-
var
|
|
1103
|
-
var Stack = (0,
|
|
1079
|
+
var import_react18 = require("react");
|
|
1080
|
+
var import_dedupe7 = __toESM(require("classnames/dedupe"));
|
|
1081
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1082
|
+
var Stack = (0, import_react18.forwardRef)((props, ref) => {
|
|
1104
1083
|
const { elementType: Element = "div", gap, ...otherProps } = props;
|
|
1105
|
-
const classes = (0,
|
|
1084
|
+
const classes = (0, import_dedupe7.default)(
|
|
1106
1085
|
"mobius",
|
|
1107
1086
|
"mobius-stack",
|
|
1108
1087
|
{
|
|
@@ -1110,16 +1089,16 @@ var Stack = (0, import_react19.forwardRef)((props, ref) => {
|
|
|
1110
1089
|
},
|
|
1111
1090
|
otherProps.className
|
|
1112
1091
|
);
|
|
1113
|
-
return /* @__PURE__ */ (0,
|
|
1092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
1114
1093
|
});
|
|
1115
1094
|
Stack.displayName = "Stack";
|
|
1116
1095
|
|
|
1117
1096
|
// src/components/TextField/adornmentWithClassName.ts
|
|
1118
1097
|
var import_classnames = __toESM(require("classnames"));
|
|
1119
|
-
var
|
|
1098
|
+
var import_react19 = require("react");
|
|
1120
1099
|
var adornmentWithClassName = (component, validationClasses, className) => {
|
|
1121
1100
|
if (!component) return null;
|
|
1122
|
-
return (0,
|
|
1101
|
+
return (0, import_react19.cloneElement)(component, {
|
|
1123
1102
|
className: (0, import_classnames.default)(
|
|
1124
1103
|
component.props.className,
|
|
1125
1104
|
validationClasses,
|
|
@@ -1129,8 +1108,8 @@ var adornmentWithClassName = (component, validationClasses, className) => {
|
|
|
1129
1108
|
};
|
|
1130
1109
|
|
|
1131
1110
|
// src/components/TextField/TextField.tsx
|
|
1132
|
-
var
|
|
1133
|
-
var TextField = (0,
|
|
1111
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1112
|
+
var TextField = (0, import_react20.forwardRef)((props, ref) => {
|
|
1134
1113
|
const {
|
|
1135
1114
|
isDisabled,
|
|
1136
1115
|
type = "text",
|
|
@@ -1164,42 +1143,42 @@ var TextField = (0, import_react21.forwardRef)((props, ref) => {
|
|
|
1164
1143
|
"--is-hidden": hidden,
|
|
1165
1144
|
[className || ""]: true
|
|
1166
1145
|
};
|
|
1167
|
-
const sharedClasses = (0,
|
|
1168
|
-
const labelClasses = (0,
|
|
1146
|
+
const sharedClasses = (0, import_dedupe8.default)(validationClasses, textfieldClasses);
|
|
1147
|
+
const labelClasses = (0, import_dedupe8.default)(
|
|
1169
1148
|
{
|
|
1170
1149
|
"--is-disabled": isDisabled
|
|
1171
1150
|
},
|
|
1172
1151
|
validationClasses
|
|
1173
1152
|
);
|
|
1174
|
-
const containerClasses = (0,
|
|
1153
|
+
const containerClasses = (0, import_dedupe8.default)(
|
|
1175
1154
|
"mobius",
|
|
1176
1155
|
"mobius-text-field",
|
|
1177
1156
|
sharedClasses
|
|
1178
1157
|
);
|
|
1179
|
-
const inputClasses = (0,
|
|
1158
|
+
const inputClasses = (0, import_dedupe8.default)(
|
|
1180
1159
|
"mobius",
|
|
1181
1160
|
"mobius-text-field__input",
|
|
1182
1161
|
sharedClasses
|
|
1183
1162
|
);
|
|
1184
|
-
const inputWrapperClasses = (0,
|
|
1163
|
+
const inputWrapperClasses = (0, import_dedupe8.default)(
|
|
1185
1164
|
"mobius-text-field__input-wrapper",
|
|
1186
1165
|
sharedClasses
|
|
1187
1166
|
);
|
|
1188
|
-
return /* @__PURE__ */ (0,
|
|
1189
|
-
label && !hidden && /* @__PURE__ */ (0,
|
|
1190
|
-
/* @__PURE__ */ (0,
|
|
1167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Stack, { gap: "xs", className: containerClasses, children: [
|
|
1168
|
+
label && !hidden && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
1169
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mobius-text-field__inner-container", children: [
|
|
1191
1170
|
adornmentWithClassName(
|
|
1192
1171
|
prefixOutside,
|
|
1193
1172
|
labelClasses,
|
|
1194
1173
|
"mobius-text-field__prefix-outside"
|
|
1195
1174
|
),
|
|
1196
|
-
/* @__PURE__ */ (0,
|
|
1175
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: inputWrapperClasses, children: [
|
|
1197
1176
|
adornmentWithClassName(
|
|
1198
1177
|
prefixInside,
|
|
1199
1178
|
labelClasses,
|
|
1200
1179
|
"mobius-text-field__prefix-inside"
|
|
1201
1180
|
),
|
|
1202
|
-
/* @__PURE__ */ (0,
|
|
1181
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1203
1182
|
"input",
|
|
1204
1183
|
{
|
|
1205
1184
|
...otherProps,
|
|
@@ -1221,14 +1200,14 @@ var TextField = (0, import_react21.forwardRef)((props, ref) => {
|
|
|
1221
1200
|
"mobius-text-field__suffix-outside"
|
|
1222
1201
|
)
|
|
1223
1202
|
] }),
|
|
1224
|
-
children && /* @__PURE__ */ (0,
|
|
1225
|
-
/* @__PURE__ */ (0,
|
|
1203
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "mobius-text-field__children", children }),
|
|
1204
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
1226
1205
|
] });
|
|
1227
1206
|
});
|
|
1228
1207
|
TextField.displayName = "TextField";
|
|
1229
1208
|
|
|
1230
1209
|
// src/components/VisuallyHidden/VisuallyHidden.tsx
|
|
1231
|
-
var
|
|
1210
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1232
1211
|
function VisuallyHidden(props) {
|
|
1233
1212
|
const {
|
|
1234
1213
|
className,
|
|
@@ -1236,7 +1215,7 @@ function VisuallyHidden(props) {
|
|
|
1236
1215
|
elementType: Component = "div",
|
|
1237
1216
|
...otherProps
|
|
1238
1217
|
} = props;
|
|
1239
|
-
return /* @__PURE__ */ (0,
|
|
1218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1240
1219
|
Component,
|
|
1241
1220
|
{
|
|
1242
1221
|
className,
|
|
@@ -1262,8 +1241,8 @@ function VisuallyHidden(props) {
|
|
|
1262
1241
|
var import_classnames2 = __toESM(require("classnames"));
|
|
1263
1242
|
|
|
1264
1243
|
// src/components/Combobox/Option.tsx
|
|
1265
|
-
var
|
|
1266
|
-
var
|
|
1244
|
+
var import_react21 = require("react");
|
|
1245
|
+
var import_dedupe9 = __toESM(require("classnames/dedupe"));
|
|
1267
1246
|
|
|
1268
1247
|
// src/components/Combobox/utils.tsx
|
|
1269
1248
|
function isOptionGroup(options) {
|
|
@@ -1287,7 +1266,7 @@ function filterOptions(options, inputValue) {
|
|
|
1287
1266
|
}
|
|
1288
1267
|
|
|
1289
1268
|
// src/components/Combobox/Option.tsx
|
|
1290
|
-
var
|
|
1269
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1291
1270
|
var Option = ({
|
|
1292
1271
|
option,
|
|
1293
1272
|
isHighlighted,
|
|
@@ -1295,13 +1274,13 @@ var Option = ({
|
|
|
1295
1274
|
optionComponent: OptionComponent,
|
|
1296
1275
|
id
|
|
1297
1276
|
}) => {
|
|
1298
|
-
const optionRef = (0,
|
|
1299
|
-
(0,
|
|
1277
|
+
const optionRef = (0, import_react21.useRef)(null);
|
|
1278
|
+
(0, import_react21.useEffect)(() => {
|
|
1300
1279
|
if (isHighlighted && optionRef.current && optionRef.current.scrollIntoView) {
|
|
1301
1280
|
optionRef.current.scrollIntoView({ block: "nearest" });
|
|
1302
1281
|
}
|
|
1303
1282
|
}, [isHighlighted]);
|
|
1304
|
-
return /* @__PURE__ */ (0,
|
|
1283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1305
1284
|
"li",
|
|
1306
1285
|
{
|
|
1307
1286
|
ref: optionRef,
|
|
@@ -1309,17 +1288,17 @@ var Option = ({
|
|
|
1309
1288
|
id,
|
|
1310
1289
|
"aria-selected": isHighlighted,
|
|
1311
1290
|
onMouseDown: () => onOptionSelect(option),
|
|
1312
|
-
className: (0,
|
|
1291
|
+
className: (0, import_dedupe9.default)("mobius-combobox__option", "has-pii", {
|
|
1313
1292
|
"mobius-combobox__option--is-highlighted": isHighlighted
|
|
1314
1293
|
}),
|
|
1315
|
-
children: OptionComponent ? /* @__PURE__ */ (0,
|
|
1294
|
+
children: OptionComponent ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(OptionComponent, { option, isHighlighted }) : getOptionLabel(option)
|
|
1316
1295
|
},
|
|
1317
1296
|
getOptionValue(option)
|
|
1318
1297
|
);
|
|
1319
1298
|
};
|
|
1320
1299
|
|
|
1321
1300
|
// src/components/Combobox/Listbox.tsx
|
|
1322
|
-
var
|
|
1301
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1323
1302
|
var Listbox = ({
|
|
1324
1303
|
id,
|
|
1325
1304
|
isOpen = false,
|
|
@@ -1339,19 +1318,19 @@ var Listbox = ({
|
|
|
1339
1318
|
return isOptionGroup(options) ? `${id}-option-${groupIndex}-${index}` : `${id}-option-${index}`;
|
|
1340
1319
|
}
|
|
1341
1320
|
if (!isOpen) {
|
|
1342
|
-
return /* @__PURE__ */ (0,
|
|
1321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { role: "listbox", id, className: classes });
|
|
1343
1322
|
}
|
|
1344
1323
|
if (options && options.length === 0) {
|
|
1345
|
-
return /* @__PURE__ */ (0,
|
|
1324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { role: "listbox", id, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "mobius-combobox__no-options", children: "No options" }) });
|
|
1346
1325
|
}
|
|
1347
|
-
return /* @__PURE__ */ (0,
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { role: "listbox", id, className: classes, children: isOptionGroup(options) ? options.map((option, groupIndex) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1348
1327
|
"ul",
|
|
1349
1328
|
{
|
|
1350
1329
|
role: "group",
|
|
1351
1330
|
"aria-labelledby": `${id}-group-${groupIndex}`,
|
|
1352
1331
|
className: "mobius-combobox__group",
|
|
1353
1332
|
children: [
|
|
1354
|
-
/* @__PURE__ */ (0,
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1355
1334
|
"li",
|
|
1356
1335
|
{
|
|
1357
1336
|
role: "presentation",
|
|
@@ -1360,7 +1339,7 @@ var Listbox = ({
|
|
|
1360
1339
|
children: option.heading
|
|
1361
1340
|
}
|
|
1362
1341
|
),
|
|
1363
|
-
option.options.map((groupOption, index) => /* @__PURE__ */ (0,
|
|
1342
|
+
option.options.map((groupOption, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1364
1343
|
Option,
|
|
1365
1344
|
{
|
|
1366
1345
|
option: groupOption,
|
|
@@ -1374,7 +1353,7 @@ var Listbox = ({
|
|
|
1374
1353
|
]
|
|
1375
1354
|
},
|
|
1376
1355
|
option.heading
|
|
1377
|
-
)) : typeof options !== "undefined" ? options.map((option, index) => /* @__PURE__ */ (0,
|
|
1356
|
+
)) : typeof options !== "undefined" ? options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1378
1357
|
Option,
|
|
1379
1358
|
{
|
|
1380
1359
|
option,
|
|
@@ -1388,12 +1367,12 @@ var Listbox = ({
|
|
|
1388
1367
|
};
|
|
1389
1368
|
|
|
1390
1369
|
// src/components/Combobox/useComboboxHighlight.tsx
|
|
1391
|
-
var
|
|
1370
|
+
var import_react22 = require("react");
|
|
1392
1371
|
function useComboboxHighlight(options) {
|
|
1393
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
1372
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react22.useState)(
|
|
1394
1373
|
options && options.length ? 0 : -1
|
|
1395
1374
|
);
|
|
1396
|
-
const [highlightedGroupIndex, setHighlightedGroupIndex] = (0,
|
|
1375
|
+
const [highlightedGroupIndex, setHighlightedGroupIndex] = (0, import_react22.useState)(0);
|
|
1397
1376
|
function highlightNextOption() {
|
|
1398
1377
|
const isGroup = isOptionGroup(options);
|
|
1399
1378
|
if (!options) {
|
|
@@ -1471,7 +1450,7 @@ function useComboboxHighlight(options) {
|
|
|
1471
1450
|
}
|
|
1472
1451
|
|
|
1473
1452
|
// src/components/Combobox/useComboboxOptions.ts
|
|
1474
|
-
var
|
|
1453
|
+
var import_react23 = require("react");
|
|
1475
1454
|
function useComboboxOptions({
|
|
1476
1455
|
options,
|
|
1477
1456
|
asyncOptions,
|
|
@@ -1481,15 +1460,15 @@ function useComboboxOptions({
|
|
|
1481
1460
|
skipNextDebounceRef,
|
|
1482
1461
|
onSearched
|
|
1483
1462
|
}) {
|
|
1484
|
-
const [filteredOptions, setFilteredOptions] = (0,
|
|
1463
|
+
const [filteredOptions, setFilteredOptions] = (0, import_react23.useState)(void 0);
|
|
1485
1464
|
const debouncedInputValue = useDebouncedValue(
|
|
1486
1465
|
inputValue,
|
|
1487
1466
|
// Don't debounce synchronous options
|
|
1488
1467
|
options ? 0 : delay
|
|
1489
1468
|
);
|
|
1490
|
-
const [isLoading, setIsLoading] = (0,
|
|
1491
|
-
const [error3, setError] = (0,
|
|
1492
|
-
(0,
|
|
1469
|
+
const [isLoading, setIsLoading] = (0, import_react23.useState)(false);
|
|
1470
|
+
const [error3, setError] = (0, import_react23.useState)(null);
|
|
1471
|
+
(0, import_react23.useEffect)(() => {
|
|
1493
1472
|
const controller = new AbortController();
|
|
1494
1473
|
const { signal } = controller;
|
|
1495
1474
|
const fetchOptions = async () => {
|
|
@@ -1547,8 +1526,8 @@ function useComboboxOptions({
|
|
|
1547
1526
|
}
|
|
1548
1527
|
|
|
1549
1528
|
// src/components/Combobox/Combobox.tsx
|
|
1550
|
-
var
|
|
1551
|
-
var ComboboxInner = (0,
|
|
1529
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1530
|
+
var ComboboxInner = (0, import_react24.forwardRef)(
|
|
1552
1531
|
(props, ref) => {
|
|
1553
1532
|
const {
|
|
1554
1533
|
id,
|
|
@@ -1570,11 +1549,11 @@ var ComboboxInner = (0, import_react25.forwardRef)(
|
|
|
1570
1549
|
errorMessage,
|
|
1571
1550
|
...otherProps
|
|
1572
1551
|
} = props;
|
|
1573
|
-
const skipNextDebounceRef = (0,
|
|
1574
|
-
const fallbackRef = (0,
|
|
1575
|
-
const [inputValue, setInputValue] = (0,
|
|
1576
|
-
const [isOpen, setIsOpen] = (0,
|
|
1577
|
-
const [isChanging, setIsChanging] = (0,
|
|
1552
|
+
const skipNextDebounceRef = (0, import_react24.useRef)(false);
|
|
1553
|
+
const fallbackRef = (0, import_react24.useRef)(null);
|
|
1554
|
+
const [inputValue, setInputValue] = (0, import_react24.useState)(defaultValue || "");
|
|
1555
|
+
const [isOpen, setIsOpen] = (0, import_react24.useState)(false);
|
|
1556
|
+
const [isChanging, setIsChanging] = (0, import_react24.useState)(false);
|
|
1578
1557
|
const { filteredOptions, updateFilteredOptions, isLoading, error: error3 } = useComboboxOptions({
|
|
1579
1558
|
options,
|
|
1580
1559
|
asyncOptions,
|
|
@@ -1593,9 +1572,9 @@ var ComboboxInner = (0, import_react25.forwardRef)(
|
|
|
1593
1572
|
clearHighlight
|
|
1594
1573
|
} = useComboboxHighlight(filteredOptions);
|
|
1595
1574
|
const inputRef = ref || fallbackRef;
|
|
1596
|
-
const listboxId = (0,
|
|
1597
|
-
const statusId = (0,
|
|
1598
|
-
const blurTimeoutRef = (0,
|
|
1575
|
+
const listboxId = (0, import_react24.useId)();
|
|
1576
|
+
const statusId = (0, import_react24.useId)();
|
|
1577
|
+
const blurTimeoutRef = (0, import_react24.useRef)(null);
|
|
1599
1578
|
const { down } = useBreakpoint();
|
|
1600
1579
|
const isMobile = down("md");
|
|
1601
1580
|
const handleFocus = (e) => {
|
|
@@ -1709,17 +1688,17 @@ var ComboboxInner = (0, import_react25.forwardRef)(
|
|
|
1709
1688
|
default:
|
|
1710
1689
|
}
|
|
1711
1690
|
};
|
|
1712
|
-
(0,
|
|
1691
|
+
(0, import_react24.useEffect)(() => {
|
|
1713
1692
|
if (value) {
|
|
1714
1693
|
setInputValue(value);
|
|
1715
1694
|
}
|
|
1716
1695
|
}, [value]);
|
|
1717
|
-
(0,
|
|
1696
|
+
(0, import_react24.useEffect)(() => {
|
|
1718
1697
|
if (asyncOptions && isChanging) {
|
|
1719
1698
|
setIsOpen(!!filteredOptions && filteredOptions.length > 0);
|
|
1720
1699
|
}
|
|
1721
1700
|
}, [filteredOptions, asyncOptions, isChanging]);
|
|
1722
|
-
const classes = (0,
|
|
1701
|
+
const classes = (0, import_dedupe10.default)(
|
|
1723
1702
|
"mobius mobius-combobox",
|
|
1724
1703
|
{
|
|
1725
1704
|
"mobius-combobox--is-expanded": isOpen,
|
|
@@ -1728,8 +1707,8 @@ var ComboboxInner = (0, import_react25.forwardRef)(
|
|
|
1728
1707
|
},
|
|
1729
1708
|
className
|
|
1730
1709
|
);
|
|
1731
|
-
return /* @__PURE__ */ (0,
|
|
1732
|
-
isLoading && /* @__PURE__ */ (0,
|
|
1710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { id, "data-testid": "mobius-combobox__wrapper", className: classes, children: [
|
|
1711
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1733
1712
|
VisuallyHidden,
|
|
1734
1713
|
{
|
|
1735
1714
|
role: "status",
|
|
@@ -1740,7 +1719,7 @@ var ComboboxInner = (0, import_react25.forwardRef)(
|
|
|
1740
1719
|
children: "Loading options"
|
|
1741
1720
|
}
|
|
1742
1721
|
),
|
|
1743
|
-
/* @__PURE__ */ (0,
|
|
1722
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1744
1723
|
TextField,
|
|
1745
1724
|
{
|
|
1746
1725
|
...otherProps,
|
|
@@ -1764,7 +1743,7 @@ var ComboboxInner = (0, import_react25.forwardRef)(
|
|
|
1764
1743
|
errorMessage: errorMessage || error3?.message || void 0
|
|
1765
1744
|
}
|
|
1766
1745
|
),
|
|
1767
|
-
/* @__PURE__ */ (0,
|
|
1746
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1768
1747
|
Listbox,
|
|
1769
1748
|
{
|
|
1770
1749
|
id: listboxId,
|
|
@@ -1788,7 +1767,7 @@ function isLoqateErrorResponse(response) {
|
|
|
1788
1767
|
}
|
|
1789
1768
|
|
|
1790
1769
|
// src/components/AddressLookup/AddressLookup.tsx
|
|
1791
|
-
var
|
|
1770
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1792
1771
|
function optionsFromResponse({ Items }, addressLookupService) {
|
|
1793
1772
|
if (!Items || !Array.isArray(Items)) {
|
|
1794
1773
|
throw Error("No address found");
|
|
@@ -1808,7 +1787,7 @@ function optionsFromResponse({ Items }, addressLookupService) {
|
|
|
1808
1787
|
}
|
|
1809
1788
|
}));
|
|
1810
1789
|
}
|
|
1811
|
-
var AddressLookup = (0,
|
|
1790
|
+
var AddressLookup = (0, import_react25.forwardRef)(
|
|
1812
1791
|
({
|
|
1813
1792
|
addressLookupService,
|
|
1814
1793
|
onAddressSelected,
|
|
@@ -1817,15 +1796,15 @@ var AddressLookup = (0, import_react26.forwardRef)(
|
|
|
1817
1796
|
errorMessage,
|
|
1818
1797
|
...otherProps
|
|
1819
1798
|
}, ref) => {
|
|
1820
|
-
const [error3, _setError] = (0,
|
|
1821
|
-
const setError = (0,
|
|
1799
|
+
const [error3, _setError] = (0, import_react25.useState)(null);
|
|
1800
|
+
const setError = (0, import_react25.useCallback)(
|
|
1822
1801
|
(newError) => {
|
|
1823
1802
|
if (newError != null) onError?.(newError);
|
|
1824
1803
|
_setError(newError);
|
|
1825
1804
|
},
|
|
1826
1805
|
[onError]
|
|
1827
1806
|
);
|
|
1828
|
-
const asyncOptions = (0,
|
|
1807
|
+
const asyncOptions = (0, import_react25.useCallback)(
|
|
1829
1808
|
async (searchTerm) => {
|
|
1830
1809
|
try {
|
|
1831
1810
|
const response = await addressLookupService.search(searchTerm);
|
|
@@ -1845,7 +1824,7 @@ var AddressLookup = (0, import_react26.forwardRef)(
|
|
|
1845
1824
|
return addressLookupService.get(selected.id).then(onAddressSelected).catch(setError);
|
|
1846
1825
|
};
|
|
1847
1826
|
const realErrorMessage = error3 && "An error occurred" || errorMessage;
|
|
1848
|
-
return /* @__PURE__ */ (0,
|
|
1827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1849
1828
|
Combobox,
|
|
1850
1829
|
{
|
|
1851
1830
|
...otherProps,
|
|
@@ -1853,7 +1832,7 @@ var AddressLookup = (0, import_react26.forwardRef)(
|
|
|
1853
1832
|
onSelected: handleSelected,
|
|
1854
1833
|
asyncOptions,
|
|
1855
1834
|
errorMessage: realErrorMessage,
|
|
1856
|
-
icon: /* @__PURE__ */ (0,
|
|
1835
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { icon: import_icons3.search })
|
|
1857
1836
|
}
|
|
1858
1837
|
);
|
|
1859
1838
|
}
|
|
@@ -1945,13 +1924,13 @@ var LoqateAddressLookupService = class {
|
|
|
1945
1924
|
|
|
1946
1925
|
// src/components/Alert/Alert.tsx
|
|
1947
1926
|
var import_icons4 = require("@simplybusiness/icons");
|
|
1948
|
-
var
|
|
1949
|
-
var
|
|
1950
|
-
var
|
|
1927
|
+
var import_dedupe11 = __toESM(require("classnames/dedupe"));
|
|
1928
|
+
var import_react26 = require("react");
|
|
1929
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1951
1930
|
function isAlertVariant(value) {
|
|
1952
1931
|
return value === "info" || value === "success" || value === "warning" || value === "error";
|
|
1953
1932
|
}
|
|
1954
|
-
var Alert = (0,
|
|
1933
|
+
var Alert = (0, import_react26.forwardRef)(
|
|
1955
1934
|
(props, ref) => {
|
|
1956
1935
|
const {
|
|
1957
1936
|
elementType: Element = "div",
|
|
@@ -1964,7 +1943,7 @@ var Alert = (0, import_react27.forwardRef)(
|
|
|
1964
1943
|
if (!show) return null;
|
|
1965
1944
|
const variant = variantProp && isAlertVariant(variantProp) ? variantProp : "info";
|
|
1966
1945
|
const colorValue = variant === "success" ? `var(--color-valid)` : `var(--color-${variant})`;
|
|
1967
|
-
const classes = (0,
|
|
1946
|
+
const classes = (0, import_dedupe11.default)(
|
|
1968
1947
|
"mobius",
|
|
1969
1948
|
"mobius-alert",
|
|
1970
1949
|
{
|
|
@@ -1982,14 +1961,14 @@ var Alert = (0, import_react27.forwardRef)(
|
|
|
1982
1961
|
warning: import_icons4.warning,
|
|
1983
1962
|
error: import_icons4.error
|
|
1984
1963
|
};
|
|
1985
|
-
const headerClasses = (0,
|
|
1986
|
-
const iconClasses = (0,
|
|
1987
|
-
const contentClasses = (0,
|
|
1988
|
-
return /* @__PURE__ */ (0,
|
|
1989
|
-
/* @__PURE__ */ (0,
|
|
1990
|
-
/* @__PURE__ */ (0,
|
|
1991
|
-
header && /* @__PURE__ */ (0,
|
|
1992
|
-
/* @__PURE__ */ (0,
|
|
1964
|
+
const headerClasses = (0, import_dedupe11.default)("mobius", "mobius-alert__header");
|
|
1965
|
+
const iconClasses = (0, import_dedupe11.default)("mobius", "mobius-alert__icon");
|
|
1966
|
+
const contentClasses = (0, import_dedupe11.default)("mobius", "mobius-alert__content");
|
|
1967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Element, { ref, role: "alert", ...otherProps, className: classes, children: [
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { icon: icon[variant], color: colorValue }) }),
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
1970
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: headerClasses, children: header }),
|
|
1971
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: contentClasses, children })
|
|
1993
1972
|
] })
|
|
1994
1973
|
] });
|
|
1995
1974
|
}
|
|
@@ -1997,10 +1976,10 @@ var Alert = (0, import_react27.forwardRef)(
|
|
|
1997
1976
|
Alert.displayName = "Alert";
|
|
1998
1977
|
|
|
1999
1978
|
// src/components/Box/Box.tsx
|
|
2000
|
-
var
|
|
2001
|
-
var
|
|
2002
|
-
var
|
|
2003
|
-
var Box = (0,
|
|
1979
|
+
var import_react27 = require("react");
|
|
1980
|
+
var import_dedupe12 = __toESM(require("classnames/dedupe"));
|
|
1981
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1982
|
+
var Box = (0, import_react27.forwardRef)(
|
|
2004
1983
|
(props, ref) => {
|
|
2005
1984
|
const {
|
|
2006
1985
|
elementType: Element = "div",
|
|
@@ -2026,7 +2005,7 @@ var Box = (0, import_react28.forwardRef)(
|
|
|
2026
2005
|
style,
|
|
2027
2006
|
...otherProps
|
|
2028
2007
|
} = props;
|
|
2029
|
-
const classes = (0,
|
|
2008
|
+
const classes = (0, import_dedupe12.default)("mobius", "mobius-box", otherProps.className);
|
|
2030
2009
|
const styleProps = filterUndefinedProps({
|
|
2031
2010
|
padding: getSpacingValue(padding),
|
|
2032
2011
|
paddingInline: getSpacingValue(paddingInline || paddingX),
|
|
@@ -2043,7 +2022,7 @@ var Box = (0, import_react28.forwardRef)(
|
|
|
2043
2022
|
height,
|
|
2044
2023
|
...style
|
|
2045
2024
|
});
|
|
2046
|
-
return /* @__PURE__ */ (0,
|
|
2025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2047
2026
|
Element,
|
|
2048
2027
|
{
|
|
2049
2028
|
ref,
|
|
@@ -2057,21 +2036,21 @@ var Box = (0, import_react28.forwardRef)(
|
|
|
2057
2036
|
Box.displayName = "Box";
|
|
2058
2037
|
|
|
2059
2038
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
2060
|
-
var
|
|
2061
|
-
var
|
|
2062
|
-
var
|
|
2063
|
-
var Breadcrumbs = (0,
|
|
2039
|
+
var import_react28 = require("react");
|
|
2040
|
+
var import_dedupe13 = __toESM(require("classnames/dedupe"));
|
|
2041
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2042
|
+
var Breadcrumbs = (0, import_react28.forwardRef)((props, ref) => {
|
|
2064
2043
|
const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
|
|
2065
2044
|
const { navProps } = { navProps: { "aria-label": ariaLabel } };
|
|
2066
2045
|
const { children, ...otherProps } = props;
|
|
2067
|
-
const childArray =
|
|
2068
|
-
const classes = (0,
|
|
2046
|
+
const childArray = import_react28.Children.toArray(children);
|
|
2047
|
+
const classes = (0, import_dedupe13.default)(
|
|
2069
2048
|
"mobius",
|
|
2070
2049
|
"mobius-breadcrumb",
|
|
2071
2050
|
otherProps.className
|
|
2072
2051
|
);
|
|
2073
|
-
return /* @__PURE__ */ (0,
|
|
2074
|
-
(child, i) => (0,
|
|
2052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { children: childArray.map(
|
|
2053
|
+
(child, i) => (0, import_react28.cloneElement)(
|
|
2075
2054
|
child,
|
|
2076
2055
|
{
|
|
2077
2056
|
key: i,
|
|
@@ -2083,16 +2062,16 @@ var Breadcrumbs = (0, import_react29.forwardRef)((props, ref) => {
|
|
|
2083
2062
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
2084
2063
|
|
|
2085
2064
|
// src/components/Breadcrumbs/BreadcrumbItem.tsx
|
|
2086
|
-
var
|
|
2087
|
-
var
|
|
2088
|
-
var
|
|
2089
|
-
var BreadcrumbItem = (0,
|
|
2065
|
+
var import_react29 = require("react");
|
|
2066
|
+
var import_dedupe14 = __toESM(require("classnames/dedupe"));
|
|
2067
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2068
|
+
var BreadcrumbItem = (0, import_react29.forwardRef)((props, ref) => {
|
|
2090
2069
|
const {
|
|
2091
2070
|
isDisabled = false,
|
|
2092
2071
|
isCurrent = false,
|
|
2093
2072
|
"aria-current": ariaCurrent = "page",
|
|
2094
2073
|
children,
|
|
2095
|
-
separator = /* @__PURE__ */ (0,
|
|
2074
|
+
separator = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box, { className: "mobius-breadcrumb__separator", "aria-hidden": "true", children: ">" }),
|
|
2096
2075
|
...otherProps
|
|
2097
2076
|
} = props;
|
|
2098
2077
|
const { itemProps } = {
|
|
@@ -2102,14 +2081,14 @@ var BreadcrumbItem = (0, import_react30.forwardRef)((props, ref) => {
|
|
|
2102
2081
|
...otherProps
|
|
2103
2082
|
}
|
|
2104
2083
|
};
|
|
2105
|
-
const classes = (0,
|
|
2084
|
+
const classes = (0, import_dedupe14.default)(
|
|
2106
2085
|
"mobius",
|
|
2107
2086
|
"mobius-breadcrumb__item",
|
|
2108
2087
|
props.className
|
|
2109
2088
|
);
|
|
2110
|
-
const child = typeof children === "string" ? /* @__PURE__ */ (0,
|
|
2111
|
-
return /* @__PURE__ */ (0,
|
|
2112
|
-
(0,
|
|
2089
|
+
const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { ...itemProps, children }) : import_react29.Children.only(children);
|
|
2090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: classes, children: [
|
|
2091
|
+
(0, import_react29.cloneElement)(child, {
|
|
2113
2092
|
...child.props,
|
|
2114
2093
|
...itemProps,
|
|
2115
2094
|
ref
|
|
@@ -2120,35 +2099,35 @@ var BreadcrumbItem = (0, import_react30.forwardRef)((props, ref) => {
|
|
|
2120
2099
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
2121
2100
|
|
|
2122
2101
|
// src/components/Button/Button.tsx
|
|
2123
|
-
var
|
|
2124
|
-
var
|
|
2102
|
+
var import_react30 = require("react");
|
|
2103
|
+
var import_dedupe15 = __toESM(require("classnames/dedupe"));
|
|
2125
2104
|
|
|
2126
2105
|
// src/components/Button/Loading.tsx
|
|
2127
2106
|
var import_icons5 = require("@simplybusiness/icons");
|
|
2128
|
-
var
|
|
2107
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2129
2108
|
var Loading = (props) => {
|
|
2130
2109
|
const { children } = props;
|
|
2131
|
-
return /* @__PURE__ */ (0,
|
|
2132
|
-
/* @__PURE__ */ (0,
|
|
2133
|
-
/* @__PURE__ */ (0,
|
|
2110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { icon: import_icons5.loading, spin: true, size: "md" }) }),
|
|
2112
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(VisuallyHidden, { className: "mobius-button__loading-text", children: "Loading" }),
|
|
2134
2113
|
children
|
|
2135
2114
|
] });
|
|
2136
2115
|
};
|
|
2137
2116
|
|
|
2138
2117
|
// src/components/Button/Success.tsx
|
|
2139
2118
|
var import_icons6 = require("@simplybusiness/icons");
|
|
2140
|
-
var
|
|
2141
|
-
var Success = () => /* @__PURE__ */ (0,
|
|
2142
|
-
/* @__PURE__ */ (0,
|
|
2143
|
-
/* @__PURE__ */ (0,
|
|
2119
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2120
|
+
var Success = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2121
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { icon: import_icons6.tick, size: "md" }) }),
|
|
2122
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(VisuallyHidden, { className: "mobius-button__success-text", children: "Success" })
|
|
2144
2123
|
] });
|
|
2145
2124
|
|
|
2146
2125
|
// src/components/Button/Button.tsx
|
|
2147
|
-
var
|
|
2126
|
+
var import_jsx_runtime20 = (
|
|
2148
2127
|
// @ts-expect-error - ref type is not correct
|
|
2149
2128
|
require("react/jsx-runtime")
|
|
2150
2129
|
);
|
|
2151
|
-
var Button = (0,
|
|
2130
|
+
var Button = (0, import_react30.forwardRef)((props, ref) => {
|
|
2152
2131
|
const {
|
|
2153
2132
|
children,
|
|
2154
2133
|
elementType: Component = "button",
|
|
@@ -2176,7 +2155,7 @@ var Button = (0, import_react31.forwardRef)((props, ref) => {
|
|
|
2176
2155
|
return variant;
|
|
2177
2156
|
};
|
|
2178
2157
|
const buttonVariant = getVariant(variant);
|
|
2179
|
-
const classes = (0,
|
|
2158
|
+
const classes = (0, import_dedupe15.default)(
|
|
2180
2159
|
"mobius",
|
|
2181
2160
|
"mobius-button",
|
|
2182
2161
|
`--variant-${buttonVariant}`,
|
|
@@ -2189,19 +2168,19 @@ var Button = (0, import_react31.forwardRef)((props, ref) => {
|
|
|
2189
2168
|
otherProps.className
|
|
2190
2169
|
);
|
|
2191
2170
|
otherProps.className = classes;
|
|
2192
|
-
return /* @__PURE__ */ (0,
|
|
2193
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2194
|
-
isSuccess && !isLoading && /* @__PURE__ */ (0,
|
|
2171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Component, { ref, ...buttonProps, ...otherProps, children: [
|
|
2172
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Loading, { children }) : children,
|
|
2173
|
+
isSuccess && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Success, {})
|
|
2195
2174
|
] });
|
|
2196
2175
|
});
|
|
2197
2176
|
Button.displayName = "Button";
|
|
2198
2177
|
|
|
2199
2178
|
// src/components/Checkbox/Checkbox.tsx
|
|
2200
|
-
var
|
|
2201
|
-
var
|
|
2179
|
+
var import_react31 = require("react");
|
|
2180
|
+
var import_dedupe16 = __toESM(require("classnames/dedupe"));
|
|
2202
2181
|
var import_icons7 = require("@simplybusiness/icons");
|
|
2203
|
-
var
|
|
2204
|
-
var Checkbox = (0,
|
|
2182
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2183
|
+
var Checkbox = (0, import_react31.forwardRef)((props, ref) => {
|
|
2205
2184
|
const {
|
|
2206
2185
|
id,
|
|
2207
2186
|
label,
|
|
@@ -2221,12 +2200,12 @@ var Checkbox = (0, import_react32.forwardRef)((props, ref) => {
|
|
|
2221
2200
|
["aria-describedby"]: ariaDescribedBy,
|
|
2222
2201
|
...rest
|
|
2223
2202
|
} = props;
|
|
2224
|
-
const [checked, setChecked] = (0,
|
|
2225
|
-
const fallbackRef = (0,
|
|
2203
|
+
const [checked, setChecked] = (0, import_react31.useState)(defaultSelected);
|
|
2204
|
+
const fallbackRef = (0, import_react31.useRef)(null);
|
|
2226
2205
|
const refObj = ref || fallbackRef;
|
|
2227
|
-
const inputId = (0,
|
|
2206
|
+
const inputId = (0, import_react31.useId)();
|
|
2228
2207
|
const isControlled = typeof selected === "boolean";
|
|
2229
|
-
(0,
|
|
2208
|
+
(0, import_react31.useEffect)(() => {
|
|
2230
2209
|
if (isControlled) {
|
|
2231
2210
|
setChecked(selected);
|
|
2232
2211
|
}
|
|
@@ -2235,7 +2214,7 @@ var Checkbox = (0, import_react32.forwardRef)((props, ref) => {
|
|
|
2235
2214
|
validationState,
|
|
2236
2215
|
isInvalid
|
|
2237
2216
|
});
|
|
2238
|
-
const sharedClasses = (0,
|
|
2217
|
+
const sharedClasses = (0, import_dedupe16.default)(
|
|
2239
2218
|
{
|
|
2240
2219
|
"--is-disabled": isDisabled,
|
|
2241
2220
|
"--is-selected": checked,
|
|
@@ -2244,31 +2223,31 @@ var Checkbox = (0, import_react32.forwardRef)((props, ref) => {
|
|
|
2244
2223
|
},
|
|
2245
2224
|
validationClasses
|
|
2246
2225
|
);
|
|
2247
|
-
const wrapperClasses = (0,
|
|
2226
|
+
const wrapperClasses = (0, import_dedupe16.default)(
|
|
2248
2227
|
"mobius",
|
|
2249
2228
|
"mobius-checkbox",
|
|
2250
2229
|
sharedClasses,
|
|
2251
2230
|
className
|
|
2252
2231
|
);
|
|
2253
|
-
const labelClasses = (0,
|
|
2254
|
-
const inputClasses = (0,
|
|
2255
|
-
const iconClasses = (0,
|
|
2256
|
-
const errorMessageId = (0,
|
|
2232
|
+
const labelClasses = (0, import_dedupe16.default)("mobius-checkbox__label", sharedClasses);
|
|
2233
|
+
const inputClasses = (0, import_dedupe16.default)("mobius-checkbox__input", sharedClasses);
|
|
2234
|
+
const iconClasses = (0, import_dedupe16.default)("mobius-checkbox__icon", sharedClasses);
|
|
2235
|
+
const errorMessageId = (0, import_react31.useId)();
|
|
2257
2236
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2258
2237
|
const describedBy = spaceDelimitedList([
|
|
2259
2238
|
shouldErrorMessageShow,
|
|
2260
2239
|
ariaDescribedBy
|
|
2261
2240
|
]);
|
|
2262
|
-
const labelId = (0,
|
|
2241
|
+
const labelId = (0, import_react31.useId)();
|
|
2263
2242
|
const handleChange = (event) => {
|
|
2264
2243
|
setChecked(!checked);
|
|
2265
2244
|
if (onChange) {
|
|
2266
2245
|
onChange(event, isLastItem);
|
|
2267
2246
|
}
|
|
2268
2247
|
};
|
|
2269
|
-
return /* @__PURE__ */ (0,
|
|
2270
|
-
/* @__PURE__ */ (0,
|
|
2271
|
-
/* @__PURE__ */ (0,
|
|
2248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Stack, { gap: "xs", className: wrapperClasses, children: [
|
|
2249
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: labelClasses, children: [
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2272
2251
|
"input",
|
|
2273
2252
|
{
|
|
2274
2253
|
"aria-describedby": describedBy,
|
|
@@ -2289,7 +2268,7 @@ var Checkbox = (0, import_react32.forwardRef)((props, ref) => {
|
|
|
2289
2268
|
...rest
|
|
2290
2269
|
}
|
|
2291
2270
|
),
|
|
2292
|
-
/* @__PURE__ */ (0,
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2293
2272
|
Icon,
|
|
2294
2273
|
{
|
|
2295
2274
|
icon: checked ? import_icons7.squareTick : import_icons7.square,
|
|
@@ -2297,18 +2276,18 @@ var Checkbox = (0, import_react32.forwardRef)((props, ref) => {
|
|
|
2297
2276
|
className: iconClasses
|
|
2298
2277
|
}
|
|
2299
2278
|
),
|
|
2300
|
-
/* @__PURE__ */ (0,
|
|
2279
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { id: labelId, className: "mobius-checkbox__visible-label", children: label })
|
|
2301
2280
|
] }),
|
|
2302
|
-
/* @__PURE__ */ (0,
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2303
2282
|
] });
|
|
2304
2283
|
});
|
|
2305
2284
|
Checkbox.displayName = "Checkbox";
|
|
2306
2285
|
|
|
2307
2286
|
// src/components/Checkbox/CheckboxGroup.tsx
|
|
2308
|
-
var
|
|
2309
|
-
var
|
|
2310
|
-
var
|
|
2311
|
-
var CheckboxGroup = (0,
|
|
2287
|
+
var import_dedupe17 = __toESM(require("classnames/dedupe"));
|
|
2288
|
+
var import_react32 = require("react");
|
|
2289
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2290
|
+
var CheckboxGroup = (0, import_react32.forwardRef)((props, ref) => {
|
|
2312
2291
|
const {
|
|
2313
2292
|
label,
|
|
2314
2293
|
isDisabled = false,
|
|
@@ -2326,10 +2305,10 @@ var CheckboxGroup = (0, import_react33.forwardRef)((props, ref) => {
|
|
|
2326
2305
|
lastItemDisables = false,
|
|
2327
2306
|
...rest
|
|
2328
2307
|
} = props;
|
|
2329
|
-
const [selected, setSelected] = (0,
|
|
2330
|
-
const isInitializedRef = (0,
|
|
2331
|
-
const prevDefaultValueRef = (0,
|
|
2332
|
-
(0,
|
|
2308
|
+
const [selected, setSelected] = (0, import_react32.useState)(defaultValue);
|
|
2309
|
+
const isInitializedRef = (0, import_react32.useRef)(false);
|
|
2310
|
+
const prevDefaultValueRef = (0, import_react32.useRef)(defaultValue);
|
|
2311
|
+
(0, import_react32.useEffect)(() => {
|
|
2333
2312
|
const hasChanged = defaultValue.length !== prevDefaultValueRef.current.length || defaultValue.some(
|
|
2334
2313
|
(val, index) => val !== prevDefaultValueRef.current[index]
|
|
2335
2314
|
);
|
|
@@ -2339,7 +2318,7 @@ var CheckboxGroup = (0, import_react33.forwardRef)((props, ref) => {
|
|
|
2339
2318
|
isInitializedRef.current = true;
|
|
2340
2319
|
}
|
|
2341
2320
|
}, [defaultValue]);
|
|
2342
|
-
const checkboxGroupClasses = (0,
|
|
2321
|
+
const checkboxGroupClasses = (0, import_dedupe17.default)(
|
|
2343
2322
|
"mobius",
|
|
2344
2323
|
"mobius-checkbox-group",
|
|
2345
2324
|
className,
|
|
@@ -2354,19 +2333,19 @@ var CheckboxGroup = (0, import_react33.forwardRef)((props, ref) => {
|
|
|
2354
2333
|
validationState,
|
|
2355
2334
|
isInvalid
|
|
2356
2335
|
});
|
|
2357
|
-
const labelClasses = (0,
|
|
2336
|
+
const labelClasses = (0, import_dedupe17.default)(
|
|
2358
2337
|
{
|
|
2359
2338
|
"--is-disabled": isDisabled
|
|
2360
2339
|
},
|
|
2361
2340
|
validationClasses
|
|
2362
2341
|
);
|
|
2363
|
-
const errorMessageId = (0,
|
|
2342
|
+
const errorMessageId = (0, import_react32.useId)();
|
|
2364
2343
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2365
2344
|
const describedBy = spaceDelimitedList([
|
|
2366
2345
|
shouldErrorMessageShow,
|
|
2367
2346
|
props["aria-describedby"]
|
|
2368
2347
|
]);
|
|
2369
|
-
const labelId = (0,
|
|
2348
|
+
const labelId = (0, import_react32.useId)();
|
|
2370
2349
|
const handleChange = (event, isLastItem = false) => {
|
|
2371
2350
|
const {
|
|
2372
2351
|
target: { value, checked }
|
|
@@ -2384,12 +2363,12 @@ var CheckboxGroup = (0, import_react33.forwardRef)((props, ref) => {
|
|
|
2384
2363
|
setSelected(newValue);
|
|
2385
2364
|
onChange?.(newValue);
|
|
2386
2365
|
};
|
|
2387
|
-
const childrenArray =
|
|
2366
|
+
const childrenArray = import_react32.Children.toArray(children);
|
|
2388
2367
|
const lastCheckbox = childrenArray.filter(
|
|
2389
|
-
(child) => (0,
|
|
2368
|
+
(child) => (0, import_react32.isValidElement)(child) && child.type === Checkbox
|
|
2390
2369
|
).pop();
|
|
2391
2370
|
const lastCheckboxIsChecked = lastCheckbox && selected.includes(lastCheckbox.props.value);
|
|
2392
|
-
return /* @__PURE__ */ (0,
|
|
2371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2393
2372
|
"div",
|
|
2394
2373
|
{
|
|
2395
2374
|
...rest,
|
|
@@ -2398,16 +2377,16 @@ var CheckboxGroup = (0, import_react33.forwardRef)((props, ref) => {
|
|
|
2398
2377
|
className: checkboxGroupClasses,
|
|
2399
2378
|
role: "group",
|
|
2400
2379
|
style: {
|
|
2401
|
-
"--checkbox-items-per-row": itemsPerRow ||
|
|
2380
|
+
"--checkbox-items-per-row": itemsPerRow || import_react32.Children.count(children)
|
|
2402
2381
|
},
|
|
2403
2382
|
children: [
|
|
2404
|
-
label && /* @__PURE__ */ (0,
|
|
2405
|
-
/* @__PURE__ */ (0,
|
|
2406
|
-
if ((0,
|
|
2383
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Label, { elementType: "span", id: labelId, className: labelClasses, children: label }),
|
|
2384
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mobius-checkbox-group__wrapper", children: childrenArray.map((child) => {
|
|
2385
|
+
if ((0, import_react32.isValidElement)(child)) {
|
|
2407
2386
|
const isLastItem = child === lastCheckbox;
|
|
2408
2387
|
const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
|
|
2409
2388
|
const childProps = child.props;
|
|
2410
|
-
return (0,
|
|
2389
|
+
return (0, import_react32.cloneElement)(
|
|
2411
2390
|
child,
|
|
2412
2391
|
{
|
|
2413
2392
|
isDisabled: isChildDisabled,
|
|
@@ -2423,7 +2402,7 @@ var CheckboxGroup = (0, import_react33.forwardRef)((props, ref) => {
|
|
|
2423
2402
|
}
|
|
2424
2403
|
return child;
|
|
2425
2404
|
}) }),
|
|
2426
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
2405
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2427
2406
|
]
|
|
2428
2407
|
}
|
|
2429
2408
|
);
|
|
@@ -2431,24 +2410,24 @@ var CheckboxGroup = (0, import_react33.forwardRef)((props, ref) => {
|
|
|
2431
2410
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
2432
2411
|
|
|
2433
2412
|
// src/components/Container/Container.tsx
|
|
2434
|
-
var
|
|
2435
|
-
var
|
|
2436
|
-
var
|
|
2437
|
-
var Container = (0,
|
|
2413
|
+
var import_react33 = require("react");
|
|
2414
|
+
var import_dedupe18 = __toESM(require("classnames/dedupe"));
|
|
2415
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2416
|
+
var Container = (0, import_react33.forwardRef)((props, ref) => {
|
|
2438
2417
|
const { elementType: Element = "div", size = "md", ...otherProps } = props;
|
|
2439
|
-
const classes = (0,
|
|
2418
|
+
const classes = (0, import_dedupe18.default)(
|
|
2440
2419
|
"mobius",
|
|
2441
2420
|
"mobius-container",
|
|
2442
2421
|
sizeClasses(size),
|
|
2443
2422
|
otherProps.className
|
|
2444
2423
|
);
|
|
2445
|
-
return /* @__PURE__ */ (0,
|
|
2424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
2446
2425
|
});
|
|
2447
2426
|
Container.displayName = "Container";
|
|
2448
2427
|
|
|
2449
2428
|
// src/components/DateField/DateField.tsx
|
|
2450
|
-
var
|
|
2451
|
-
var
|
|
2429
|
+
var import_dedupe19 = __toESM(require("classnames/dedupe"));
|
|
2430
|
+
var import_react34 = require("react");
|
|
2452
2431
|
|
|
2453
2432
|
// src/components/DateField/validation.ts
|
|
2454
2433
|
var convertToDateFormat = (date, format) => {
|
|
@@ -2483,9 +2462,9 @@ var isValidDate = (date, format = "yyyy-mm-dd") => {
|
|
|
2483
2462
|
};
|
|
2484
2463
|
|
|
2485
2464
|
// src/components/DateField/DateField.tsx
|
|
2486
|
-
var
|
|
2465
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2487
2466
|
var MIN_MAX_ERROR = '"min" value should not be greater than "max" value.';
|
|
2488
|
-
var DateField = (0,
|
|
2467
|
+
var DateField = (0, import_react34.forwardRef)(
|
|
2489
2468
|
(props, ref) => {
|
|
2490
2469
|
const {
|
|
2491
2470
|
min,
|
|
@@ -2497,10 +2476,10 @@ var DateField = (0, import_react35.forwardRef)(
|
|
|
2497
2476
|
value,
|
|
2498
2477
|
...otherProps
|
|
2499
2478
|
} = props;
|
|
2500
|
-
const [error3, setError] = (0,
|
|
2501
|
-
const [isInvalid, setIsInvalid] = (0,
|
|
2502
|
-
const localRef = (0,
|
|
2503
|
-
const classes = (0,
|
|
2479
|
+
const [error3, setError] = (0, import_react34.useState)(errorMessage);
|
|
2480
|
+
const [isInvalid, setIsInvalid] = (0, import_react34.useState)(void 0);
|
|
2481
|
+
const localRef = (0, import_react34.useRef)(null);
|
|
2482
|
+
const classes = (0, import_dedupe19.default)("mobius-date-field", className);
|
|
2504
2483
|
const formattedMin = min ? convertToDateFormat(min, format) : void 0;
|
|
2505
2484
|
const formattedMax = max ? convertToDateFormat(max, format) : void 0;
|
|
2506
2485
|
const formattedDefaultValue = defaultValue ? convertToDateFormat(defaultValue, format) : void 0;
|
|
@@ -2513,7 +2492,7 @@ var DateField = (0, import_react35.forwardRef)(
|
|
|
2513
2492
|
setError(props.errorMessage);
|
|
2514
2493
|
setIsInvalid(false);
|
|
2515
2494
|
};
|
|
2516
|
-
(0,
|
|
2495
|
+
(0, import_react34.useEffect)(() => {
|
|
2517
2496
|
if (!isValidDate(min, format)) {
|
|
2518
2497
|
setInvalidState(`Invalid min date: ${min}`);
|
|
2519
2498
|
return;
|
|
@@ -2546,7 +2525,7 @@ var DateField = (0, import_react35.forwardRef)(
|
|
|
2546
2525
|
validate();
|
|
2547
2526
|
otherProps.onBlur?.(event);
|
|
2548
2527
|
};
|
|
2549
|
-
return /* @__PURE__ */ (0,
|
|
2528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2550
2529
|
TextField,
|
|
2551
2530
|
{
|
|
2552
2531
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -2567,42 +2546,42 @@ var DateField = (0, import_react35.forwardRef)(
|
|
|
2567
2546
|
DateField.displayName = "DateField";
|
|
2568
2547
|
|
|
2569
2548
|
// src/components/Divider/Divider.tsx
|
|
2570
|
-
var
|
|
2571
|
-
var
|
|
2549
|
+
var import_dedupe20 = __toESM(require("classnames/dedupe"));
|
|
2550
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2572
2551
|
var Divider = ({
|
|
2573
2552
|
"aria-orientation": ariaOrientation = "horizontal",
|
|
2574
2553
|
className,
|
|
2575
2554
|
...rest
|
|
2576
2555
|
}) => {
|
|
2577
|
-
const classes = (0,
|
|
2578
|
-
return /* @__PURE__ */ (0,
|
|
2556
|
+
const classes = (0, import_dedupe20.default)("mobius", "mobius-divider", className);
|
|
2557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2579
2558
|
"div",
|
|
2580
2559
|
{
|
|
2581
2560
|
className: classes,
|
|
2582
2561
|
role: "separator",
|
|
2583
2562
|
"aria-orientation": ariaOrientation,
|
|
2584
2563
|
...rest,
|
|
2585
|
-
children: /* @__PURE__ */ (0,
|
|
2564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mobius-divider__inner" })
|
|
2586
2565
|
}
|
|
2587
2566
|
);
|
|
2588
2567
|
};
|
|
2589
2568
|
Divider.displayName = "Divider";
|
|
2590
2569
|
|
|
2591
2570
|
// src/components/Drawer/Content.tsx
|
|
2592
|
-
var
|
|
2593
|
-
var
|
|
2594
|
-
var Content = (0,
|
|
2595
|
-
({ children, ...otherProps }, ref) => /* @__PURE__ */ (0,
|
|
2571
|
+
var import_react35 = require("react");
|
|
2572
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2573
|
+
var Content = (0, import_react35.forwardRef)(
|
|
2574
|
+
({ children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref, ...otherProps, className: "mobius-drawer__content", children })
|
|
2596
2575
|
);
|
|
2597
2576
|
Content.displayName = "Content";
|
|
2598
2577
|
|
|
2599
2578
|
// src/components/Drawer/Drawer.tsx
|
|
2600
|
-
var
|
|
2601
|
-
var
|
|
2579
|
+
var import_dedupe21 = __toESM(require("classnames/dedupe"));
|
|
2580
|
+
var import_react37 = require("react");
|
|
2602
2581
|
|
|
2603
2582
|
// src/components/Drawer/DrawerContext.tsx
|
|
2604
|
-
var
|
|
2605
|
-
var DrawerContext = (0,
|
|
2583
|
+
var import_react36 = require("react");
|
|
2584
|
+
var DrawerContext = (0, import_react36.createContext)({
|
|
2606
2585
|
onClose: () => {
|
|
2607
2586
|
},
|
|
2608
2587
|
closeLabel: void 0,
|
|
@@ -2610,9 +2589,9 @@ var DrawerContext = (0, import_react37.createContext)({
|
|
|
2610
2589
|
});
|
|
2611
2590
|
|
|
2612
2591
|
// src/components/Drawer/Drawer.tsx
|
|
2613
|
-
var
|
|
2592
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2614
2593
|
var TRANSITION_CSS_VARIABLE = "--drawer-transition-duration";
|
|
2615
|
-
var Drawer = (0,
|
|
2594
|
+
var Drawer = (0, import_react37.forwardRef)((props, ref) => {
|
|
2616
2595
|
const {
|
|
2617
2596
|
isOpen,
|
|
2618
2597
|
className,
|
|
@@ -2623,8 +2602,8 @@ var Drawer = (0, import_react38.forwardRef)((props, ref) => {
|
|
|
2623
2602
|
onClose,
|
|
2624
2603
|
children
|
|
2625
2604
|
} = props;
|
|
2626
|
-
const dialogRef = (0,
|
|
2627
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
2605
|
+
const dialogRef = (0, import_react37.useRef)(null);
|
|
2606
|
+
const [shouldTransition, setShouldTransition] = (0, import_react37.useState)(false);
|
|
2628
2607
|
const { close } = useDialog({
|
|
2629
2608
|
ref: dialogRef,
|
|
2630
2609
|
isOpen,
|
|
@@ -2635,9 +2614,9 @@ var Drawer = (0, import_react38.forwardRef)((props, ref) => {
|
|
|
2635
2614
|
CSSVariable: TRANSITION_CSS_VARIABLE
|
|
2636
2615
|
}
|
|
2637
2616
|
});
|
|
2638
|
-
const hiddenId = `dialog-screen-reader-announce-${(0,
|
|
2639
|
-
const headerId = `dialog-header-${(0,
|
|
2640
|
-
const dialogClasses = (0,
|
|
2617
|
+
const hiddenId = `dialog-screen-reader-announce-${(0, import_react37.useId)()}`;
|
|
2618
|
+
const headerId = `dialog-header-${(0, import_react37.useId)()}`;
|
|
2619
|
+
const dialogClasses = (0, import_dedupe21.default)(
|
|
2641
2620
|
"mobius",
|
|
2642
2621
|
"mobius-drawer",
|
|
2643
2622
|
`--${direction}`,
|
|
@@ -2646,10 +2625,10 @@ var Drawer = (0, import_react38.forwardRef)((props, ref) => {
|
|
|
2646
2625
|
"--should-transition": shouldTransition
|
|
2647
2626
|
}
|
|
2648
2627
|
);
|
|
2649
|
-
(0,
|
|
2628
|
+
(0, import_react37.useEffect)(() => {
|
|
2650
2629
|
setShouldTransition(supportsDialog());
|
|
2651
2630
|
}, []);
|
|
2652
|
-
const contextValue = (0,
|
|
2631
|
+
const contextValue = (0, import_react37.useMemo)(
|
|
2653
2632
|
() => ({
|
|
2654
2633
|
onClose: close,
|
|
2655
2634
|
closeLabel,
|
|
@@ -2657,18 +2636,18 @@ var Drawer = (0, import_react38.forwardRef)((props, ref) => {
|
|
|
2657
2636
|
}),
|
|
2658
2637
|
[close, closeLabel, headerId]
|
|
2659
2638
|
);
|
|
2660
|
-
return /* @__PURE__ */ (0,
|
|
2639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2661
2640
|
"dialog",
|
|
2662
2641
|
{
|
|
2663
|
-
id: (0,
|
|
2642
|
+
id: (0, import_react37.useId)(),
|
|
2664
2643
|
ref: mergeRefs([dialogRef, ref]),
|
|
2665
2644
|
onCancel: close,
|
|
2666
2645
|
className: dialogClasses,
|
|
2667
2646
|
"aria-describedby": hiddenId,
|
|
2668
2647
|
"aria-labelledby": headerId,
|
|
2669
2648
|
children: [
|
|
2670
|
-
/* @__PURE__ */ (0,
|
|
2671
|
-
/* @__PURE__ */ (0,
|
|
2649
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { id: hiddenId, children: announce }) }),
|
|
2650
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DrawerContext.Provider, { value: contextValue, children })
|
|
2672
2651
|
]
|
|
2673
2652
|
}
|
|
2674
2653
|
);
|
|
@@ -2676,22 +2655,22 @@ var Drawer = (0, import_react38.forwardRef)((props, ref) => {
|
|
|
2676
2655
|
Drawer.displayName = "Drawer";
|
|
2677
2656
|
|
|
2678
2657
|
// src/components/Drawer/useDrawer.ts
|
|
2679
|
-
var
|
|
2658
|
+
var import_react38 = require("react");
|
|
2680
2659
|
var useDrawer = () => {
|
|
2681
|
-
const { onClose, closeLabel, headerId } = (0,
|
|
2660
|
+
const { onClose, closeLabel, headerId } = (0, import_react38.useContext)(DrawerContext);
|
|
2682
2661
|
return { onClose, closeLabel, headerId };
|
|
2683
2662
|
};
|
|
2684
2663
|
|
|
2685
2664
|
// src/components/Drawer/Header.tsx
|
|
2686
|
-
var
|
|
2665
|
+
var import_react39 = require("react");
|
|
2687
2666
|
var import_icons8 = require("@simplybusiness/icons");
|
|
2688
|
-
var
|
|
2689
|
-
var Header = (0,
|
|
2667
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2668
|
+
var Header = (0, import_react39.forwardRef)(
|
|
2690
2669
|
({ children, ...otherProps }, ref) => {
|
|
2691
2670
|
const { onClose, closeLabel, headerId } = useDrawer();
|
|
2692
|
-
return /* @__PURE__ */ (0,
|
|
2693
|
-
/* @__PURE__ */ (0,
|
|
2694
|
-
/* @__PURE__ */ (0,
|
|
2671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("header", { ref, ...otherProps, className: "mobius-drawer__header", children: [
|
|
2672
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { id: headerId, children }),
|
|
2673
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2695
2674
|
Button,
|
|
2696
2675
|
{
|
|
2697
2676
|
"aria-label": "Close",
|
|
@@ -2700,7 +2679,7 @@ var Header = (0, import_react40.forwardRef)(
|
|
|
2700
2679
|
className: "mobius-drawer__close",
|
|
2701
2680
|
size: "sm",
|
|
2702
2681
|
children: [
|
|
2703
|
-
/* @__PURE__ */ (0,
|
|
2682
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { icon: import_icons8.cross }),
|
|
2704
2683
|
" ",
|
|
2705
2684
|
closeLabel
|
|
2706
2685
|
]
|
|
@@ -2719,11 +2698,11 @@ var Drawer2 = Object.assign(Drawer, {
|
|
|
2719
2698
|
Drawer2.displayName = "Drawer";
|
|
2720
2699
|
|
|
2721
2700
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2722
|
-
var
|
|
2701
|
+
var import_react40 = require("react");
|
|
2723
2702
|
var import_react_accessible_dropdown_menu_hook = __toESM(require("react-accessible-dropdown-menu-hook"));
|
|
2724
|
-
var
|
|
2725
|
-
var
|
|
2726
|
-
var DropdownMenu = (0,
|
|
2703
|
+
var import_dedupe22 = __toESM(require("classnames/dedupe"));
|
|
2704
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2705
|
+
var DropdownMenu = (0, import_react40.forwardRef)((props, ref) => {
|
|
2727
2706
|
const {
|
|
2728
2707
|
elementType: Element = "nav",
|
|
2729
2708
|
trigger,
|
|
@@ -2731,21 +2710,21 @@ var DropdownMenu = (0, import_react41.forwardRef)((props, ref) => {
|
|
|
2731
2710
|
children,
|
|
2732
2711
|
...otherProps
|
|
2733
2712
|
} = props;
|
|
2734
|
-
const [activeId, setActiveId] = (0,
|
|
2735
|
-
const numberOfItems =
|
|
2713
|
+
const [activeId, setActiveId] = (0, import_react40.useState)(null);
|
|
2714
|
+
const numberOfItems = import_react40.Children.count(children);
|
|
2736
2715
|
const {
|
|
2737
2716
|
buttonProps,
|
|
2738
2717
|
itemProps,
|
|
2739
2718
|
isOpen: open,
|
|
2740
2719
|
setIsOpen
|
|
2741
2720
|
} = (0, import_react_accessible_dropdown_menu_hook.default)(numberOfItems);
|
|
2742
|
-
const classes = (0,
|
|
2721
|
+
const classes = (0, import_dedupe22.default)(
|
|
2743
2722
|
"mobius",
|
|
2744
2723
|
"mobius-dropdown-menu",
|
|
2745
2724
|
otherProps.className
|
|
2746
2725
|
);
|
|
2747
|
-
const triggerClasses = (0,
|
|
2748
|
-
const listClasses = (0,
|
|
2726
|
+
const triggerClasses = (0, import_dedupe22.default)("mobius", "mobius-dropdown-menu__trigger");
|
|
2727
|
+
const listClasses = (0, import_dedupe22.default)("mobius", "mobius-dropdown-menu__list", {
|
|
2749
2728
|
"--is-open": open
|
|
2750
2729
|
});
|
|
2751
2730
|
const handleChildClick = ({ onClick }, index) => {
|
|
@@ -2755,16 +2734,16 @@ var DropdownMenu = (0, import_react41.forwardRef)((props, ref) => {
|
|
|
2755
2734
|
onClick();
|
|
2756
2735
|
}
|
|
2757
2736
|
};
|
|
2758
|
-
return /* @__PURE__ */ (0,
|
|
2759
|
-
trigger ? (0,
|
|
2737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Element, { ref, ...otherProps, className: classes, children: [
|
|
2738
|
+
trigger ? (0, import_react40.cloneElement)(trigger, {
|
|
2760
2739
|
className: triggerClasses,
|
|
2761
2740
|
open,
|
|
2762
2741
|
label,
|
|
2763
2742
|
...buttonProps
|
|
2764
|
-
}) : /* @__PURE__ */ (0,
|
|
2765
|
-
/* @__PURE__ */ (0,
|
|
2766
|
-
if ((0,
|
|
2767
|
-
return (0,
|
|
2743
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
2744
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("ul", { className: listClasses, role: "menu", children: import_react40.Children.map(children, (child, index) => {
|
|
2745
|
+
if ((0, import_react40.isValidElement)(child)) {
|
|
2746
|
+
return (0, import_react40.cloneElement)(child, {
|
|
2768
2747
|
onClick: () => handleChildClick(child.props, index),
|
|
2769
2748
|
active: index === activeId,
|
|
2770
2749
|
...itemProps[index]
|
|
@@ -2777,10 +2756,10 @@ var DropdownMenu = (0, import_react41.forwardRef)((props, ref) => {
|
|
|
2777
2756
|
DropdownMenu.displayName = "DropdownMenu";
|
|
2778
2757
|
|
|
2779
2758
|
// src/components/DropdownMenu/Item.tsx
|
|
2780
|
-
var
|
|
2781
|
-
var
|
|
2782
|
-
var
|
|
2783
|
-
var Item = (0,
|
|
2759
|
+
var import_react41 = require("react");
|
|
2760
|
+
var import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
2761
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2762
|
+
var Item = (0, import_react41.forwardRef)(
|
|
2784
2763
|
(props, ref) => {
|
|
2785
2764
|
const {
|
|
2786
2765
|
elementType: Element = "li",
|
|
@@ -2789,26 +2768,26 @@ var Item = (0, import_react42.forwardRef)(
|
|
|
2789
2768
|
children,
|
|
2790
2769
|
...otherProps
|
|
2791
2770
|
} = props;
|
|
2792
|
-
const classes = (0,
|
|
2771
|
+
const classes = (0, import_dedupe23.default)(
|
|
2793
2772
|
"mobius",
|
|
2794
2773
|
"mobius-dropdown-menu__item",
|
|
2795
2774
|
{ "--is-active": active },
|
|
2796
2775
|
otherProps.className
|
|
2797
2776
|
);
|
|
2798
|
-
return /* @__PURE__ */ (0,
|
|
2799
|
-
if ((0,
|
|
2800
|
-
const childClasses = (0,
|
|
2777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Element, { ref, onClick, ...otherProps, children: import_react41.Children.map(children, (child) => {
|
|
2778
|
+
if ((0, import_react41.isValidElement)(child)) {
|
|
2779
|
+
const childClasses = (0, import_dedupe23.default)(
|
|
2801
2780
|
child.props.className,
|
|
2802
2781
|
classes
|
|
2803
2782
|
);
|
|
2804
|
-
return (0,
|
|
2783
|
+
return (0, import_react41.cloneElement)(
|
|
2805
2784
|
child,
|
|
2806
2785
|
{
|
|
2807
2786
|
className: childClasses
|
|
2808
2787
|
}
|
|
2809
2788
|
);
|
|
2810
2789
|
}
|
|
2811
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: classes, children: child });
|
|
2812
2791
|
}) });
|
|
2813
2792
|
}
|
|
2814
2793
|
);
|
|
@@ -2824,16 +2803,16 @@ var DropdownMenu2 = Object.assign(
|
|
|
2824
2803
|
DropdownMenu2.displayName = "DropdownMenu";
|
|
2825
2804
|
|
|
2826
2805
|
// src/components/Fieldset/Fieldset.tsx
|
|
2827
|
-
var
|
|
2828
|
-
var
|
|
2829
|
-
var
|
|
2806
|
+
var import_dedupe24 = __toESM(require("classnames/dedupe"));
|
|
2807
|
+
var import_react42 = require("react");
|
|
2808
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2830
2809
|
var useFieldset = (props) => {
|
|
2831
2810
|
const { legend } = props;
|
|
2832
2811
|
let legendProps = {};
|
|
2833
2812
|
let containerProps = {
|
|
2834
2813
|
role: "group"
|
|
2835
2814
|
};
|
|
2836
|
-
const legendId = (0,
|
|
2815
|
+
const legendId = (0, import_react42.useId)();
|
|
2837
2816
|
if (legend) {
|
|
2838
2817
|
legendProps = {
|
|
2839
2818
|
...legendProps,
|
|
@@ -2849,28 +2828,28 @@ var useFieldset = (props) => {
|
|
|
2849
2828
|
containerProps
|
|
2850
2829
|
};
|
|
2851
2830
|
};
|
|
2852
|
-
var Fieldset = (0,
|
|
2831
|
+
var Fieldset = (0, import_react42.forwardRef)((props, _ref) => {
|
|
2853
2832
|
const {
|
|
2854
2833
|
children,
|
|
2855
2834
|
legend,
|
|
2856
|
-
legendComponent = /* @__PURE__ */ (0,
|
|
2835
|
+
legendComponent = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("legend", {}),
|
|
2857
2836
|
...otherProps
|
|
2858
2837
|
} = props;
|
|
2859
2838
|
const { legendProps, containerProps } = useFieldset(props);
|
|
2860
|
-
const classes = (0,
|
|
2839
|
+
const classes = (0, import_dedupe24.default)("mobius", "mobius-fieldset", props.className);
|
|
2861
2840
|
legendProps.className = "mobius-fieldset__legend";
|
|
2862
|
-
return /* @__PURE__ */ (0,
|
|
2863
|
-
legend && (0,
|
|
2841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
2842
|
+
legend && (0, import_react42.cloneElement)(legendComponent, { ...legendProps }, [legend]),
|
|
2864
2843
|
children
|
|
2865
2844
|
] });
|
|
2866
2845
|
});
|
|
2867
2846
|
Fieldset.displayName = "Fieldset";
|
|
2868
2847
|
|
|
2869
2848
|
// src/components/Grid/Grid.tsx
|
|
2870
|
-
var
|
|
2871
|
-
var
|
|
2872
|
-
var
|
|
2873
|
-
var Grid = (0,
|
|
2849
|
+
var import_react43 = require("react");
|
|
2850
|
+
var import_dedupe25 = __toESM(require("classnames/dedupe"));
|
|
2851
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2852
|
+
var Grid = (0, import_react43.forwardRef)(
|
|
2874
2853
|
(props, _ref) => {
|
|
2875
2854
|
const {
|
|
2876
2855
|
columns = 12,
|
|
@@ -2885,7 +2864,7 @@ var Grid = (0, import_react44.forwardRef)(
|
|
|
2885
2864
|
style,
|
|
2886
2865
|
...rest
|
|
2887
2866
|
} = props;
|
|
2888
|
-
const classes = (0,
|
|
2867
|
+
const classes = (0, import_dedupe25.default)("mobius", "mobius-grid", className);
|
|
2889
2868
|
const styles = filterUndefinedProps({
|
|
2890
2869
|
boxSizing: "border-box",
|
|
2891
2870
|
display: "grid",
|
|
@@ -2899,22 +2878,22 @@ var Grid = (0, import_react44.forwardRef)(
|
|
|
2899
2878
|
justifyItems,
|
|
2900
2879
|
...style
|
|
2901
2880
|
});
|
|
2902
|
-
return /* @__PURE__ */ (0,
|
|
2881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: styles, className: classes, ...rest });
|
|
2903
2882
|
}
|
|
2904
2883
|
);
|
|
2905
2884
|
Grid.displayName = "Grid";
|
|
2906
2885
|
|
|
2907
2886
|
// src/components/Grid/Item.tsx
|
|
2908
|
-
var
|
|
2909
|
-
var
|
|
2910
|
-
var
|
|
2887
|
+
var import_react44 = require("react");
|
|
2888
|
+
var import_dedupe26 = __toESM(require("classnames/dedupe"));
|
|
2889
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2911
2890
|
var getBreakpointMap = (config) => Object.entries(config).reduce((prev, [key, value]) => {
|
|
2912
2891
|
const previous = Object.values(prev);
|
|
2913
2892
|
const lastDefined = previous[previous.length - 1];
|
|
2914
2893
|
return { ...prev, [key]: value || lastDefined };
|
|
2915
2894
|
}, {});
|
|
2916
2895
|
var DEFAULT_SPAN = 12;
|
|
2917
|
-
var GridItem = (0,
|
|
2896
|
+
var GridItem = (0, import_react44.forwardRef)((props, _ref) => {
|
|
2918
2897
|
const {
|
|
2919
2898
|
breakpoint: { size: breakpointSize }
|
|
2920
2899
|
} = useBreakpoint();
|
|
@@ -2939,9 +2918,9 @@ var GridItem = (0, import_react45.forwardRef)((props, _ref) => {
|
|
|
2939
2918
|
xl,
|
|
2940
2919
|
xxl
|
|
2941
2920
|
});
|
|
2942
|
-
const [responsiveSpan, setResponsiveSpan] = (0,
|
|
2943
|
-
const classes = (0,
|
|
2944
|
-
(0,
|
|
2921
|
+
const [responsiveSpan, setResponsiveSpan] = (0, import_react44.useState)();
|
|
2922
|
+
const classes = (0, import_dedupe26.default)("mobius-grid__item", className);
|
|
2923
|
+
(0, import_react44.useEffect)(() => {
|
|
2945
2924
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
2946
2925
|
}, [breakpointSize, breakpointMap]);
|
|
2947
2926
|
const styles = {
|
|
@@ -2949,7 +2928,7 @@ var GridItem = (0, import_react45.forwardRef)((props, _ref) => {
|
|
|
2949
2928
|
alignSelf,
|
|
2950
2929
|
justifySelf
|
|
2951
2930
|
};
|
|
2952
|
-
return /* @__PURE__ */ (0,
|
|
2931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { ...styles }, className: classes, ...rest });
|
|
2953
2932
|
});
|
|
2954
2933
|
GridItem.displayName = "GridItem";
|
|
2955
2934
|
|
|
@@ -2960,22 +2939,22 @@ var Grid2 = Object.assign(Grid, {
|
|
|
2960
2939
|
Grid2.displayName = "Grid";
|
|
2961
2940
|
|
|
2962
2941
|
// src/components/Image/Image.tsx
|
|
2963
|
-
var
|
|
2964
|
-
var
|
|
2965
|
-
var
|
|
2966
|
-
var Image = (0,
|
|
2942
|
+
var import_react45 = require("react");
|
|
2943
|
+
var import_dedupe27 = __toESM(require("classnames/dedupe"));
|
|
2944
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2945
|
+
var Image = (0, import_react45.forwardRef)(
|
|
2967
2946
|
({ alt, elementType: Component = "img", ...otherProps }, ref) => {
|
|
2968
|
-
const classes = (0,
|
|
2969
|
-
return /* @__PURE__ */ (0,
|
|
2947
|
+
const classes = (0, import_dedupe27.default)("mobius", "mobius-image", otherProps.className);
|
|
2948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Component, { alt, ref, ...otherProps, className: classes });
|
|
2970
2949
|
}
|
|
2971
2950
|
);
|
|
2972
2951
|
Image.displayName = "Image";
|
|
2973
2952
|
|
|
2974
2953
|
// src/components/Link/Link.tsx
|
|
2975
|
-
var
|
|
2976
|
-
var
|
|
2977
|
-
var
|
|
2978
|
-
var Link = (0,
|
|
2954
|
+
var import_react46 = require("react");
|
|
2955
|
+
var import_dedupe28 = __toESM(require("classnames/dedupe"));
|
|
2956
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2957
|
+
var Link = (0, import_react46.forwardRef)(
|
|
2979
2958
|
(props, ref) => {
|
|
2980
2959
|
const {
|
|
2981
2960
|
isDisabled = false,
|
|
@@ -2989,7 +2968,7 @@ var Link = (0, import_react47.forwardRef)(
|
|
|
2989
2968
|
pointerEvents: "none"
|
|
2990
2969
|
};
|
|
2991
2970
|
const styles = { ...style, ...isDisabled && disabledStyles };
|
|
2992
|
-
const classes = (0,
|
|
2971
|
+
const classes = (0, import_dedupe28.default)(
|
|
2993
2972
|
"mobius",
|
|
2994
2973
|
"mobius-link",
|
|
2995
2974
|
className,
|
|
@@ -2998,7 +2977,7 @@ var Link = (0, import_react47.forwardRef)(
|
|
|
2998
2977
|
"--is-disabled": isDisabled
|
|
2999
2978
|
}
|
|
3000
2979
|
);
|
|
3001
|
-
return /* @__PURE__ */ (0,
|
|
2980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3002
2981
|
Component,
|
|
3003
2982
|
{
|
|
3004
2983
|
ref,
|
|
@@ -3014,8 +2993,8 @@ var Link = (0, import_react47.forwardRef)(
|
|
|
3014
2993
|
Link.displayName = "Link";
|
|
3015
2994
|
|
|
3016
2995
|
// src/components/LinkButton/LinkButton.tsx
|
|
3017
|
-
var
|
|
3018
|
-
var
|
|
2996
|
+
var import_dedupe29 = __toESM(require("classnames/dedupe"));
|
|
2997
|
+
var import_jsx_runtime36 = (
|
|
3019
2998
|
// @ts-expect-error Button only allows elementType of string, not React component
|
|
3020
2999
|
require("react/jsx-runtime")
|
|
3021
3000
|
);
|
|
@@ -3029,15 +3008,15 @@ function LinkButton({
|
|
|
3029
3008
|
if (!href) {
|
|
3030
3009
|
throw new Error("LinkButton requires a href prop");
|
|
3031
3010
|
}
|
|
3032
|
-
const classes = (0,
|
|
3033
|
-
return /* @__PURE__ */ (0,
|
|
3011
|
+
const classes = (0, import_dedupe29.default)("mobius", "mobius-link-button", className);
|
|
3012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { elementType, href, className: classes, ...rest, children });
|
|
3034
3013
|
}
|
|
3035
3014
|
|
|
3036
3015
|
// src/components/List/List.tsx
|
|
3037
|
-
var
|
|
3038
|
-
var
|
|
3039
|
-
var
|
|
3040
|
-
var List = (0,
|
|
3016
|
+
var import_react47 = require("react");
|
|
3017
|
+
var import_dedupe30 = __toESM(require("classnames/dedupe"));
|
|
3018
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3019
|
+
var List = (0, import_react47.forwardRef)(
|
|
3041
3020
|
(props, ref) => {
|
|
3042
3021
|
const Component = props.isOrdered ? "ol" : "ul";
|
|
3043
3022
|
const { children, icon, ...otherProps } = props;
|
|
@@ -3046,7 +3025,7 @@ var List = (0, import_react48.forwardRef)(
|
|
|
3046
3025
|
...restProps,
|
|
3047
3026
|
reversed: isReversed
|
|
3048
3027
|
};
|
|
3049
|
-
const classes = (0,
|
|
3028
|
+
const classes = (0, import_dedupe30.default)(
|
|
3050
3029
|
"mobius",
|
|
3051
3030
|
"mobius-list",
|
|
3052
3031
|
{
|
|
@@ -3055,9 +3034,9 @@ var List = (0, import_react48.forwardRef)(
|
|
|
3055
3034
|
},
|
|
3056
3035
|
otherProps.className
|
|
3057
3036
|
);
|
|
3058
|
-
return /* @__PURE__ */ (0,
|
|
3059
|
-
if ((0,
|
|
3060
|
-
return (0,
|
|
3037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Component, { ref, ...mappedProps, className: classes, children: import_react47.Children.map(children, (child) => {
|
|
3038
|
+
if ((0, import_react47.isValidElement)(child)) {
|
|
3039
|
+
return (0, import_react47.cloneElement)(child, {
|
|
3061
3040
|
parentIcon: icon
|
|
3062
3041
|
});
|
|
3063
3042
|
}
|
|
@@ -3068,13 +3047,13 @@ var List = (0, import_react48.forwardRef)(
|
|
|
3068
3047
|
List.displayName = "List";
|
|
3069
3048
|
|
|
3070
3049
|
// src/components/List/ListItem.tsx
|
|
3071
|
-
var
|
|
3072
|
-
var
|
|
3073
|
-
var
|
|
3074
|
-
var ListItem = (0,
|
|
3050
|
+
var import_react48 = require("react");
|
|
3051
|
+
var import_dedupe31 = __toESM(require("classnames/dedupe"));
|
|
3052
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3053
|
+
var ListItem = (0, import_react48.forwardRef)((props, ref) => {
|
|
3075
3054
|
const { parentIcon, icon, children, ...otherProps } = props;
|
|
3076
3055
|
const iconContent = icon || parentIcon;
|
|
3077
|
-
const classes = (0,
|
|
3056
|
+
const classes = (0, import_dedupe31.default)(
|
|
3078
3057
|
"mobius",
|
|
3079
3058
|
"mobius-list__item",
|
|
3080
3059
|
{
|
|
@@ -3082,42 +3061,42 @@ var ListItem = (0, import_react49.forwardRef)((props, ref) => {
|
|
|
3082
3061
|
},
|
|
3083
3062
|
props.className
|
|
3084
3063
|
);
|
|
3085
|
-
const contentClasses = (0,
|
|
3086
|
-
const iconClasses = (0,
|
|
3064
|
+
const contentClasses = (0, import_dedupe31.default)("mobius", "mobius-list__item-content");
|
|
3065
|
+
const iconClasses = (0, import_dedupe31.default)("mobius", "mobius-list__icon");
|
|
3087
3066
|
if (iconContent) {
|
|
3088
|
-
return /* @__PURE__ */ (0,
|
|
3089
|
-
/* @__PURE__ */ (0,
|
|
3067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: contentClasses, children: [
|
|
3068
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: iconClasses, children: iconContent }),
|
|
3090
3069
|
children
|
|
3091
3070
|
] }) });
|
|
3092
3071
|
}
|
|
3093
|
-
return /* @__PURE__ */ (0,
|
|
3072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { ref, ...otherProps, className: classes, children });
|
|
3094
3073
|
});
|
|
3095
3074
|
ListItem.displayName = "ListItem";
|
|
3096
3075
|
|
|
3097
3076
|
// src/components/LoadingIndicator/LoadingIndicator.tsx
|
|
3098
|
-
var
|
|
3099
|
-
var
|
|
3077
|
+
var import_react49 = require("react");
|
|
3078
|
+
var import_dedupe32 = __toESM(require("classnames/dedupe"));
|
|
3100
3079
|
var import_icons9 = require("@simplybusiness/icons");
|
|
3101
|
-
var
|
|
3102
|
-
var LoadingIndicator = (0,
|
|
3080
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3081
|
+
var LoadingIndicator = (0, import_react49.forwardRef)((props, ref) => {
|
|
3103
3082
|
const { icon = import_icons9.loading, ...otherProps } = props;
|
|
3104
|
-
const classes = (0,
|
|
3083
|
+
const classes = (0, import_dedupe32.default)(
|
|
3105
3084
|
"mobius",
|
|
3106
3085
|
"mobius-loading-indicator",
|
|
3107
3086
|
otherProps.className
|
|
3108
3087
|
);
|
|
3109
|
-
return /* @__PURE__ */ (0,
|
|
3088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { icon, spin: true, ref, ...otherProps, className: classes });
|
|
3110
3089
|
});
|
|
3111
3090
|
LoadingIndicator.displayName = "LoadingIndicator";
|
|
3112
3091
|
|
|
3113
3092
|
// src/components/Logo/Logo.tsx
|
|
3114
|
-
var
|
|
3115
|
-
var
|
|
3116
|
-
var
|
|
3117
|
-
var Logo = (0,
|
|
3093
|
+
var import_react50 = require("react");
|
|
3094
|
+
var import_dedupe33 = __toESM(require("classnames/dedupe"));
|
|
3095
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3096
|
+
var Logo = (0, import_react50.forwardRef)((props, ref) => {
|
|
3118
3097
|
const { className, width, height, ...otherProps } = props;
|
|
3119
|
-
const classes = (0,
|
|
3120
|
-
return /* @__PURE__ */ (0,
|
|
3098
|
+
const classes = (0, import_dedupe33.default)("mobius", "mobius-logo", className);
|
|
3099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3121
3100
|
"svg",
|
|
3122
3101
|
{
|
|
3123
3102
|
width,
|
|
@@ -3127,7 +3106,7 @@ var Logo = (0, import_react51.forwardRef)((props, ref) => {
|
|
|
3127
3106
|
viewBox: "0 0 144 37",
|
|
3128
3107
|
...otherProps,
|
|
3129
3108
|
children: [
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3109
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3131
3110
|
"linearGradient",
|
|
3132
3111
|
{
|
|
3133
3112
|
id: "logo-gradient",
|
|
@@ -3136,27 +3115,27 @@ var Logo = (0, import_react51.forwardRef)((props, ref) => {
|
|
|
3136
3115
|
y1: "76.042%",
|
|
3137
3116
|
y2: "26.973%",
|
|
3138
3117
|
children: [
|
|
3139
|
-
/* @__PURE__ */ (0,
|
|
3140
|
-
/* @__PURE__ */ (0,
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("stop", { stopColor: "#4632D8", offset: "0%" }),
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("stop", { stopColor: "#9084E8", offset: "100%" })
|
|
3141
3120
|
]
|
|
3142
3121
|
}
|
|
3143
3122
|
) }),
|
|
3144
|
-
/* @__PURE__ */ (0,
|
|
3145
|
-
/* @__PURE__ */ (0,
|
|
3123
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("g", { children: [
|
|
3124
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3146
3125
|
"path",
|
|
3147
3126
|
{
|
|
3148
3127
|
fill: "#0E0A2B",
|
|
3149
3128
|
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"
|
|
3150
3129
|
}
|
|
3151
3130
|
),
|
|
3152
|
-
/* @__PURE__ */ (0,
|
|
3131
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3153
3132
|
"path",
|
|
3154
3133
|
{
|
|
3155
3134
|
fill: "url(#logo-gradient)",
|
|
3156
3135
|
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"
|
|
3157
3136
|
}
|
|
3158
3137
|
),
|
|
3159
|
-
/* @__PURE__ */ (0,
|
|
3138
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3160
3139
|
"path",
|
|
3161
3140
|
{
|
|
3162
3141
|
fill: "#0E0A2B",
|
|
@@ -3171,23 +3150,23 @@ var Logo = (0, import_react51.forwardRef)((props, ref) => {
|
|
|
3171
3150
|
Logo.displayName = "Logo";
|
|
3172
3151
|
|
|
3173
3152
|
// src/components/Modal/Content.tsx
|
|
3174
|
-
var
|
|
3175
|
-
var
|
|
3176
|
-
var Content2 = (0,
|
|
3177
|
-
({ children, ...otherProps }, ref) => /* @__PURE__ */ (0,
|
|
3153
|
+
var import_react51 = require("react");
|
|
3154
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3155
|
+
var Content2 = (0, import_react51.forwardRef)(
|
|
3156
|
+
({ children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { ref, ...otherProps, className: "mobius-modal__content", children })
|
|
3178
3157
|
);
|
|
3179
3158
|
Content2.displayName = "Content";
|
|
3180
3159
|
|
|
3181
3160
|
// src/components/Modal/Header.tsx
|
|
3182
|
-
var
|
|
3161
|
+
var import_react54 = require("react");
|
|
3183
3162
|
var import_icons10 = require("@simplybusiness/icons");
|
|
3184
3163
|
|
|
3185
3164
|
// src/components/Modal/useModal.ts
|
|
3186
|
-
var
|
|
3165
|
+
var import_react53 = require("react");
|
|
3187
3166
|
|
|
3188
3167
|
// src/components/Modal/ModalContext.tsx
|
|
3189
|
-
var
|
|
3190
|
-
var ModalContext = (0,
|
|
3168
|
+
var import_react52 = require("react");
|
|
3169
|
+
var ModalContext = (0, import_react52.createContext)({
|
|
3191
3170
|
onClose: () => {
|
|
3192
3171
|
},
|
|
3193
3172
|
closeLabel: void 0
|
|
@@ -3195,18 +3174,18 @@ var ModalContext = (0, import_react53.createContext)({
|
|
|
3195
3174
|
|
|
3196
3175
|
// src/components/Modal/useModal.ts
|
|
3197
3176
|
var useModal = () => {
|
|
3198
|
-
const { onClose, closeLabel } = (0,
|
|
3177
|
+
const { onClose, closeLabel } = (0, import_react53.useContext)(ModalContext);
|
|
3199
3178
|
return { onClose, closeLabel };
|
|
3200
3179
|
};
|
|
3201
3180
|
|
|
3202
3181
|
// src/components/Modal/Header.tsx
|
|
3203
|
-
var
|
|
3204
|
-
var Header2 = (0,
|
|
3182
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3183
|
+
var Header2 = (0, import_react54.forwardRef)(
|
|
3205
3184
|
({ children, ...otherProps }, ref) => {
|
|
3206
3185
|
const { onClose, closeLabel } = useModal();
|
|
3207
|
-
return /* @__PURE__ */ (0,
|
|
3186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { ref, ...otherProps, className: "mobius-modal__header", children: [
|
|
3208
3187
|
children,
|
|
3209
|
-
/* @__PURE__ */ (0,
|
|
3188
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3210
3189
|
Button,
|
|
3211
3190
|
{
|
|
3212
3191
|
"aria-label": "Close",
|
|
@@ -3214,7 +3193,7 @@ var Header2 = (0, import_react55.forwardRef)(
|
|
|
3214
3193
|
onPress: onClose,
|
|
3215
3194
|
className: "mobius-modal__close",
|
|
3216
3195
|
children: [
|
|
3217
|
-
/* @__PURE__ */ (0,
|
|
3196
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { icon: import_icons10.cross }),
|
|
3218
3197
|
" ",
|
|
3219
3198
|
closeLabel
|
|
3220
3199
|
]
|
|
@@ -3226,11 +3205,11 @@ var Header2 = (0, import_react55.forwardRef)(
|
|
|
3226
3205
|
Header2.displayName = "Header";
|
|
3227
3206
|
|
|
3228
3207
|
// src/components/Modal/Modal.tsx
|
|
3229
|
-
var
|
|
3230
|
-
var
|
|
3231
|
-
var
|
|
3208
|
+
var import_dedupe34 = __toESM(require("classnames/dedupe"));
|
|
3209
|
+
var import_react55 = require("react");
|
|
3210
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3232
3211
|
var TRANSITION_CSS_VARIABLE2 = "--modal-transition-duration";
|
|
3233
|
-
var Modal = (0,
|
|
3212
|
+
var Modal = (0, import_react55.forwardRef)((props, ref) => {
|
|
3234
3213
|
const {
|
|
3235
3214
|
isOpen,
|
|
3236
3215
|
onClose,
|
|
@@ -3248,7 +3227,7 @@ var Modal = (0, import_react56.forwardRef)((props, ref) => {
|
|
|
3248
3227
|
parentSelector,
|
|
3249
3228
|
...rest
|
|
3250
3229
|
} = props;
|
|
3251
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3230
|
+
const [shouldTransition, setShouldTransition] = (0, import_react55.useState)(false);
|
|
3252
3231
|
useDeprecationWarning({
|
|
3253
3232
|
size,
|
|
3254
3233
|
appElement,
|
|
@@ -3256,10 +3235,10 @@ var Modal = (0, import_react56.forwardRef)((props, ref) => {
|
|
|
3256
3235
|
shouldFocusAfterRender,
|
|
3257
3236
|
parentSelector
|
|
3258
3237
|
});
|
|
3259
|
-
(0,
|
|
3238
|
+
(0, import_react55.useEffect)(() => {
|
|
3260
3239
|
setShouldTransition(supportsDialog());
|
|
3261
3240
|
}, []);
|
|
3262
|
-
const dialogRef = (0,
|
|
3241
|
+
const dialogRef = (0, import_react55.useRef)(null);
|
|
3263
3242
|
const { close } = useDialog({
|
|
3264
3243
|
ref: dialogRef,
|
|
3265
3244
|
isOpen,
|
|
@@ -3270,7 +3249,7 @@ var Modal = (0, import_react56.forwardRef)((props, ref) => {
|
|
|
3270
3249
|
CSSVariable: TRANSITION_CSS_VARIABLE2
|
|
3271
3250
|
}
|
|
3272
3251
|
});
|
|
3273
|
-
const modalClasses = (0,
|
|
3252
|
+
const modalClasses = (0, import_dedupe34.default)(
|
|
3274
3253
|
"mobius",
|
|
3275
3254
|
"mobius-modal",
|
|
3276
3255
|
{
|
|
@@ -3283,21 +3262,21 @@ var Modal = (0, import_react56.forwardRef)((props, ref) => {
|
|
|
3283
3262
|
},
|
|
3284
3263
|
className
|
|
3285
3264
|
);
|
|
3286
|
-
const contextValue = (0,
|
|
3265
|
+
const contextValue = (0, import_react55.useMemo)(
|
|
3287
3266
|
() => ({
|
|
3288
3267
|
onClose: close,
|
|
3289
3268
|
closeLabel
|
|
3290
3269
|
}),
|
|
3291
3270
|
[close, closeLabel]
|
|
3292
3271
|
);
|
|
3293
|
-
return /* @__PURE__ */ (0,
|
|
3272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3294
3273
|
"dialog",
|
|
3295
3274
|
{
|
|
3296
3275
|
ref: mergeRefs([dialogRef, ref]),
|
|
3297
3276
|
onCancel: close,
|
|
3298
3277
|
className: modalClasses,
|
|
3299
3278
|
...rest,
|
|
3300
|
-
children: /* @__PURE__ */ (0,
|
|
3279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ModalContext.Provider, { value: contextValue, children })
|
|
3301
3280
|
}
|
|
3302
3281
|
);
|
|
3303
3282
|
});
|
|
@@ -3311,11 +3290,11 @@ var Modal2 = Object.assign(Modal, {
|
|
|
3311
3290
|
Modal2.displayName = "Modal";
|
|
3312
3291
|
|
|
3313
3292
|
// src/components/NumberField/NumberField.tsx
|
|
3314
|
-
var
|
|
3315
|
-
var
|
|
3316
|
-
var
|
|
3317
|
-
var
|
|
3318
|
-
var NumberField = (0,
|
|
3293
|
+
var import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3294
|
+
var import_react56 = require("react");
|
|
3295
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3296
|
+
var SMALLEST_INCREMENT = 1e-3;
|
|
3297
|
+
var NumberField = (0, import_react56.forwardRef)((props, ref) => {
|
|
3319
3298
|
const {
|
|
3320
3299
|
minValue,
|
|
3321
3300
|
maxValue,
|
|
@@ -3325,33 +3304,72 @@ var NumberField = (0, import_react58.forwardRef)((props, ref) => {
|
|
|
3325
3304
|
className,
|
|
3326
3305
|
...otherProps
|
|
3327
3306
|
} = props;
|
|
3328
|
-
const
|
|
3329
|
-
|
|
3330
|
-
|
|
3307
|
+
const {
|
|
3308
|
+
onFocus: customOnFocus,
|
|
3309
|
+
onBlur: customOnBlur,
|
|
3310
|
+
...rest
|
|
3311
|
+
} = otherProps;
|
|
3312
|
+
const focusedInputRef = (0, import_react56.useRef)(null);
|
|
3313
|
+
const wheelHandler = (0, import_react56.useCallback)((ev) => ev.preventDefault(), []);
|
|
3314
|
+
(0, import_react56.useEffect)(() => {
|
|
3331
3315
|
return () => {
|
|
3332
3316
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
3333
3317
|
focusedInputRef.current = null;
|
|
3334
3318
|
};
|
|
3335
3319
|
}, [wheelHandler]);
|
|
3336
|
-
const containerClasses = (0,
|
|
3320
|
+
const containerClasses = (0, import_dedupe35.default)("mobius-number-field", className, {
|
|
3337
3321
|
"--hide-spin-buttons": hideSpinButtons
|
|
3338
3322
|
});
|
|
3339
3323
|
const handleBeforeInput = (event) => {
|
|
3340
3324
|
const { data } = event.nativeEvent;
|
|
3341
|
-
if (step
|
|
3325
|
+
if (step && Number.isInteger(step) && data === ".") {
|
|
3342
3326
|
event.preventDefault();
|
|
3343
3327
|
}
|
|
3344
|
-
if (minValue
|
|
3328
|
+
if (minValue && minValue >= 0 && data === "-") {
|
|
3345
3329
|
event.preventDefault();
|
|
3346
3330
|
}
|
|
3347
3331
|
};
|
|
3348
|
-
const {
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3332
|
+
const handleChange = (event) => {
|
|
3333
|
+
const { value } = event.target;
|
|
3334
|
+
const numValue = parseFloat(value);
|
|
3335
|
+
if (value === "" || value === "-" || isNaN(numValue)) {
|
|
3336
|
+
otherProps.onChange?.(event);
|
|
3337
|
+
return;
|
|
3338
|
+
}
|
|
3339
|
+
if (step && step > 1) {
|
|
3340
|
+
const baseValue = minValue ?? 0;
|
|
3341
|
+
const remainder = (numValue - baseValue) % step;
|
|
3342
|
+
if (Math.abs(remainder) > SMALLEST_INCREMENT && Math.abs(remainder - step) > SMALLEST_INCREMENT) {
|
|
3343
|
+
event.preventDefault();
|
|
3344
|
+
return;
|
|
3345
|
+
}
|
|
3346
|
+
}
|
|
3347
|
+
otherProps.onChange?.(event);
|
|
3348
|
+
};
|
|
3349
|
+
const handleBlur = (event) => {
|
|
3350
|
+
const { value } = event.target;
|
|
3351
|
+
const numValue = parseFloat(value);
|
|
3352
|
+
if (step && step > 1 && !isNaN(numValue)) {
|
|
3353
|
+
const baseValue = minValue ?? 0;
|
|
3354
|
+
const steps = Math.round((numValue - baseValue) / step);
|
|
3355
|
+
const snappedValue = baseValue + steps * step;
|
|
3356
|
+
if (snappedValue !== numValue) {
|
|
3357
|
+
event.target.value = snappedValue.toString();
|
|
3358
|
+
const changeEvent = new Event("change", { bubbles: true });
|
|
3359
|
+
event.target.dispatchEvent(changeEvent);
|
|
3360
|
+
const syntheticChangeEvent = {
|
|
3361
|
+
...event,
|
|
3362
|
+
target: event.target,
|
|
3363
|
+
currentTarget: event.currentTarget
|
|
3364
|
+
};
|
|
3365
|
+
otherProps.onChange?.(syntheticChangeEvent);
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
customOnBlur?.(event);
|
|
3369
|
+
};
|
|
3353
3370
|
const forwardedProps = {
|
|
3354
3371
|
...rest,
|
|
3372
|
+
onChange: handleChange,
|
|
3355
3373
|
onFocus: (e) => {
|
|
3356
3374
|
const el = e.currentTarget;
|
|
3357
3375
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
@@ -3359,16 +3377,9 @@ var NumberField = (0, import_react58.forwardRef)((props, ref) => {
|
|
|
3359
3377
|
el.addEventListener("wheel", wheelHandler, { passive: false });
|
|
3360
3378
|
customOnFocus?.(e);
|
|
3361
3379
|
},
|
|
3362
|
-
onBlur: (e) =>
|
|
3363
|
-
const el = e.currentTarget;
|
|
3364
|
-
el.removeEventListener("wheel", wheelHandler);
|
|
3365
|
-
if (focusedInputRef.current === el) {
|
|
3366
|
-
focusedInputRef.current = null;
|
|
3367
|
-
}
|
|
3368
|
-
customOnBlur?.(e);
|
|
3369
|
-
}
|
|
3380
|
+
onBlur: (e) => handleBlur(e)
|
|
3370
3381
|
};
|
|
3371
|
-
return /* @__PURE__ */ (0,
|
|
3382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3372
3383
|
TextField,
|
|
3373
3384
|
{
|
|
3374
3385
|
...forwardedProps,
|
|
@@ -3386,28 +3397,28 @@ var NumberField = (0, import_react58.forwardRef)((props, ref) => {
|
|
|
3386
3397
|
NumberField.displayName = "NumberField";
|
|
3387
3398
|
|
|
3388
3399
|
// src/components/Option/Option.tsx
|
|
3389
|
-
var
|
|
3390
|
-
var
|
|
3391
|
-
var Option2 = (0,
|
|
3400
|
+
var import_react57 = require("react");
|
|
3401
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3402
|
+
var Option2 = (0, import_react57.forwardRef)((props, ref) => {
|
|
3392
3403
|
const { isDisabled, ...rest } = props;
|
|
3393
3404
|
const mappedProps = {
|
|
3394
3405
|
...rest,
|
|
3395
3406
|
disabled: isDisabled
|
|
3396
3407
|
};
|
|
3397
|
-
return /* @__PURE__ */ (0,
|
|
3408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("option", { ...mappedProps, ref });
|
|
3398
3409
|
});
|
|
3399
3410
|
Option2.displayName = "Option";
|
|
3400
3411
|
|
|
3401
3412
|
// src/components/PasswordField/PasswordField.tsx
|
|
3402
|
-
var
|
|
3403
|
-
var
|
|
3413
|
+
var import_dedupe36 = __toESM(require("classnames/dedupe"));
|
|
3414
|
+
var import_react58 = require("react");
|
|
3404
3415
|
|
|
3405
3416
|
// src/components/PasswordField/ShowHideButton.tsx
|
|
3406
|
-
var
|
|
3417
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3407
3418
|
var ShowHideButton = ({
|
|
3408
3419
|
show = false,
|
|
3409
3420
|
onClick
|
|
3410
|
-
}) => /* @__PURE__ */ (0,
|
|
3421
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3411
3422
|
"button",
|
|
3412
3423
|
{
|
|
3413
3424
|
className: "mobius-password-field__show-button",
|
|
@@ -3423,25 +3434,25 @@ var ShowHideButton = ({
|
|
|
3423
3434
|
);
|
|
3424
3435
|
|
|
3425
3436
|
// src/components/PasswordField/PasswordField.tsx
|
|
3426
|
-
var
|
|
3427
|
-
var PasswordField = (0,
|
|
3437
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3438
|
+
var PasswordField = (0, import_react58.forwardRef)(
|
|
3428
3439
|
({ className, ...props }, ref) => {
|
|
3429
|
-
const [show, setShow] = (0,
|
|
3440
|
+
const [show, setShow] = (0, import_react58.useState)(false);
|
|
3430
3441
|
const type = show ? "text" : "password";
|
|
3431
|
-
const classes = (0,
|
|
3432
|
-
const localRef = (0,
|
|
3442
|
+
const classes = (0, import_dedupe36.default)("mobius-password-field", className);
|
|
3443
|
+
const localRef = (0, import_react58.useRef)(null);
|
|
3433
3444
|
const handleShowHideButtonClick = () => {
|
|
3434
3445
|
setShow((oldShow) => !oldShow);
|
|
3435
3446
|
localRef.current?.focus();
|
|
3436
3447
|
};
|
|
3437
|
-
return /* @__PURE__ */ (0,
|
|
3448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3438
3449
|
TextField,
|
|
3439
3450
|
{
|
|
3440
3451
|
ref: mergeRefs([localRef, ref]),
|
|
3441
3452
|
className: classes,
|
|
3442
3453
|
...props,
|
|
3443
3454
|
type,
|
|
3444
|
-
suffixInside: /* @__PURE__ */ (0,
|
|
3455
|
+
suffixInside: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ShowHideButton, { onClick: handleShowHideButtonClick, show })
|
|
3445
3456
|
}
|
|
3446
3457
|
);
|
|
3447
3458
|
}
|
|
@@ -3449,30 +3460,30 @@ var PasswordField = (0, import_react60.forwardRef)(
|
|
|
3449
3460
|
PasswordField.displayName = "PasswordField";
|
|
3450
3461
|
|
|
3451
3462
|
// src/components/Popover/Popover.tsx
|
|
3452
|
-
var
|
|
3463
|
+
var import_react59 = require("@floating-ui/react");
|
|
3453
3464
|
var import_icons11 = require("@simplybusiness/icons");
|
|
3454
3465
|
var import_classnames3 = __toESM(require("classnames"));
|
|
3455
|
-
var
|
|
3456
|
-
var
|
|
3466
|
+
var import_react60 = require("react");
|
|
3467
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3457
3468
|
var OFFSET_FROM_CONTENT_DEFAULT = 10;
|
|
3458
3469
|
var Popover = (props) => {
|
|
3459
3470
|
const { trigger, children, onOpen, onClose, className } = props;
|
|
3460
|
-
const arrowRef = (0,
|
|
3461
|
-
const [isOpen, setIsOpen] = (0,
|
|
3462
|
-
const { refs, floatingStyles, context } = (0,
|
|
3471
|
+
const arrowRef = (0, import_react60.useRef)(null);
|
|
3472
|
+
const [isOpen, setIsOpen] = (0, import_react60.useState)(false);
|
|
3473
|
+
const { refs, floatingStyles, context } = (0, import_react59.useFloating)({
|
|
3463
3474
|
open: isOpen,
|
|
3464
3475
|
onOpenChange: setIsOpen,
|
|
3465
|
-
whileElementsMounted:
|
|
3476
|
+
whileElementsMounted: import_react59.autoUpdate,
|
|
3466
3477
|
middleware: [
|
|
3467
|
-
(0,
|
|
3478
|
+
(0, import_react59.arrow)({
|
|
3468
3479
|
element: arrowRef
|
|
3469
3480
|
}),
|
|
3470
|
-
(0,
|
|
3471
|
-
(0,
|
|
3472
|
-
(0,
|
|
3481
|
+
(0, import_react59.offset)(OFFSET_FROM_CONTENT_DEFAULT),
|
|
3482
|
+
(0, import_react59.shift)(),
|
|
3483
|
+
(0, import_react59.flip)()
|
|
3473
3484
|
]
|
|
3474
3485
|
});
|
|
3475
|
-
const dismiss = (0,
|
|
3486
|
+
const dismiss = (0, import_react59.useDismiss)(context, {
|
|
3476
3487
|
bubbles: true,
|
|
3477
3488
|
outsidePress: (event) => {
|
|
3478
3489
|
const toggle = refs.reference.current;
|
|
@@ -3483,7 +3494,7 @@ var Popover = (props) => {
|
|
|
3483
3494
|
return true;
|
|
3484
3495
|
}
|
|
3485
3496
|
});
|
|
3486
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
3497
|
+
const { getReferenceProps, getFloatingProps } = (0, import_react59.useInteractions)([dismiss]);
|
|
3487
3498
|
const containerClasses = (0, import_classnames3.default)(
|
|
3488
3499
|
"mobius",
|
|
3489
3500
|
"mobius-popover__container",
|
|
@@ -3498,7 +3509,7 @@ var Popover = (props) => {
|
|
|
3498
3509
|
setIsOpen(true);
|
|
3499
3510
|
onOpen?.();
|
|
3500
3511
|
};
|
|
3501
|
-
const triggerComponent = (0,
|
|
3512
|
+
const triggerComponent = (0, import_react60.cloneElement)(trigger, {
|
|
3502
3513
|
ref: refs.setReference,
|
|
3503
3514
|
className: (0, import_classnames3.default)(
|
|
3504
3515
|
trigger.props.className,
|
|
@@ -3514,9 +3525,9 @@ var Popover = (props) => {
|
|
|
3514
3525
|
e.stopPropagation();
|
|
3515
3526
|
}
|
|
3516
3527
|
});
|
|
3517
|
-
return /* @__PURE__ */ (0,
|
|
3528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
3518
3529
|
triggerComponent,
|
|
3519
|
-
isOpen && /* @__PURE__ */ (0,
|
|
3530
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3520
3531
|
"div",
|
|
3521
3532
|
{
|
|
3522
3533
|
className: containerClasses,
|
|
@@ -3524,8 +3535,8 @@ var Popover = (props) => {
|
|
|
3524
3535
|
style: floatingStyles,
|
|
3525
3536
|
...getFloatingProps(),
|
|
3526
3537
|
children: [
|
|
3527
|
-
/* @__PURE__ */ (0,
|
|
3528
|
-
/* @__PURE__ */ (0,
|
|
3538
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "mobius-popover", children: [
|
|
3539
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("header", { className: "mobius-popover__header", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3529
3540
|
Button,
|
|
3530
3541
|
{
|
|
3531
3542
|
type: "button",
|
|
@@ -3533,7 +3544,7 @@ var Popover = (props) => {
|
|
|
3533
3544
|
onClick: toggleVisibility,
|
|
3534
3545
|
"aria-label": "Close",
|
|
3535
3546
|
variant: "ghost",
|
|
3536
|
-
children: /* @__PURE__ */ (0,
|
|
3547
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3537
3548
|
Icon,
|
|
3538
3549
|
{
|
|
3539
3550
|
icon: import_icons11.cross,
|
|
@@ -3543,10 +3554,10 @@ var Popover = (props) => {
|
|
|
3543
3554
|
)
|
|
3544
3555
|
}
|
|
3545
3556
|
) }),
|
|
3546
|
-
/* @__PURE__ */ (0,
|
|
3557
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mobius-popover__body", children })
|
|
3547
3558
|
] }),
|
|
3548
|
-
/* @__PURE__ */ (0,
|
|
3549
|
-
|
|
3559
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3560
|
+
import_react59.FloatingArrow,
|
|
3550
3561
|
{
|
|
3551
3562
|
ref: arrowRef,
|
|
3552
3563
|
context,
|
|
@@ -3561,9 +3572,9 @@ var Popover = (props) => {
|
|
|
3561
3572
|
};
|
|
3562
3573
|
|
|
3563
3574
|
// src/components/Progress/Progress.tsx
|
|
3564
|
-
var
|
|
3565
|
-
var
|
|
3566
|
-
var
|
|
3575
|
+
var import_dedupe37 = __toESM(require("classnames/dedupe"));
|
|
3576
|
+
var import_react61 = require("react");
|
|
3577
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3567
3578
|
function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
3568
3579
|
if (minValue > maxValue) {
|
|
3569
3580
|
console.warn("minValue is greater than maxValue");
|
|
@@ -3581,7 +3592,7 @@ var sanitizedValue = (value, defaultValue) => {
|
|
|
3581
3592
|
};
|
|
3582
3593
|
var getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
3583
3594
|
if (showLabel) {
|
|
3584
|
-
return /* @__PURE__ */ (0,
|
|
3595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3585
3596
|
Label,
|
|
3586
3597
|
{
|
|
3587
3598
|
id: progressLabelId,
|
|
@@ -3591,7 +3602,7 @@ var getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
|
3591
3602
|
}
|
|
3592
3603
|
);
|
|
3593
3604
|
}
|
|
3594
|
-
return /* @__PURE__ */ (0,
|
|
3605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3595
3606
|
Label,
|
|
3596
3607
|
{
|
|
3597
3608
|
id: progressLabelId,
|
|
@@ -3604,9 +3615,9 @@ var getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
|
3604
3615
|
var DEFAULT_VALUE = 0;
|
|
3605
3616
|
var DEFAULT_MIN_VALUE = 0;
|
|
3606
3617
|
var DEFAULT_MAX_VALUE = 100;
|
|
3607
|
-
var Progress = (0,
|
|
3608
|
-
const progressId = (0,
|
|
3609
|
-
const progressLabelId = (0,
|
|
3618
|
+
var Progress = (0, import_react61.forwardRef)((props, ref) => {
|
|
3619
|
+
const progressId = (0, import_react61.useId)();
|
|
3620
|
+
const progressLabelId = (0, import_react61.useId)();
|
|
3610
3621
|
const {
|
|
3611
3622
|
id,
|
|
3612
3623
|
label,
|
|
@@ -3631,7 +3642,7 @@ var Progress = (0, import_react63.forwardRef)((props, ref) => {
|
|
|
3631
3642
|
100
|
|
3632
3643
|
);
|
|
3633
3644
|
const barWidth = `${percentage}%`;
|
|
3634
|
-
const classes = (0,
|
|
3645
|
+
const classes = (0, import_dedupe37.default)("mobius", "mobius-progress", className, {
|
|
3635
3646
|
"--is-primary": variant === "primary",
|
|
3636
3647
|
"--is-secondary": variant === "secondary"
|
|
3637
3648
|
});
|
|
@@ -3641,7 +3652,7 @@ var Progress = (0, import_react63.forwardRef)((props, ref) => {
|
|
|
3641
3652
|
progressBarProps["aria-valuenow"] = value.toString();
|
|
3642
3653
|
progressBarProps["aria-valuetext"] = valueFormatter instanceof Function ? valueFormatter(value, minValue, maxValue) : barWidth;
|
|
3643
3654
|
const labelComponent = getLabelComponent(label, progressLabelId, showLabel);
|
|
3644
|
-
return /* @__PURE__ */ (0,
|
|
3655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3645
3656
|
"div",
|
|
3646
3657
|
{
|
|
3647
3658
|
id: id || progressId,
|
|
@@ -3652,8 +3663,8 @@ var Progress = (0, import_react63.forwardRef)((props, ref) => {
|
|
|
3652
3663
|
"aria-labelledby": progressLabelId,
|
|
3653
3664
|
children: [
|
|
3654
3665
|
labelComponent,
|
|
3655
|
-
/* @__PURE__ */ (0,
|
|
3656
|
-
showValueLabel && /* @__PURE__ */ (0,
|
|
3666
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mobius-progress__track", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mobius-progress__bar", style: { width: barWidth } }) }),
|
|
3667
|
+
showValueLabel && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
|
|
3657
3668
|
]
|
|
3658
3669
|
}
|
|
3659
3670
|
);
|
|
@@ -3661,10 +3672,10 @@ var Progress = (0, import_react63.forwardRef)((props, ref) => {
|
|
|
3661
3672
|
Progress.displayName = "Progress";
|
|
3662
3673
|
|
|
3663
3674
|
// src/components/Radio/Radio.tsx
|
|
3664
|
-
var
|
|
3665
|
-
var
|
|
3666
|
-
var
|
|
3667
|
-
var Radio = (0,
|
|
3675
|
+
var import_dedupe38 = __toESM(require("classnames/dedupe"));
|
|
3676
|
+
var import_react62 = require("react");
|
|
3677
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3678
|
+
var Radio = (0, import_react62.forwardRef)(
|
|
3668
3679
|
(props, ref) => {
|
|
3669
3680
|
const {
|
|
3670
3681
|
children,
|
|
@@ -3686,10 +3697,10 @@ var Radio = (0, import_react64.forwardRef)(
|
|
|
3686
3697
|
const isMultiline = label && children;
|
|
3687
3698
|
const isControlled = selected !== void 0;
|
|
3688
3699
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
3689
|
-
const hasIconFirst = (0,
|
|
3690
|
-
if (!children ||
|
|
3691
|
-
const firstChild =
|
|
3692
|
-
if (!(0,
|
|
3700
|
+
const hasIconFirst = (0, import_react62.useMemo)(() => {
|
|
3701
|
+
if (!children || import_react62.Children.count(children) === 0) return false;
|
|
3702
|
+
const firstChild = import_react62.Children.toArray(children)[0];
|
|
3703
|
+
if (!(0, import_react62.isValidElement)(firstChild)) return false;
|
|
3693
3704
|
const props2 = firstChild.props;
|
|
3694
3705
|
return "icon" in props2 && props2.icon !== void 0;
|
|
3695
3706
|
}, [children]);
|
|
@@ -3699,13 +3710,13 @@ var Radio = (0, import_react64.forwardRef)(
|
|
|
3699
3710
|
"--is-multiline": !!isMultiline,
|
|
3700
3711
|
"--is-required": isRequired
|
|
3701
3712
|
};
|
|
3702
|
-
const containerClasses = (0,
|
|
3713
|
+
const containerClasses = (0, import_dedupe38.default)(
|
|
3703
3714
|
"mobius-radio__label",
|
|
3704
3715
|
radioClasses,
|
|
3705
3716
|
className,
|
|
3706
3717
|
{ "--has-icon-first": hasIconFirst }
|
|
3707
3718
|
);
|
|
3708
|
-
const inputClasses = (0,
|
|
3719
|
+
const inputClasses = (0, import_dedupe38.default)("mobius-radio__input", radioClasses);
|
|
3709
3720
|
const {
|
|
3710
3721
|
// @ts-expect-error - TS doesn't like the orientation prop
|
|
3711
3722
|
orientation,
|
|
@@ -3724,9 +3735,9 @@ var Radio = (0, import_react64.forwardRef)(
|
|
|
3724
3735
|
onChange(adaptedEvent);
|
|
3725
3736
|
}
|
|
3726
3737
|
};
|
|
3727
|
-
return /* @__PURE__ */ (0,
|
|
3728
|
-
/* @__PURE__ */ (0,
|
|
3729
|
-
/* @__PURE__ */ (0,
|
|
3738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
3739
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Label, { className: containerClasses, children: [
|
|
3740
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3730
3741
|
"input",
|
|
3731
3742
|
{
|
|
3732
3743
|
"aria-describedby": otherProps["aria-describedby"],
|
|
@@ -3743,21 +3754,21 @@ var Radio = (0, import_react64.forwardRef)(
|
|
|
3743
3754
|
...rest
|
|
3744
3755
|
}
|
|
3745
3756
|
),
|
|
3746
|
-
isMultiline ? /* @__PURE__ */ (0,
|
|
3747
|
-
/* @__PURE__ */ (0,
|
|
3748
|
-
/* @__PURE__ */ (0,
|
|
3749
|
-
] }) : /* @__PURE__ */ (0,
|
|
3757
|
+
isMultiline ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "mobius-radio__content--multiline", children: [
|
|
3758
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mobius-radio__content-first-line", children: label }),
|
|
3759
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mobius-radio__extra-content", children })
|
|
3760
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mobius-radio__content", children: label || children })
|
|
3750
3761
|
] }),
|
|
3751
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
3762
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ErrorMessage, { errorMessage })
|
|
3752
3763
|
] });
|
|
3753
3764
|
}
|
|
3754
3765
|
);
|
|
3755
3766
|
Radio.displayName = "Radio";
|
|
3756
3767
|
|
|
3757
3768
|
// src/components/Radio/RadioGroup.tsx
|
|
3758
|
-
var
|
|
3759
|
-
var
|
|
3760
|
-
var
|
|
3769
|
+
var import_dedupe39 = __toESM(require("classnames/dedupe"));
|
|
3770
|
+
var import_react63 = require("react");
|
|
3771
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3761
3772
|
var getDefaultVal = (children, defaultValue) => {
|
|
3762
3773
|
if (Array.isArray(children) && defaultValue) {
|
|
3763
3774
|
const option = children?.find((item) => item.props.value === defaultValue);
|
|
@@ -3766,7 +3777,7 @@ var getDefaultVal = (children, defaultValue) => {
|
|
|
3766
3777
|
}
|
|
3767
3778
|
return "";
|
|
3768
3779
|
};
|
|
3769
|
-
var RadioGroup = (0,
|
|
3780
|
+
var RadioGroup = (0, import_react63.forwardRef)((props, ref) => {
|
|
3770
3781
|
const {
|
|
3771
3782
|
label,
|
|
3772
3783
|
isDisabled = false,
|
|
@@ -3785,8 +3796,8 @@ var RadioGroup = (0, import_react65.forwardRef)((props, ref) => {
|
|
|
3785
3796
|
...rest
|
|
3786
3797
|
} = props;
|
|
3787
3798
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
3788
|
-
const [selected, setSelected] = (0,
|
|
3789
|
-
(0,
|
|
3799
|
+
const [selected, setSelected] = (0, import_react63.useState)(defaultSelected);
|
|
3800
|
+
(0, import_react63.useEffect)(() => {
|
|
3790
3801
|
if (value !== void 0) {
|
|
3791
3802
|
setSelected(value);
|
|
3792
3803
|
}
|
|
@@ -3802,26 +3813,26 @@ var RadioGroup = (0, import_react65.forwardRef)((props, ref) => {
|
|
|
3802
3813
|
[`--is-${orientation}`]: true,
|
|
3803
3814
|
[className || ""]: true
|
|
3804
3815
|
};
|
|
3805
|
-
const radioGroupClasses = (0,
|
|
3816
|
+
const radioGroupClasses = (0, import_dedupe39.default)(
|
|
3806
3817
|
"mobius",
|
|
3807
3818
|
"mobius-radio-group",
|
|
3808
3819
|
radioClasses,
|
|
3809
3820
|
validationClasses
|
|
3810
3821
|
);
|
|
3811
|
-
const radioWrapperClasses = (0,
|
|
3822
|
+
const radioWrapperClasses = (0, import_dedupe39.default)("mobius-radio__wrapper", {
|
|
3812
3823
|
[`--is-${orientation}`]: true
|
|
3813
3824
|
});
|
|
3814
|
-
const labelClasses = (0,
|
|
3815
|
-
const errorMessageId = (0,
|
|
3816
|
-
const defaultNameAttrId = (0,
|
|
3825
|
+
const labelClasses = (0, import_dedupe39.default)(radioClasses, validationClasses);
|
|
3826
|
+
const errorMessageId = (0, import_react63.useId)();
|
|
3827
|
+
const defaultNameAttrId = (0, import_react63.useId)();
|
|
3817
3828
|
const nameAttribute = name || defaultNameAttrId;
|
|
3818
3829
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
3819
3830
|
const describedBy = spaceDelimitedList([
|
|
3820
3831
|
shouldErrorMessageShow,
|
|
3821
3832
|
props["aria-describedby"]
|
|
3822
3833
|
]);
|
|
3823
|
-
const labelId = (0,
|
|
3824
|
-
return /* @__PURE__ */ (0,
|
|
3834
|
+
const labelId = (0, import_react63.useId)();
|
|
3835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3825
3836
|
"div",
|
|
3826
3837
|
{
|
|
3827
3838
|
...rest,
|
|
@@ -3837,11 +3848,11 @@ var RadioGroup = (0, import_react65.forwardRef)((props, ref) => {
|
|
|
3837
3848
|
ref,
|
|
3838
3849
|
className: radioGroupClasses,
|
|
3839
3850
|
role: "radiogroup",
|
|
3840
|
-
children: /* @__PURE__ */ (0,
|
|
3841
|
-
label && /* @__PURE__ */ (0,
|
|
3842
|
-
/* @__PURE__ */ (0,
|
|
3843
|
-
if ((0,
|
|
3844
|
-
return (0,
|
|
3851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Stack, { gap: "xs", children: [
|
|
3852
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
3853
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: radioWrapperClasses, children: import_react63.Children.map(children, (child) => {
|
|
3854
|
+
if ((0, import_react63.isValidElement)(child)) {
|
|
3855
|
+
return (0, import_react63.cloneElement)(
|
|
3845
3856
|
child,
|
|
3846
3857
|
{
|
|
3847
3858
|
orientation,
|
|
@@ -3858,7 +3869,7 @@ var RadioGroup = (0, import_react65.forwardRef)((props, ref) => {
|
|
|
3858
3869
|
}
|
|
3859
3870
|
return child;
|
|
3860
3871
|
}) }),
|
|
3861
|
-
/* @__PURE__ */ (0,
|
|
3872
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
3862
3873
|
] })
|
|
3863
3874
|
}
|
|
3864
3875
|
);
|
|
@@ -3866,36 +3877,36 @@ var RadioGroup = (0, import_react65.forwardRef)((props, ref) => {
|
|
|
3866
3877
|
RadioGroup.displayName = "RadioGroup";
|
|
3867
3878
|
|
|
3868
3879
|
// src/components/Segment/SegmentGroup.tsx
|
|
3869
|
-
var
|
|
3870
|
-
var
|
|
3880
|
+
var import_dedupe40 = __toESM(require("classnames/dedupe"));
|
|
3881
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3871
3882
|
var SegmentGroup = (props) => {
|
|
3872
3883
|
const { children, horizontal, gap, className, ...rest } = props;
|
|
3873
3884
|
const gapClass = gap ? `gap-${gap}` : "";
|
|
3874
|
-
const classes = (0,
|
|
3885
|
+
const classes = (0, import_dedupe40.default)(
|
|
3875
3886
|
"mobius",
|
|
3876
3887
|
"mobius-segment-group",
|
|
3877
3888
|
className,
|
|
3878
3889
|
{ "--is-horizontal": horizontal },
|
|
3879
3890
|
gapClass
|
|
3880
3891
|
);
|
|
3881
|
-
return /* @__PURE__ */ (0,
|
|
3892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: classes, ...rest, children });
|
|
3882
3893
|
};
|
|
3883
3894
|
SegmentGroup.displayName = "SegmentGroup";
|
|
3884
3895
|
|
|
3885
3896
|
// src/components/Segment/Segment.tsx
|
|
3886
|
-
var
|
|
3887
|
-
var
|
|
3897
|
+
var import_dedupe41 = __toESM(require("classnames/dedupe"));
|
|
3898
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3888
3899
|
var Segment = (props) => {
|
|
3889
3900
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
3890
|
-
const classes = (0,
|
|
3901
|
+
const classes = (0, import_dedupe41.default)(
|
|
3891
3902
|
"mobius",
|
|
3892
3903
|
"mobius-segment",
|
|
3893
3904
|
colour,
|
|
3894
3905
|
{ inverted },
|
|
3895
3906
|
className
|
|
3896
3907
|
);
|
|
3897
|
-
return /* @__PURE__ */ (0,
|
|
3898
|
-
heading && /* @__PURE__ */ (0,
|
|
3908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: classes, ...rest, children: [
|
|
3909
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mobius-segment__heading", children: heading }),
|
|
3899
3910
|
children
|
|
3900
3911
|
] });
|
|
3901
3912
|
};
|
|
@@ -3903,10 +3914,10 @@ Segment.displayName = "Segment";
|
|
|
3903
3914
|
|
|
3904
3915
|
// src/components/Select/Select.tsx
|
|
3905
3916
|
var import_icons12 = require("@simplybusiness/icons");
|
|
3906
|
-
var
|
|
3907
|
-
var
|
|
3908
|
-
var
|
|
3909
|
-
var Select = (0,
|
|
3917
|
+
var import_dedupe42 = __toESM(require("classnames/dedupe"));
|
|
3918
|
+
var import_react64 = require("react");
|
|
3919
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3920
|
+
var Select = (0, import_react64.forwardRef)((props, ref) => {
|
|
3910
3921
|
const {
|
|
3911
3922
|
label,
|
|
3912
3923
|
onChange,
|
|
@@ -3930,24 +3941,24 @@ var Select = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
3930
3941
|
"--is-required": typeof isRequired === "boolean" && isRequired,
|
|
3931
3942
|
"--is-optional": typeof isRequired === "boolean" && !isRequired
|
|
3932
3943
|
};
|
|
3933
|
-
const sharedClasses = (0,
|
|
3934
|
-
const wrapperClasses = (0,
|
|
3944
|
+
const sharedClasses = (0, import_dedupe42.default)(validationClasses, stateClasses);
|
|
3945
|
+
const wrapperClasses = (0, import_dedupe42.default)(
|
|
3935
3946
|
"mobius-select__wrapper",
|
|
3936
3947
|
sharedClasses,
|
|
3937
3948
|
otherProps.className
|
|
3938
3949
|
);
|
|
3939
|
-
const selectClasses = (0,
|
|
3950
|
+
const selectClasses = (0, import_dedupe42.default)(
|
|
3940
3951
|
"mobius-select",
|
|
3941
3952
|
sharedClasses,
|
|
3942
3953
|
otherProps.className
|
|
3943
3954
|
);
|
|
3944
|
-
const labelClasses = (0,
|
|
3955
|
+
const labelClasses = (0, import_dedupe42.default)(
|
|
3945
3956
|
"mobius-label",
|
|
3946
3957
|
sharedClasses,
|
|
3947
3958
|
otherProps.className
|
|
3948
3959
|
);
|
|
3949
|
-
const iconClasses = (0,
|
|
3950
|
-
const errorMessageId = (0,
|
|
3960
|
+
const iconClasses = (0, import_dedupe42.default)("mobius-select__icon", sharedClasses);
|
|
3961
|
+
const errorMessageId = (0, import_react64.useId)();
|
|
3951
3962
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
3952
3963
|
const describedBy = spaceDelimitedList([
|
|
3953
3964
|
shouldErrorMessageShow,
|
|
@@ -3958,10 +3969,10 @@ var Select = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
3958
3969
|
onChange(e);
|
|
3959
3970
|
}
|
|
3960
3971
|
};
|
|
3961
|
-
return /* @__PURE__ */ (0,
|
|
3962
|
-
label && /* @__PURE__ */ (0,
|
|
3963
|
-
/* @__PURE__ */ (0,
|
|
3964
|
-
/* @__PURE__ */ (0,
|
|
3972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
|
|
3973
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
3974
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: wrapperClasses, children: [
|
|
3975
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3965
3976
|
"select",
|
|
3966
3977
|
{
|
|
3967
3978
|
...otherProps,
|
|
@@ -3977,19 +3988,19 @@ var Select = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
3977
3988
|
onChange: handleChange
|
|
3978
3989
|
}
|
|
3979
3990
|
),
|
|
3980
|
-
/* @__PURE__ */ (0,
|
|
3991
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { icon: import_icons12.chevronDown }) })
|
|
3981
3992
|
] }),
|
|
3982
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
3993
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
3983
3994
|
] });
|
|
3984
3995
|
});
|
|
3985
3996
|
Select.displayName = "Select";
|
|
3986
3997
|
|
|
3987
3998
|
// src/components/Slider/Slider.tsx
|
|
3988
|
-
var
|
|
3989
|
-
var
|
|
3999
|
+
var import_dedupe43 = __toESM(require("classnames/dedupe"));
|
|
4000
|
+
var import_react66 = require("react");
|
|
3990
4001
|
|
|
3991
4002
|
// src/components/Slider/helpers.ts
|
|
3992
|
-
var
|
|
4003
|
+
var import_react65 = require("react");
|
|
3993
4004
|
function numberFormatter(value, formatOptions, locale = navigator.languages?.[0] || "en-GB") {
|
|
3994
4005
|
if (!formatOptions) {
|
|
3995
4006
|
return value?.toString() || "";
|
|
@@ -3998,7 +4009,7 @@ function numberFormatter(value, formatOptions, locale = navigator.languages?.[0]
|
|
|
3998
4009
|
}
|
|
3999
4010
|
|
|
4000
4011
|
// src/components/Slider/Slider.tsx
|
|
4001
|
-
var
|
|
4012
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4002
4013
|
var Slider = (props) => {
|
|
4003
4014
|
const {
|
|
4004
4015
|
id,
|
|
@@ -4019,11 +4030,11 @@ var Slider = (props) => {
|
|
|
4019
4030
|
formatOptions,
|
|
4020
4031
|
isDisabled = false
|
|
4021
4032
|
} = props;
|
|
4022
|
-
const trackRef = (0,
|
|
4023
|
-
const [currentValue, setCurrentValue] = (0,
|
|
4033
|
+
const trackRef = (0, import_react66.useRef)(null);
|
|
4034
|
+
const [currentValue, setCurrentValue] = (0, import_react66.useState)(
|
|
4024
4035
|
value || defaultValue || 0
|
|
4025
4036
|
);
|
|
4026
|
-
const [isDragging, setIsDraggging] = (0,
|
|
4037
|
+
const [isDragging, setIsDraggging] = (0, import_react66.useState)(false);
|
|
4027
4038
|
const { labelProps, fieldProps } = useLabel({
|
|
4028
4039
|
id,
|
|
4029
4040
|
label,
|
|
@@ -4031,7 +4042,7 @@ var Slider = (props) => {
|
|
|
4031
4042
|
"aria-labelledby": ariaLabelledBy
|
|
4032
4043
|
});
|
|
4033
4044
|
const formattedValue = numberFormatter(currentValue, formatOptions);
|
|
4034
|
-
const classes = (0,
|
|
4045
|
+
const classes = (0, import_dedupe43.default)("mobius", "mobius-slider", className, {
|
|
4035
4046
|
"--is-disabled": isDisabled,
|
|
4036
4047
|
"--is-primary": variant === "primary",
|
|
4037
4048
|
"--is-secondary": variant === "secondary",
|
|
@@ -4053,12 +4064,12 @@ var Slider = (props) => {
|
|
|
4053
4064
|
onChangeEnd(currentValue);
|
|
4054
4065
|
}
|
|
4055
4066
|
};
|
|
4056
|
-
return /* @__PURE__ */ (0,
|
|
4057
|
-
/* @__PURE__ */ (0,
|
|
4058
|
-
label && /* @__PURE__ */ (0,
|
|
4059
|
-
label && /* @__PURE__ */ (0,
|
|
4067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: classes, children: [
|
|
4068
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "mobius-slider__label-wrapper", children: [
|
|
4069
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label, { ...labelProps, children: label }),
|
|
4070
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("output", { style: { flex: "1 0 auto", textAlign: "end" }, children: formattedValue })
|
|
4060
4071
|
] }),
|
|
4061
|
-
/* @__PURE__ */ (0,
|
|
4072
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { ref: trackRef, className: "mobius-slider__track-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4062
4073
|
"input",
|
|
4063
4074
|
{
|
|
4064
4075
|
className: "mobius-slider__track",
|
|
@@ -4077,24 +4088,24 @@ var Slider = (props) => {
|
|
|
4077
4088
|
...fieldProps
|
|
4078
4089
|
}
|
|
4079
4090
|
) }),
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4081
|
-
/* @__PURE__ */ (0,
|
|
4082
|
-
/* @__PURE__ */ (0,
|
|
4091
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "mobius-slider__labels", children: [
|
|
4092
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mobius-slider__min-label", "data-testid": "min-label", children: minLabel }),
|
|
4093
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mobius-slider__max-label", "data-testid": "max-label", children: maxLabel })
|
|
4083
4094
|
] })
|
|
4084
4095
|
] });
|
|
4085
4096
|
};
|
|
4086
4097
|
|
|
4087
4098
|
// src/components/SVG/SVG.tsx
|
|
4088
|
-
var
|
|
4089
|
-
var
|
|
4090
|
-
var
|
|
4091
|
-
var SVG = (0,
|
|
4099
|
+
var import_react67 = require("react");
|
|
4100
|
+
var import_dedupe44 = __toESM(require("classnames/dedupe"));
|
|
4101
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4102
|
+
var SVG = (0, import_react67.forwardRef)(
|
|
4092
4103
|
(props, ref) => {
|
|
4093
4104
|
const { children, className, ...otherProps } = props;
|
|
4094
|
-
const classes = (0,
|
|
4095
|
-
const svgNode =
|
|
4105
|
+
const classes = (0, import_dedupe44.default)("mobius", "mobius-svg", className);
|
|
4106
|
+
const svgNode = import_react67.Children.only(children);
|
|
4096
4107
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
4097
|
-
return /* @__PURE__ */ (0,
|
|
4108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4098
4109
|
"svg",
|
|
4099
4110
|
{
|
|
4100
4111
|
viewBox,
|
|
@@ -4110,10 +4121,10 @@ var SVG = (0, import_react69.forwardRef)(
|
|
|
4110
4121
|
SVG.displayName = "SVG";
|
|
4111
4122
|
|
|
4112
4123
|
// src/components/Switch/Switch.tsx
|
|
4113
|
-
var
|
|
4114
|
-
var
|
|
4115
|
-
var
|
|
4116
|
-
var Switch = (0,
|
|
4124
|
+
var import_react68 = require("react");
|
|
4125
|
+
var import_dedupe45 = __toESM(require("classnames/dedupe"));
|
|
4126
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4127
|
+
var Switch = (0, import_react68.forwardRef)((props, ref) => {
|
|
4117
4128
|
const {
|
|
4118
4129
|
checked = false,
|
|
4119
4130
|
className,
|
|
@@ -4121,11 +4132,11 @@ var Switch = (0, import_react70.forwardRef)((props, ref) => {
|
|
|
4121
4132
|
isDisabled = false,
|
|
4122
4133
|
...otherProps
|
|
4123
4134
|
} = props;
|
|
4124
|
-
const [enabled, setEnabled] = (0,
|
|
4125
|
-
(0,
|
|
4135
|
+
const [enabled, setEnabled] = (0, import_react68.useState)(checked);
|
|
4136
|
+
(0, import_react68.useEffect)(() => {
|
|
4126
4137
|
setEnabled(checked);
|
|
4127
4138
|
}, [checked]);
|
|
4128
|
-
const classes = (0,
|
|
4139
|
+
const classes = (0, import_dedupe45.default)(
|
|
4129
4140
|
"mobius",
|
|
4130
4141
|
"mobius-switch",
|
|
4131
4142
|
{
|
|
@@ -4140,9 +4151,9 @@ var Switch = (0, import_react70.forwardRef)((props, ref) => {
|
|
|
4140
4151
|
onChange(event);
|
|
4141
4152
|
}
|
|
4142
4153
|
};
|
|
4143
|
-
return /* @__PURE__ */ (0,
|
|
4144
|
-
/* @__PURE__ */ (0,
|
|
4145
|
-
/* @__PURE__ */ (0,
|
|
4154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("label", { ref, className: classes, children: [
|
|
4155
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: enabled ? "On" : "Off" }) }),
|
|
4156
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4146
4157
|
"input",
|
|
4147
4158
|
{
|
|
4148
4159
|
type: "checkbox",
|
|
@@ -4153,91 +4164,91 @@ var Switch = (0, import_react70.forwardRef)((props, ref) => {
|
|
|
4153
4164
|
...otherProps
|
|
4154
4165
|
}
|
|
4155
4166
|
),
|
|
4156
|
-
/* @__PURE__ */ (0,
|
|
4167
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "mobius-switch__slider" })
|
|
4157
4168
|
] });
|
|
4158
4169
|
});
|
|
4159
4170
|
Switch.displayName = "Switch";
|
|
4160
4171
|
|
|
4161
4172
|
// src/components/Table/Table.tsx
|
|
4162
|
-
var
|
|
4163
|
-
var
|
|
4164
|
-
var
|
|
4165
|
-
var Table = (0,
|
|
4173
|
+
var import_react69 = require("react");
|
|
4174
|
+
var import_dedupe46 = __toESM(require("classnames/dedupe"));
|
|
4175
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4176
|
+
var Table = (0, import_react69.forwardRef)(
|
|
4166
4177
|
(props, ref) => {
|
|
4167
|
-
const classes = (0,
|
|
4168
|
-
return /* @__PURE__ */ (0,
|
|
4178
|
+
const classes = (0, import_dedupe46.default)("mobius", "mobius-table", props.className);
|
|
4179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("table", { ref, ...props, className: classes });
|
|
4169
4180
|
}
|
|
4170
4181
|
);
|
|
4171
4182
|
Table.displayName = "Table";
|
|
4172
4183
|
|
|
4173
4184
|
// src/components/Table/Head.tsx
|
|
4174
|
-
var
|
|
4175
|
-
var
|
|
4176
|
-
var
|
|
4177
|
-
var Head = (0,
|
|
4178
|
-
const classes = (0,
|
|
4179
|
-
return /* @__PURE__ */ (0,
|
|
4185
|
+
var import_react70 = require("react");
|
|
4186
|
+
var import_dedupe47 = __toESM(require("classnames/dedupe"));
|
|
4187
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4188
|
+
var Head = (0, import_react70.forwardRef)((props, ref) => {
|
|
4189
|
+
const classes = (0, import_dedupe47.default)("mobius", "mobius-table__head", props.className);
|
|
4190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("thead", { ref, ...props, className: classes });
|
|
4180
4191
|
});
|
|
4181
4192
|
Head.displayName = "Table.Head";
|
|
4182
4193
|
|
|
4183
4194
|
// src/components/Table/Body.tsx
|
|
4184
|
-
var
|
|
4185
|
-
var
|
|
4186
|
-
var
|
|
4187
|
-
var Body = (0,
|
|
4188
|
-
const classes = (0,
|
|
4189
|
-
return /* @__PURE__ */ (0,
|
|
4195
|
+
var import_react71 = require("react");
|
|
4196
|
+
var import_dedupe48 = __toESM(require("classnames/dedupe"));
|
|
4197
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4198
|
+
var Body = (0, import_react71.forwardRef)((props, ref) => {
|
|
4199
|
+
const classes = (0, import_dedupe48.default)("mobius", "mobius-table__body", props.className);
|
|
4200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tbody", { ref, ...props, className: classes });
|
|
4190
4201
|
});
|
|
4191
4202
|
Body.displayName = "Table.Body";
|
|
4192
4203
|
|
|
4193
4204
|
// src/components/Table/Foot.tsx
|
|
4194
|
-
var
|
|
4195
|
-
var
|
|
4196
|
-
var
|
|
4197
|
-
var Foot = (0,
|
|
4198
|
-
const classes = (0,
|
|
4199
|
-
return /* @__PURE__ */ (0,
|
|
4205
|
+
var import_react72 = require("react");
|
|
4206
|
+
var import_dedupe49 = __toESM(require("classnames/dedupe"));
|
|
4207
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4208
|
+
var Foot = (0, import_react72.forwardRef)((props, ref) => {
|
|
4209
|
+
const classes = (0, import_dedupe49.default)("mobius", "mobius-table__foot", props.className);
|
|
4210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("tfoot", { ref, ...props, className: classes });
|
|
4200
4211
|
});
|
|
4201
4212
|
Foot.displayName = "Table.Foot";
|
|
4202
4213
|
|
|
4203
4214
|
// src/components/Table/Row.tsx
|
|
4204
|
-
var
|
|
4205
|
-
var
|
|
4206
|
-
var
|
|
4207
|
-
var Row = (0,
|
|
4215
|
+
var import_react73 = require("react");
|
|
4216
|
+
var import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
4217
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4218
|
+
var Row = (0, import_react73.forwardRef)(
|
|
4208
4219
|
(props, ref) => {
|
|
4209
|
-
const classes = (0,
|
|
4210
|
-
return /* @__PURE__ */ (0,
|
|
4220
|
+
const classes = (0, import_dedupe50.default)("mobius", "mobius-table__row", props.className);
|
|
4221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tr", { ref, ...props, className: classes });
|
|
4211
4222
|
}
|
|
4212
4223
|
);
|
|
4213
4224
|
Row.displayName = "Table.Row";
|
|
4214
4225
|
|
|
4215
4226
|
// src/components/Table/HeaderCell.tsx
|
|
4216
|
-
var
|
|
4217
|
-
var
|
|
4218
|
-
var
|
|
4219
|
-
var HeaderCell = (0,
|
|
4220
|
-
const classes = (0,
|
|
4227
|
+
var import_react74 = require("react");
|
|
4228
|
+
var import_dedupe51 = __toESM(require("classnames/dedupe"));
|
|
4229
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4230
|
+
var HeaderCell = (0, import_react74.forwardRef)((props, ref) => {
|
|
4231
|
+
const classes = (0, import_dedupe51.default)(
|
|
4221
4232
|
"mobius",
|
|
4222
4233
|
"mobius-table__head-cell",
|
|
4223
4234
|
props.className
|
|
4224
4235
|
);
|
|
4225
|
-
return /* @__PURE__ */ (0,
|
|
4236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("th", { ...props, ref, className: classes });
|
|
4226
4237
|
});
|
|
4227
4238
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
4228
4239
|
|
|
4229
4240
|
// src/components/Table/Cell.tsx
|
|
4230
|
-
var
|
|
4231
|
-
var
|
|
4232
|
-
var
|
|
4233
|
-
var Cell = (0,
|
|
4241
|
+
var import_react75 = require("react");
|
|
4242
|
+
var import_dedupe52 = __toESM(require("classnames/dedupe"));
|
|
4243
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4244
|
+
var Cell = (0, import_react75.forwardRef)(
|
|
4234
4245
|
(props, ref) => {
|
|
4235
|
-
const classes = (0,
|
|
4246
|
+
const classes = (0, import_dedupe52.default)(
|
|
4236
4247
|
"mobius",
|
|
4237
4248
|
"mobius-table__body-cell",
|
|
4238
4249
|
props.className
|
|
4239
4250
|
);
|
|
4240
|
-
return /* @__PURE__ */ (0,
|
|
4251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("td", { ref, ...props, className: classes });
|
|
4241
4252
|
}
|
|
4242
4253
|
);
|
|
4243
4254
|
Cell.displayName = "Table.Cell";
|
|
@@ -4253,15 +4264,42 @@ var Table2 = Object.assign(Table, {
|
|
|
4253
4264
|
});
|
|
4254
4265
|
Table2.displayName = "Table";
|
|
4255
4266
|
|
|
4267
|
+
// src/components/Text/Text.tsx
|
|
4268
|
+
var import_react76 = require("react");
|
|
4269
|
+
var import_dedupe53 = __toESM(require("classnames/dedupe"));
|
|
4270
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4271
|
+
var getElementType = (variant, elementType) => {
|
|
4272
|
+
if (variant) {
|
|
4273
|
+
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
4274
|
+
}
|
|
4275
|
+
return elementType || "p";
|
|
4276
|
+
};
|
|
4277
|
+
var Text = (0, import_react76.forwardRef)(
|
|
4278
|
+
({ elementType: Component = "p", ...props }, ref) => {
|
|
4279
|
+
const { variant, className, spacing, ...otherProps } = props;
|
|
4280
|
+
const elementType = getElementType(variant, Component);
|
|
4281
|
+
const variantType = variant || elementType;
|
|
4282
|
+
const classes = (0, import_dedupe53.default)(
|
|
4283
|
+
"mobius",
|
|
4284
|
+
"mobius-text",
|
|
4285
|
+
{ [`--is-${variantType}`]: variantType },
|
|
4286
|
+
{ [`--has-line-height-${spacing}`]: spacing },
|
|
4287
|
+
className
|
|
4288
|
+
);
|
|
4289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
4290
|
+
}
|
|
4291
|
+
);
|
|
4292
|
+
Text.displayName = "Text";
|
|
4293
|
+
|
|
4256
4294
|
// src/components/TextArea/TextArea.tsx
|
|
4257
4295
|
var import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
4258
|
-
var
|
|
4296
|
+
var import_react78 = require("react");
|
|
4259
4297
|
|
|
4260
4298
|
// src/components/TextAreaInput/TextAreaInput.tsx
|
|
4261
4299
|
var import_dedupe54 = __toESM(require("classnames/dedupe"));
|
|
4262
|
-
var
|
|
4300
|
+
var import_react77 = require("react");
|
|
4263
4301
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4264
|
-
var TextAreaInput = (0,
|
|
4302
|
+
var TextAreaInput = (0, import_react77.forwardRef)((props, ref) => {
|
|
4265
4303
|
const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
|
|
4266
4304
|
const classes = (0, import_dedupe54.default)(
|
|
4267
4305
|
"mobius",
|
|
@@ -4288,7 +4326,7 @@ TextAreaInput.displayName = "TextAreaInput";
|
|
|
4288
4326
|
|
|
4289
4327
|
// src/components/TextArea/TextArea.tsx
|
|
4290
4328
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4291
|
-
var TextArea = (0,
|
|
4329
|
+
var TextArea = (0, import_react78.forwardRef)((props, ref) => {
|
|
4292
4330
|
const {
|
|
4293
4331
|
isDisabled,
|
|
4294
4332
|
className,
|
|
@@ -4332,10 +4370,37 @@ var TextArea = (0, import_react79.forwardRef)((props, ref) => {
|
|
|
4332
4370
|
});
|
|
4333
4371
|
TextArea.displayName = "TextArea";
|
|
4334
4372
|
|
|
4373
|
+
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
4374
|
+
var import_react79 = require("react");
|
|
4375
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4376
|
+
var TextOrHTML = (0, import_react79.forwardRef)(
|
|
4377
|
+
({
|
|
4378
|
+
text,
|
|
4379
|
+
htmlClassName,
|
|
4380
|
+
htmlElementType = "span",
|
|
4381
|
+
textWrapper = false,
|
|
4382
|
+
...textProps
|
|
4383
|
+
}, ref) => {
|
|
4384
|
+
const DangerousComponent = htmlElementType;
|
|
4385
|
+
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4386
|
+
DangerousComponent,
|
|
4387
|
+
{
|
|
4388
|
+
className: htmlClassName,
|
|
4389
|
+
dangerouslySetInnerHTML: { __html: text }
|
|
4390
|
+
}
|
|
4391
|
+
);
|
|
4392
|
+
if (textWrapper) {
|
|
4393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
4394
|
+
}
|
|
4395
|
+
return dangerousElement;
|
|
4396
|
+
}
|
|
4397
|
+
);
|
|
4398
|
+
TextOrHTML.displayName = "TextOrHTML";
|
|
4399
|
+
|
|
4335
4400
|
// src/components/Title/Title.tsx
|
|
4336
4401
|
var import_react80 = require("react");
|
|
4337
4402
|
var import_dedupe56 = __toESM(require("classnames/dedupe"));
|
|
4338
|
-
var
|
|
4403
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4339
4404
|
var Title = (0, import_react80.forwardRef)(
|
|
4340
4405
|
(props, ref) => {
|
|
4341
4406
|
const {
|
|
@@ -4348,9 +4413,9 @@ var Title = (0, import_react80.forwardRef)(
|
|
|
4348
4413
|
const headerClasses = (0, import_dedupe56.default)("mobius", "mobius-title__header");
|
|
4349
4414
|
const contentClasses = (0, import_dedupe56.default)("mobius", "mobius-title__description");
|
|
4350
4415
|
const containerClasses = (0, import_dedupe56.default)("mobius", "mobius-title__container");
|
|
4351
|
-
return /* @__PURE__ */ (0,
|
|
4352
|
-
/* @__PURE__ */ (0,
|
|
4353
|
-
/* @__PURE__ */ (0,
|
|
4416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Element, { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Flex, { flexDirection: "column", className: containerClasses, children: [
|
|
4417
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: headerClasses, children: title }),
|
|
4418
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: contentClasses, children: description })
|
|
4354
4419
|
] }) });
|
|
4355
4420
|
}
|
|
4356
4421
|
);
|
|
@@ -4416,7 +4481,7 @@ var TRUSTPILOT_WIDGET = {
|
|
|
4416
4481
|
};
|
|
4417
4482
|
|
|
4418
4483
|
// src/components/Trust/Trust.tsx
|
|
4419
|
-
var
|
|
4484
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
4420
4485
|
var Trust = (0, import_react81.forwardRef)((props, ref) => {
|
|
4421
4486
|
const {
|
|
4422
4487
|
elementType: Element = "div",
|
|
@@ -4464,15 +4529,15 @@ var Trust = (0, import_react81.forwardRef)((props, ref) => {
|
|
|
4464
4529
|
(0, import_react81.useEffect)(() => {
|
|
4465
4530
|
setIsMounted(true);
|
|
4466
4531
|
}, []);
|
|
4467
|
-
if (!isMounted) return /* @__PURE__ */ (0,
|
|
4468
|
-
return /* @__PURE__ */ (0,
|
|
4532
|
+
if (!isMounted) return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { style: styles });
|
|
4533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
4469
4534
|
Element,
|
|
4470
4535
|
{
|
|
4471
4536
|
ref: mergeRefs([trustRef, ref]),
|
|
4472
4537
|
className: classes,
|
|
4473
4538
|
style: styles,
|
|
4474
4539
|
...dataProps,
|
|
4475
|
-
children: /* @__PURE__ */ (0,
|
|
4540
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
4476
4541
|
"a",
|
|
4477
4542
|
{
|
|
4478
4543
|
href: link,
|
|
@@ -4487,9 +4552,9 @@ var Trust = (0, import_react81.forwardRef)((props, ref) => {
|
|
|
4487
4552
|
});
|
|
4488
4553
|
|
|
4489
4554
|
// src/components/ExpandableText/ExpandableText.tsx
|
|
4490
|
-
var import_react82 = require("react");
|
|
4491
4555
|
var import_dedupe58 = __toESM(require("classnames/dedupe"));
|
|
4492
|
-
var
|
|
4556
|
+
var import_react82 = require("react");
|
|
4557
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
4493
4558
|
var ExpandableText = (0, import_react82.forwardRef)((props, ref) => {
|
|
4494
4559
|
const {
|
|
4495
4560
|
text,
|
|
@@ -4520,7 +4585,7 @@ var ExpandableText = (0, import_react82.forwardRef)((props, ref) => {
|
|
|
4520
4585
|
setIsCollapsed(isOverflowing);
|
|
4521
4586
|
}, [text, shouldCollapse, maxLines]);
|
|
4522
4587
|
if (breakpoint && !shouldCollapse) {
|
|
4523
|
-
return /* @__PURE__ */ (0,
|
|
4588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { ref, className, ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(TextOrHTML, { text, textWrapper: true, ...textProps }) });
|
|
4524
4589
|
}
|
|
4525
4590
|
const handleAccordionChange = (expanded) => {
|
|
4526
4591
|
setIsExpanded(expanded);
|
|
@@ -4533,7 +4598,7 @@ var ExpandableText = (0, import_react82.forwardRef)((props, ref) => {
|
|
|
4533
4598
|
const textContainerStyle = {
|
|
4534
4599
|
"--line-clamp": maxLines
|
|
4535
4600
|
};
|
|
4536
|
-
return /* @__PURE__ */ (0,
|
|
4601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
4537
4602
|
"div",
|
|
4538
4603
|
{
|
|
4539
4604
|
ref,
|
|
@@ -4541,7 +4606,7 @@ var ExpandableText = (0, import_react82.forwardRef)((props, ref) => {
|
|
|
4541
4606
|
"data-testid": "expandable-text",
|
|
4542
4607
|
...otherProps,
|
|
4543
4608
|
children: [
|
|
4544
|
-
/* @__PURE__ */ (0,
|
|
4609
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
4545
4610
|
"div",
|
|
4546
4611
|
{
|
|
4547
4612
|
ref: textRef,
|
|
@@ -4549,10 +4614,10 @@ var ExpandableText = (0, import_react82.forwardRef)((props, ref) => {
|
|
|
4549
4614
|
style: textContainerStyle,
|
|
4550
4615
|
"data-testid": "expandable-text-content",
|
|
4551
4616
|
"aria-describedby": isCollapsed ? expandButtonId : void 0,
|
|
4552
|
-
children: /* @__PURE__ */ (0,
|
|
4617
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(TextOrHTML, { elementType: "span", textWrapper: true, text, ...textProps })
|
|
4553
4618
|
}
|
|
4554
4619
|
),
|
|
4555
|
-
isCollapsed && /* @__PURE__ */ (0,
|
|
4620
|
+
isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
4556
4621
|
Accordion,
|
|
4557
4622
|
{
|
|
4558
4623
|
showText,
|
|
@@ -4575,7 +4640,7 @@ ExpandableText.displayName = "ExpandableText";
|
|
|
4575
4640
|
// src/components/MaskedField/MaskedField.tsx
|
|
4576
4641
|
var import_react83 = require("react");
|
|
4577
4642
|
var import_react_imask = require("react-imask");
|
|
4578
|
-
var
|
|
4643
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4579
4644
|
var useAcceptHandler = (onChange, useMaskedValue, name) => {
|
|
4580
4645
|
return (0, import_react83.useCallback)(
|
|
4581
4646
|
(maskedValue, maskInstance) => {
|
|
@@ -4647,7 +4712,7 @@ var ControlledMaskedField = ({
|
|
|
4647
4712
|
setValue(stringValue);
|
|
4648
4713
|
}
|
|
4649
4714
|
}, [value, maskRef, setValue, imaskRef]);
|
|
4650
|
-
return /* @__PURE__ */ (0,
|
|
4715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4651
4716
|
TextField,
|
|
4652
4717
|
{
|
|
4653
4718
|
...textFieldProps,
|
|
@@ -4671,7 +4736,7 @@ var UncontrolledMaskedField = ({
|
|
|
4671
4736
|
const { ref: imaskRef, maskRef } = (0, import_react_imask.useIMask)(mask, { onAccept });
|
|
4672
4737
|
const combinedRef = useCombinedRef(imaskRef, forwardedRef);
|
|
4673
4738
|
const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
|
|
4674
|
-
return /* @__PURE__ */ (0,
|
|
4739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4675
4740
|
TextField,
|
|
4676
4741
|
{
|
|
4677
4742
|
...textFieldProps,
|
|
@@ -4685,7 +4750,7 @@ var UncontrolledMaskedField = ({
|
|
|
4685
4750
|
var MaskedField = (0, import_react83.forwardRef)((props, forwardedRef) => {
|
|
4686
4751
|
const { value, defaultValue, ...rest } = props;
|
|
4687
4752
|
if ("value" in props) {
|
|
4688
|
-
return /* @__PURE__ */ (0,
|
|
4753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4689
4754
|
ControlledMaskedField,
|
|
4690
4755
|
{
|
|
4691
4756
|
...rest,
|
|
@@ -4694,7 +4759,7 @@ var MaskedField = (0, import_react83.forwardRef)((props, forwardedRef) => {
|
|
|
4694
4759
|
}
|
|
4695
4760
|
);
|
|
4696
4761
|
} else {
|
|
4697
|
-
return /* @__PURE__ */ (0,
|
|
4762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4698
4763
|
UncontrolledMaskedField,
|
|
4699
4764
|
{
|
|
4700
4765
|
...rest,
|