@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/esm/index.js
CHANGED
|
@@ -908,58 +908,29 @@ Accordion.displayName = "Accordion";
|
|
|
908
908
|
|
|
909
909
|
// src/components/AddressLookup/AddressLookup.tsx
|
|
910
910
|
import { search } from "@simplybusiness/icons";
|
|
911
|
-
import { forwardRef as
|
|
911
|
+
import { forwardRef as forwardRef7, useCallback as useCallback4, useState as useState10 } from "react";
|
|
912
912
|
|
|
913
913
|
// src/components/Combobox/Combobox.tsx
|
|
914
|
-
import
|
|
915
|
-
import { forwardRef as
|
|
914
|
+
import classNames12 from "classnames/dedupe";
|
|
915
|
+
import { forwardRef as forwardRef6, useEffect as useEffect14, useId as useId4, useRef as useRef7, useState as useState9 } from "react";
|
|
916
916
|
|
|
917
917
|
// src/components/TextField/TextField.tsx
|
|
918
|
-
import
|
|
919
|
-
import { forwardRef as
|
|
918
|
+
import classNames9 from "classnames/dedupe";
|
|
919
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
920
920
|
|
|
921
921
|
// src/components/ErrorMessage/ErrorMessage.tsx
|
|
922
922
|
import { error } from "@simplybusiness/icons";
|
|
923
|
-
import classNames6 from "classnames/dedupe";
|
|
924
|
-
|
|
925
|
-
// src/components/Text/Text.tsx
|
|
926
|
-
import { forwardRef as forwardRef3 } from "react";
|
|
927
923
|
import classNames5 from "classnames/dedupe";
|
|
928
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
929
|
-
var getElementType = (variant, elementType) => {
|
|
930
|
-
if (variant) {
|
|
931
|
-
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
932
|
-
}
|
|
933
|
-
return elementType || "p";
|
|
934
|
-
};
|
|
935
|
-
var Text = forwardRef3(
|
|
936
|
-
({ elementType: Component = "p", ...props }, ref) => {
|
|
937
|
-
const { variant, className, spacing, ...otherProps } = props;
|
|
938
|
-
const elementType = getElementType(variant, Component);
|
|
939
|
-
const variantType = variant || elementType;
|
|
940
|
-
const classes = classNames5(
|
|
941
|
-
"mobius",
|
|
942
|
-
"mobius-text",
|
|
943
|
-
{ [`--is-${variantType}`]: variantType },
|
|
944
|
-
{ [`--has-line-height-${spacing}`]: spacing },
|
|
945
|
-
className
|
|
946
|
-
);
|
|
947
|
-
return /* @__PURE__ */ jsx5(Component, { ref, ...otherProps, className: classes });
|
|
948
|
-
}
|
|
949
|
-
);
|
|
950
|
-
Text.displayName = "Text";
|
|
951
|
-
|
|
952
|
-
// src/components/ErrorMessage/ErrorMessage.tsx
|
|
953
|
-
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
924
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
954
925
|
var ErrorMessage = ({
|
|
955
926
|
id,
|
|
956
927
|
errorMessage,
|
|
957
928
|
className
|
|
958
929
|
}) => {
|
|
959
|
-
const classes =
|
|
930
|
+
const classes = classNames5("mobius", "mobius-error-message", className);
|
|
960
931
|
if (!errorMessage) return null;
|
|
961
932
|
return /* @__PURE__ */ jsxs4("div", { id, className: classes, "data-testid": "ErrorMessage", role: "alert", children: [
|
|
962
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ jsx5(
|
|
963
934
|
Icon,
|
|
964
935
|
{
|
|
965
936
|
icon: error,
|
|
@@ -967,32 +938,39 @@ var ErrorMessage = ({
|
|
|
967
938
|
"aria-hidden": "true"
|
|
968
939
|
}
|
|
969
940
|
),
|
|
970
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ jsx5(
|
|
942
|
+
TextOrHTML,
|
|
943
|
+
{
|
|
944
|
+
elementType: "span",
|
|
945
|
+
className: "mobius-error-message__text",
|
|
946
|
+
text: errorMessage
|
|
947
|
+
}
|
|
948
|
+
)
|
|
971
949
|
] });
|
|
972
950
|
};
|
|
973
951
|
ErrorMessage.displayName = "ErrorMessage";
|
|
974
952
|
|
|
975
953
|
// src/components/Label/Label.tsx
|
|
976
|
-
import { forwardRef as
|
|
977
|
-
import
|
|
978
|
-
import { jsx as
|
|
979
|
-
var Label =
|
|
954
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
955
|
+
import classNames6 from "classnames/dedupe";
|
|
956
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
957
|
+
var Label = forwardRef3(
|
|
980
958
|
(props, ref) => {
|
|
981
959
|
const { elementType: Element = "label", children, ...otherProps } = props;
|
|
982
|
-
const classes =
|
|
960
|
+
const classes = classNames6("mobius", "mobius-label", props.className);
|
|
983
961
|
otherProps.className = classes;
|
|
984
|
-
return /* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ jsx6(Element, { ref, ...otherProps, className: classes, children });
|
|
985
963
|
}
|
|
986
964
|
);
|
|
987
965
|
Label.displayName = "Label";
|
|
988
966
|
|
|
989
967
|
// src/components/Stack/Stack.tsx
|
|
990
|
-
import { forwardRef as
|
|
991
|
-
import
|
|
992
|
-
import { jsx as
|
|
993
|
-
var Stack =
|
|
968
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
969
|
+
import classNames7 from "classnames/dedupe";
|
|
970
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
971
|
+
var Stack = forwardRef4((props, ref) => {
|
|
994
972
|
const { elementType: Element = "div", gap, ...otherProps } = props;
|
|
995
|
-
const classes =
|
|
973
|
+
const classes = classNames7(
|
|
996
974
|
"mobius",
|
|
997
975
|
"mobius-stack",
|
|
998
976
|
{
|
|
@@ -1000,17 +978,17 @@ var Stack = forwardRef5((props, ref) => {
|
|
|
1000
978
|
},
|
|
1001
979
|
otherProps.className
|
|
1002
980
|
);
|
|
1003
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ jsx7(Element, { ref, ...otherProps, className: classes });
|
|
1004
982
|
});
|
|
1005
983
|
Stack.displayName = "Stack";
|
|
1006
984
|
|
|
1007
985
|
// src/components/TextField/adornmentWithClassName.ts
|
|
1008
|
-
import
|
|
986
|
+
import classNames8 from "classnames";
|
|
1009
987
|
import { cloneElement } from "react";
|
|
1010
988
|
var adornmentWithClassName = (component, validationClasses, className) => {
|
|
1011
989
|
if (!component) return null;
|
|
1012
990
|
return cloneElement(component, {
|
|
1013
|
-
className:
|
|
991
|
+
className: classNames8(
|
|
1014
992
|
component.props.className,
|
|
1015
993
|
validationClasses,
|
|
1016
994
|
className
|
|
@@ -1019,8 +997,8 @@ var adornmentWithClassName = (component, validationClasses, className) => {
|
|
|
1019
997
|
};
|
|
1020
998
|
|
|
1021
999
|
// src/components/TextField/TextField.tsx
|
|
1022
|
-
import { jsx as
|
|
1023
|
-
var TextField =
|
|
1000
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1001
|
+
var TextField = forwardRef5((props, ref) => {
|
|
1024
1002
|
const {
|
|
1025
1003
|
isDisabled,
|
|
1026
1004
|
type = "text",
|
|
@@ -1054,29 +1032,29 @@ var TextField = forwardRef6((props, ref) => {
|
|
|
1054
1032
|
"--is-hidden": hidden,
|
|
1055
1033
|
[className || ""]: true
|
|
1056
1034
|
};
|
|
1057
|
-
const sharedClasses =
|
|
1058
|
-
const labelClasses =
|
|
1035
|
+
const sharedClasses = classNames9(validationClasses, textfieldClasses);
|
|
1036
|
+
const labelClasses = classNames9(
|
|
1059
1037
|
{
|
|
1060
1038
|
"--is-disabled": isDisabled
|
|
1061
1039
|
},
|
|
1062
1040
|
validationClasses
|
|
1063
1041
|
);
|
|
1064
|
-
const containerClasses =
|
|
1042
|
+
const containerClasses = classNames9(
|
|
1065
1043
|
"mobius",
|
|
1066
1044
|
"mobius-text-field",
|
|
1067
1045
|
sharedClasses
|
|
1068
1046
|
);
|
|
1069
|
-
const inputClasses =
|
|
1047
|
+
const inputClasses = classNames9(
|
|
1070
1048
|
"mobius",
|
|
1071
1049
|
"mobius-text-field__input",
|
|
1072
1050
|
sharedClasses
|
|
1073
1051
|
);
|
|
1074
|
-
const inputWrapperClasses =
|
|
1052
|
+
const inputWrapperClasses = classNames9(
|
|
1075
1053
|
"mobius-text-field__input-wrapper",
|
|
1076
1054
|
sharedClasses
|
|
1077
1055
|
);
|
|
1078
1056
|
return /* @__PURE__ */ jsxs5(Stack, { gap: "xs", className: containerClasses, children: [
|
|
1079
|
-
label && !hidden && /* @__PURE__ */
|
|
1057
|
+
label && !hidden && /* @__PURE__ */ jsx8(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
1080
1058
|
/* @__PURE__ */ jsxs5("div", { className: "mobius-text-field__inner-container", children: [
|
|
1081
1059
|
adornmentWithClassName(
|
|
1082
1060
|
prefixOutside,
|
|
@@ -1089,7 +1067,7 @@ var TextField = forwardRef6((props, ref) => {
|
|
|
1089
1067
|
labelClasses,
|
|
1090
1068
|
"mobius-text-field__prefix-inside"
|
|
1091
1069
|
),
|
|
1092
|
-
/* @__PURE__ */
|
|
1070
|
+
/* @__PURE__ */ jsx8(
|
|
1093
1071
|
"input",
|
|
1094
1072
|
{
|
|
1095
1073
|
...otherProps,
|
|
@@ -1111,14 +1089,14 @@ var TextField = forwardRef6((props, ref) => {
|
|
|
1111
1089
|
"mobius-text-field__suffix-outside"
|
|
1112
1090
|
)
|
|
1113
1091
|
] }),
|
|
1114
|
-
children && /* @__PURE__ */
|
|
1115
|
-
/* @__PURE__ */
|
|
1092
|
+
children && /* @__PURE__ */ jsx8("div", { className: "mobius-text-field__children", children }),
|
|
1093
|
+
/* @__PURE__ */ jsx8(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
1116
1094
|
] });
|
|
1117
1095
|
});
|
|
1118
1096
|
TextField.displayName = "TextField";
|
|
1119
1097
|
|
|
1120
1098
|
// src/components/VisuallyHidden/VisuallyHidden.tsx
|
|
1121
|
-
import { jsx as
|
|
1099
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1122
1100
|
function VisuallyHidden(props) {
|
|
1123
1101
|
const {
|
|
1124
1102
|
className,
|
|
@@ -1126,7 +1104,7 @@ function VisuallyHidden(props) {
|
|
|
1126
1104
|
elementType: Component = "div",
|
|
1127
1105
|
...otherProps
|
|
1128
1106
|
} = props;
|
|
1129
|
-
return /* @__PURE__ */
|
|
1107
|
+
return /* @__PURE__ */ jsx9(
|
|
1130
1108
|
Component,
|
|
1131
1109
|
{
|
|
1132
1110
|
className,
|
|
@@ -1149,11 +1127,11 @@ function VisuallyHidden(props) {
|
|
|
1149
1127
|
}
|
|
1150
1128
|
|
|
1151
1129
|
// src/components/Combobox/Listbox.tsx
|
|
1152
|
-
import
|
|
1130
|
+
import classNames11 from "classnames";
|
|
1153
1131
|
|
|
1154
1132
|
// src/components/Combobox/Option.tsx
|
|
1155
1133
|
import { useEffect as useEffect12, useRef as useRef6 } from "react";
|
|
1156
|
-
import
|
|
1134
|
+
import classNames10 from "classnames/dedupe";
|
|
1157
1135
|
|
|
1158
1136
|
// src/components/Combobox/utils.tsx
|
|
1159
1137
|
function isOptionGroup(options) {
|
|
@@ -1177,7 +1155,7 @@ function filterOptions(options, inputValue) {
|
|
|
1177
1155
|
}
|
|
1178
1156
|
|
|
1179
1157
|
// src/components/Combobox/Option.tsx
|
|
1180
|
-
import { jsx as
|
|
1158
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1181
1159
|
var Option = ({
|
|
1182
1160
|
option,
|
|
1183
1161
|
isHighlighted,
|
|
@@ -1191,7 +1169,7 @@ var Option = ({
|
|
|
1191
1169
|
optionRef.current.scrollIntoView({ block: "nearest" });
|
|
1192
1170
|
}
|
|
1193
1171
|
}, [isHighlighted]);
|
|
1194
|
-
return /* @__PURE__ */
|
|
1172
|
+
return /* @__PURE__ */ jsx10(
|
|
1195
1173
|
"li",
|
|
1196
1174
|
{
|
|
1197
1175
|
ref: optionRef,
|
|
@@ -1199,17 +1177,17 @@ var Option = ({
|
|
|
1199
1177
|
id,
|
|
1200
1178
|
"aria-selected": isHighlighted,
|
|
1201
1179
|
onMouseDown: () => onOptionSelect(option),
|
|
1202
|
-
className:
|
|
1180
|
+
className: classNames10("mobius-combobox__option", "has-pii", {
|
|
1203
1181
|
"mobius-combobox__option--is-highlighted": isHighlighted
|
|
1204
1182
|
}),
|
|
1205
|
-
children: OptionComponent ? /* @__PURE__ */
|
|
1183
|
+
children: OptionComponent ? /* @__PURE__ */ jsx10(OptionComponent, { option, isHighlighted }) : getOptionLabel(option)
|
|
1206
1184
|
},
|
|
1207
1185
|
getOptionValue(option)
|
|
1208
1186
|
);
|
|
1209
1187
|
};
|
|
1210
1188
|
|
|
1211
1189
|
// src/components/Combobox/Listbox.tsx
|
|
1212
|
-
import { jsx as
|
|
1190
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1213
1191
|
var Listbox = ({
|
|
1214
1192
|
id,
|
|
1215
1193
|
isOpen = false,
|
|
@@ -1219,7 +1197,7 @@ var Listbox = ({
|
|
|
1219
1197
|
onOptionSelect,
|
|
1220
1198
|
optionComponent
|
|
1221
1199
|
}) => {
|
|
1222
|
-
const classes =
|
|
1200
|
+
const classes = classNames11("mobius-combobox__list", {
|
|
1223
1201
|
"mobius-combobox__list--hidden": !isOpen
|
|
1224
1202
|
});
|
|
1225
1203
|
function getOptionId(option, groupIndex, index) {
|
|
@@ -1229,19 +1207,19 @@ var Listbox = ({
|
|
|
1229
1207
|
return isOptionGroup(options) ? `${id}-option-${groupIndex}-${index}` : `${id}-option-${index}`;
|
|
1230
1208
|
}
|
|
1231
1209
|
if (!isOpen) {
|
|
1232
|
-
return /* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ jsx11("div", { role: "listbox", id, className: classes });
|
|
1233
1211
|
}
|
|
1234
1212
|
if (options && options.length === 0) {
|
|
1235
|
-
return /* @__PURE__ */
|
|
1213
|
+
return /* @__PURE__ */ jsx11("div", { role: "listbox", id, className: classes, children: /* @__PURE__ */ jsx11("div", { className: "mobius-combobox__no-options", children: "No options" }) });
|
|
1236
1214
|
}
|
|
1237
|
-
return /* @__PURE__ */
|
|
1215
|
+
return /* @__PURE__ */ jsx11("div", { role: "listbox", id, className: classes, children: isOptionGroup(options) ? options.map((option, groupIndex) => /* @__PURE__ */ jsxs6(
|
|
1238
1216
|
"ul",
|
|
1239
1217
|
{
|
|
1240
1218
|
role: "group",
|
|
1241
1219
|
"aria-labelledby": `${id}-group-${groupIndex}`,
|
|
1242
1220
|
className: "mobius-combobox__group",
|
|
1243
1221
|
children: [
|
|
1244
|
-
/* @__PURE__ */
|
|
1222
|
+
/* @__PURE__ */ jsx11(
|
|
1245
1223
|
"li",
|
|
1246
1224
|
{
|
|
1247
1225
|
role: "presentation",
|
|
@@ -1250,7 +1228,7 @@ var Listbox = ({
|
|
|
1250
1228
|
children: option.heading
|
|
1251
1229
|
}
|
|
1252
1230
|
),
|
|
1253
|
-
option.options.map((groupOption, index) => /* @__PURE__ */
|
|
1231
|
+
option.options.map((groupOption, index) => /* @__PURE__ */ jsx11(
|
|
1254
1232
|
Option,
|
|
1255
1233
|
{
|
|
1256
1234
|
option: groupOption,
|
|
@@ -1264,7 +1242,7 @@ var Listbox = ({
|
|
|
1264
1242
|
]
|
|
1265
1243
|
},
|
|
1266
1244
|
option.heading
|
|
1267
|
-
)) : typeof options !== "undefined" ? options.map((option, index) => /* @__PURE__ */
|
|
1245
|
+
)) : typeof options !== "undefined" ? options.map((option, index) => /* @__PURE__ */ jsx11(
|
|
1268
1246
|
Option,
|
|
1269
1247
|
{
|
|
1270
1248
|
option,
|
|
@@ -1437,8 +1415,8 @@ function useComboboxOptions({
|
|
|
1437
1415
|
}
|
|
1438
1416
|
|
|
1439
1417
|
// src/components/Combobox/Combobox.tsx
|
|
1440
|
-
import { jsx as
|
|
1441
|
-
var ComboboxInner =
|
|
1418
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1419
|
+
var ComboboxInner = forwardRef6(
|
|
1442
1420
|
(props, ref) => {
|
|
1443
1421
|
const {
|
|
1444
1422
|
id,
|
|
@@ -1609,7 +1587,7 @@ var ComboboxInner = forwardRef7(
|
|
|
1609
1587
|
setIsOpen(!!filteredOptions && filteredOptions.length > 0);
|
|
1610
1588
|
}
|
|
1611
1589
|
}, [filteredOptions, asyncOptions, isChanging]);
|
|
1612
|
-
const classes =
|
|
1590
|
+
const classes = classNames12(
|
|
1613
1591
|
"mobius mobius-combobox",
|
|
1614
1592
|
{
|
|
1615
1593
|
"mobius-combobox--is-expanded": isOpen,
|
|
@@ -1619,7 +1597,7 @@ var ComboboxInner = forwardRef7(
|
|
|
1619
1597
|
className
|
|
1620
1598
|
);
|
|
1621
1599
|
return /* @__PURE__ */ jsxs7("div", { id, "data-testid": "mobius-combobox__wrapper", className: classes, children: [
|
|
1622
|
-
isLoading && /* @__PURE__ */
|
|
1600
|
+
isLoading && /* @__PURE__ */ jsx12(
|
|
1623
1601
|
VisuallyHidden,
|
|
1624
1602
|
{
|
|
1625
1603
|
role: "status",
|
|
@@ -1630,7 +1608,7 @@ var ComboboxInner = forwardRef7(
|
|
|
1630
1608
|
children: "Loading options"
|
|
1631
1609
|
}
|
|
1632
1610
|
),
|
|
1633
|
-
/* @__PURE__ */
|
|
1611
|
+
/* @__PURE__ */ jsx12(
|
|
1634
1612
|
TextField,
|
|
1635
1613
|
{
|
|
1636
1614
|
...otherProps,
|
|
@@ -1654,7 +1632,7 @@ var ComboboxInner = forwardRef7(
|
|
|
1654
1632
|
errorMessage: errorMessage || error3?.message || void 0
|
|
1655
1633
|
}
|
|
1656
1634
|
),
|
|
1657
|
-
/* @__PURE__ */
|
|
1635
|
+
/* @__PURE__ */ jsx12(
|
|
1658
1636
|
Listbox,
|
|
1659
1637
|
{
|
|
1660
1638
|
id: listboxId,
|
|
@@ -1678,7 +1656,7 @@ function isLoqateErrorResponse(response) {
|
|
|
1678
1656
|
}
|
|
1679
1657
|
|
|
1680
1658
|
// src/components/AddressLookup/AddressLookup.tsx
|
|
1681
|
-
import { jsx as
|
|
1659
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1682
1660
|
function optionsFromResponse({ Items }, addressLookupService) {
|
|
1683
1661
|
if (!Items || !Array.isArray(Items)) {
|
|
1684
1662
|
throw Error("No address found");
|
|
@@ -1698,7 +1676,7 @@ function optionsFromResponse({ Items }, addressLookupService) {
|
|
|
1698
1676
|
}
|
|
1699
1677
|
}));
|
|
1700
1678
|
}
|
|
1701
|
-
var AddressLookup =
|
|
1679
|
+
var AddressLookup = forwardRef7(
|
|
1702
1680
|
({
|
|
1703
1681
|
addressLookupService,
|
|
1704
1682
|
onAddressSelected,
|
|
@@ -1735,7 +1713,7 @@ var AddressLookup = forwardRef8(
|
|
|
1735
1713
|
return addressLookupService.get(selected.id).then(onAddressSelected).catch(setError);
|
|
1736
1714
|
};
|
|
1737
1715
|
const realErrorMessage = error3 && "An error occurred" || errorMessage;
|
|
1738
|
-
return /* @__PURE__ */
|
|
1716
|
+
return /* @__PURE__ */ jsx13(
|
|
1739
1717
|
Combobox,
|
|
1740
1718
|
{
|
|
1741
1719
|
...otherProps,
|
|
@@ -1743,7 +1721,7 @@ var AddressLookup = forwardRef8(
|
|
|
1743
1721
|
onSelected: handleSelected,
|
|
1744
1722
|
asyncOptions,
|
|
1745
1723
|
errorMessage: realErrorMessage,
|
|
1746
|
-
icon: /* @__PURE__ */
|
|
1724
|
+
icon: /* @__PURE__ */ jsx13(Icon, { icon: search })
|
|
1747
1725
|
}
|
|
1748
1726
|
);
|
|
1749
1727
|
}
|
|
@@ -1835,13 +1813,13 @@ var LoqateAddressLookupService = class {
|
|
|
1835
1813
|
|
|
1836
1814
|
// src/components/Alert/Alert.tsx
|
|
1837
1815
|
import { circleInfo, circleTick, error as error2, warning } from "@simplybusiness/icons";
|
|
1838
|
-
import
|
|
1839
|
-
import { forwardRef as
|
|
1840
|
-
import { jsx as
|
|
1816
|
+
import classNames13 from "classnames/dedupe";
|
|
1817
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
1818
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1841
1819
|
function isAlertVariant(value) {
|
|
1842
1820
|
return value === "info" || value === "success" || value === "warning" || value === "error";
|
|
1843
1821
|
}
|
|
1844
|
-
var Alert =
|
|
1822
|
+
var Alert = forwardRef8(
|
|
1845
1823
|
(props, ref) => {
|
|
1846
1824
|
const {
|
|
1847
1825
|
elementType: Element = "div",
|
|
@@ -1854,7 +1832,7 @@ var Alert = forwardRef9(
|
|
|
1854
1832
|
if (!show) return null;
|
|
1855
1833
|
const variant = variantProp && isAlertVariant(variantProp) ? variantProp : "info";
|
|
1856
1834
|
const colorValue = variant === "success" ? `var(--color-valid)` : `var(--color-${variant})`;
|
|
1857
|
-
const classes =
|
|
1835
|
+
const classes = classNames13(
|
|
1858
1836
|
"mobius",
|
|
1859
1837
|
"mobius-alert",
|
|
1860
1838
|
{
|
|
@@ -1872,14 +1850,14 @@ var Alert = forwardRef9(
|
|
|
1872
1850
|
warning,
|
|
1873
1851
|
error: error2
|
|
1874
1852
|
};
|
|
1875
|
-
const headerClasses =
|
|
1876
|
-
const iconClasses =
|
|
1877
|
-
const contentClasses =
|
|
1853
|
+
const headerClasses = classNames13("mobius", "mobius-alert__header");
|
|
1854
|
+
const iconClasses = classNames13("mobius", "mobius-alert__icon");
|
|
1855
|
+
const contentClasses = classNames13("mobius", "mobius-alert__content");
|
|
1878
1856
|
return /* @__PURE__ */ jsxs8(Element, { ref, role: "alert", ...otherProps, className: classes, children: [
|
|
1879
|
-
/* @__PURE__ */
|
|
1857
|
+
/* @__PURE__ */ jsx14("span", { className: iconClasses, children: /* @__PURE__ */ jsx14(Icon, { icon: icon[variant], color: colorValue }) }),
|
|
1880
1858
|
/* @__PURE__ */ jsxs8("div", { children: [
|
|
1881
|
-
header && /* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
1859
|
+
header && /* @__PURE__ */ jsx14("p", { className: headerClasses, children: header }),
|
|
1860
|
+
/* @__PURE__ */ jsx14("div", { className: contentClasses, children })
|
|
1883
1861
|
] })
|
|
1884
1862
|
] });
|
|
1885
1863
|
}
|
|
@@ -1887,10 +1865,10 @@ var Alert = forwardRef9(
|
|
|
1887
1865
|
Alert.displayName = "Alert";
|
|
1888
1866
|
|
|
1889
1867
|
// src/components/Box/Box.tsx
|
|
1890
|
-
import { forwardRef as
|
|
1891
|
-
import
|
|
1892
|
-
import { jsx as
|
|
1893
|
-
var Box =
|
|
1868
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
1869
|
+
import classNames14 from "classnames/dedupe";
|
|
1870
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1871
|
+
var Box = forwardRef9(
|
|
1894
1872
|
(props, ref) => {
|
|
1895
1873
|
const {
|
|
1896
1874
|
elementType: Element = "div",
|
|
@@ -1916,7 +1894,7 @@ var Box = forwardRef10(
|
|
|
1916
1894
|
style,
|
|
1917
1895
|
...otherProps
|
|
1918
1896
|
} = props;
|
|
1919
|
-
const classes =
|
|
1897
|
+
const classes = classNames14("mobius", "mobius-box", otherProps.className);
|
|
1920
1898
|
const styleProps = filterUndefinedProps({
|
|
1921
1899
|
padding: getSpacingValue(padding),
|
|
1922
1900
|
paddingInline: getSpacingValue(paddingInline || paddingX),
|
|
@@ -1933,7 +1911,7 @@ var Box = forwardRef10(
|
|
|
1933
1911
|
height,
|
|
1934
1912
|
...style
|
|
1935
1913
|
});
|
|
1936
|
-
return /* @__PURE__ */
|
|
1914
|
+
return /* @__PURE__ */ jsx15(
|
|
1937
1915
|
Element,
|
|
1938
1916
|
{
|
|
1939
1917
|
ref,
|
|
@@ -1947,20 +1925,20 @@ var Box = forwardRef10(
|
|
|
1947
1925
|
Box.displayName = "Box";
|
|
1948
1926
|
|
|
1949
1927
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
1950
|
-
import { forwardRef as
|
|
1951
|
-
import
|
|
1952
|
-
import { jsx as
|
|
1953
|
-
var Breadcrumbs =
|
|
1928
|
+
import { forwardRef as forwardRef10, Children, cloneElement as cloneElement2 } from "react";
|
|
1929
|
+
import classNames15 from "classnames/dedupe";
|
|
1930
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1931
|
+
var Breadcrumbs = forwardRef10((props, ref) => {
|
|
1954
1932
|
const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
|
|
1955
1933
|
const { navProps } = { navProps: { "aria-label": ariaLabel } };
|
|
1956
1934
|
const { children, ...otherProps } = props;
|
|
1957
1935
|
const childArray = Children.toArray(children);
|
|
1958
|
-
const classes =
|
|
1936
|
+
const classes = classNames15(
|
|
1959
1937
|
"mobius",
|
|
1960
1938
|
"mobius-breadcrumb",
|
|
1961
1939
|
otherProps.className
|
|
1962
1940
|
);
|
|
1963
|
-
return /* @__PURE__ */
|
|
1941
|
+
return /* @__PURE__ */ jsx16("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ jsx16("ul", { children: childArray.map(
|
|
1964
1942
|
(child, i) => cloneElement2(
|
|
1965
1943
|
child,
|
|
1966
1944
|
{
|
|
@@ -1973,16 +1951,16 @@ var Breadcrumbs = forwardRef11((props, ref) => {
|
|
|
1973
1951
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1974
1952
|
|
|
1975
1953
|
// src/components/Breadcrumbs/BreadcrumbItem.tsx
|
|
1976
|
-
import { forwardRef as
|
|
1977
|
-
import
|
|
1978
|
-
import { jsx as
|
|
1979
|
-
var BreadcrumbItem =
|
|
1954
|
+
import { forwardRef as forwardRef11, cloneElement as cloneElement3, Children as Children2 } from "react";
|
|
1955
|
+
import classNames16 from "classnames/dedupe";
|
|
1956
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1957
|
+
var BreadcrumbItem = forwardRef11((props, ref) => {
|
|
1980
1958
|
const {
|
|
1981
1959
|
isDisabled = false,
|
|
1982
1960
|
isCurrent = false,
|
|
1983
1961
|
"aria-current": ariaCurrent = "page",
|
|
1984
1962
|
children,
|
|
1985
|
-
separator = /* @__PURE__ */
|
|
1963
|
+
separator = /* @__PURE__ */ jsx17(Box, { className: "mobius-breadcrumb__separator", "aria-hidden": "true", children: ">" }),
|
|
1986
1964
|
...otherProps
|
|
1987
1965
|
} = props;
|
|
1988
1966
|
const { itemProps } = {
|
|
@@ -1992,12 +1970,12 @@ var BreadcrumbItem = forwardRef12((props, ref) => {
|
|
|
1992
1970
|
...otherProps
|
|
1993
1971
|
}
|
|
1994
1972
|
};
|
|
1995
|
-
const classes =
|
|
1973
|
+
const classes = classNames16(
|
|
1996
1974
|
"mobius",
|
|
1997
1975
|
"mobius-breadcrumb__item",
|
|
1998
1976
|
props.className
|
|
1999
1977
|
);
|
|
2000
|
-
const child = typeof children === "string" ? /* @__PURE__ */
|
|
1978
|
+
const child = typeof children === "string" ? /* @__PURE__ */ jsx17("span", { ...itemProps, children }) : Children2.only(children);
|
|
2001
1979
|
return /* @__PURE__ */ jsxs9("li", { className: classes, children: [
|
|
2002
1980
|
cloneElement3(child, {
|
|
2003
1981
|
...child.props,
|
|
@@ -2010,32 +1988,32 @@ var BreadcrumbItem = forwardRef12((props, ref) => {
|
|
|
2010
1988
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
2011
1989
|
|
|
2012
1990
|
// src/components/Button/Button.tsx
|
|
2013
|
-
import { forwardRef as
|
|
2014
|
-
import
|
|
1991
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
1992
|
+
import classNames17 from "classnames/dedupe";
|
|
2015
1993
|
|
|
2016
1994
|
// src/components/Button/Loading.tsx
|
|
2017
1995
|
import { loading } from "@simplybusiness/icons";
|
|
2018
|
-
import { Fragment, jsx as
|
|
1996
|
+
import { Fragment, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2019
1997
|
var Loading = (props) => {
|
|
2020
1998
|
const { children } = props;
|
|
2021
1999
|
return /* @__PURE__ */ jsxs10(Fragment, { children: [
|
|
2022
|
-
/* @__PURE__ */
|
|
2023
|
-
/* @__PURE__ */
|
|
2000
|
+
/* @__PURE__ */ jsx18("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ jsx18(Icon, { icon: loading, spin: true, size: "md" }) }),
|
|
2001
|
+
/* @__PURE__ */ jsx18(VisuallyHidden, { className: "mobius-button__loading-text", children: "Loading" }),
|
|
2024
2002
|
children
|
|
2025
2003
|
] });
|
|
2026
2004
|
};
|
|
2027
2005
|
|
|
2028
2006
|
// src/components/Button/Success.tsx
|
|
2029
2007
|
import { tick } from "@simplybusiness/icons";
|
|
2030
|
-
import { Fragment as Fragment2, jsx as
|
|
2008
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2031
2009
|
var Success = () => /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2010
|
+
/* @__PURE__ */ jsx19("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ jsx19(Icon, { icon: tick, size: "md" }) }),
|
|
2011
|
+
/* @__PURE__ */ jsx19(VisuallyHidden, { className: "mobius-button__success-text", children: "Success" })
|
|
2034
2012
|
] });
|
|
2035
2013
|
|
|
2036
2014
|
// src/components/Button/Button.tsx
|
|
2037
|
-
import { jsx as
|
|
2038
|
-
var Button =
|
|
2015
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2016
|
+
var Button = forwardRef12((props, ref) => {
|
|
2039
2017
|
const {
|
|
2040
2018
|
children,
|
|
2041
2019
|
elementType: Component = "button",
|
|
@@ -2063,7 +2041,7 @@ var Button = forwardRef13((props, ref) => {
|
|
|
2063
2041
|
return variant;
|
|
2064
2042
|
};
|
|
2065
2043
|
const buttonVariant = getVariant(variant);
|
|
2066
|
-
const classes =
|
|
2044
|
+
const classes = classNames17(
|
|
2067
2045
|
"mobius",
|
|
2068
2046
|
"mobius-button",
|
|
2069
2047
|
`--variant-${buttonVariant}`,
|
|
@@ -2079,19 +2057,19 @@ var Button = forwardRef13((props, ref) => {
|
|
|
2079
2057
|
return (
|
|
2080
2058
|
// @ts-expect-error - ref type is not correct
|
|
2081
2059
|
/* @__PURE__ */ jsxs12(Component, { ref, ...buttonProps, ...otherProps, children: [
|
|
2082
|
-
isLoading ? /* @__PURE__ */
|
|
2083
|
-
isSuccess && !isLoading && /* @__PURE__ */
|
|
2060
|
+
isLoading ? /* @__PURE__ */ jsx20(Loading, { children }) : children,
|
|
2061
|
+
isSuccess && !isLoading && /* @__PURE__ */ jsx20(Success, {})
|
|
2084
2062
|
] })
|
|
2085
2063
|
);
|
|
2086
2064
|
});
|
|
2087
2065
|
Button.displayName = "Button";
|
|
2088
2066
|
|
|
2089
2067
|
// src/components/Checkbox/Checkbox.tsx
|
|
2090
|
-
import { forwardRef as
|
|
2091
|
-
import
|
|
2068
|
+
import { forwardRef as forwardRef13, useRef as useRef8, useId as useId5, useState as useState11, useEffect as useEffect15 } from "react";
|
|
2069
|
+
import classNames18 from "classnames/dedupe";
|
|
2092
2070
|
import { squareTick, square } from "@simplybusiness/icons";
|
|
2093
|
-
import { jsx as
|
|
2094
|
-
var Checkbox =
|
|
2071
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2072
|
+
var Checkbox = forwardRef13((props, ref) => {
|
|
2095
2073
|
const {
|
|
2096
2074
|
id,
|
|
2097
2075
|
label,
|
|
@@ -2125,7 +2103,7 @@ var Checkbox = forwardRef14((props, ref) => {
|
|
|
2125
2103
|
validationState,
|
|
2126
2104
|
isInvalid
|
|
2127
2105
|
});
|
|
2128
|
-
const sharedClasses =
|
|
2106
|
+
const sharedClasses = classNames18(
|
|
2129
2107
|
{
|
|
2130
2108
|
"--is-disabled": isDisabled,
|
|
2131
2109
|
"--is-selected": checked,
|
|
@@ -2134,15 +2112,15 @@ var Checkbox = forwardRef14((props, ref) => {
|
|
|
2134
2112
|
},
|
|
2135
2113
|
validationClasses
|
|
2136
2114
|
);
|
|
2137
|
-
const wrapperClasses =
|
|
2115
|
+
const wrapperClasses = classNames18(
|
|
2138
2116
|
"mobius",
|
|
2139
2117
|
"mobius-checkbox",
|
|
2140
2118
|
sharedClasses,
|
|
2141
2119
|
className
|
|
2142
2120
|
);
|
|
2143
|
-
const labelClasses =
|
|
2144
|
-
const inputClasses =
|
|
2145
|
-
const iconClasses =
|
|
2121
|
+
const labelClasses = classNames18("mobius-checkbox__label", sharedClasses);
|
|
2122
|
+
const inputClasses = classNames18("mobius-checkbox__input", sharedClasses);
|
|
2123
|
+
const iconClasses = classNames18("mobius-checkbox__icon", sharedClasses);
|
|
2146
2124
|
const errorMessageId = useId5();
|
|
2147
2125
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2148
2126
|
const describedBy = spaceDelimitedList([
|
|
@@ -2158,7 +2136,7 @@ var Checkbox = forwardRef14((props, ref) => {
|
|
|
2158
2136
|
};
|
|
2159
2137
|
return /* @__PURE__ */ jsxs13(Stack, { gap: "xs", className: wrapperClasses, children: [
|
|
2160
2138
|
/* @__PURE__ */ jsxs13("label", { className: labelClasses, children: [
|
|
2161
|
-
/* @__PURE__ */
|
|
2139
|
+
/* @__PURE__ */ jsx21(
|
|
2162
2140
|
"input",
|
|
2163
2141
|
{
|
|
2164
2142
|
"aria-describedby": describedBy,
|
|
@@ -2179,7 +2157,7 @@ var Checkbox = forwardRef14((props, ref) => {
|
|
|
2179
2157
|
...rest
|
|
2180
2158
|
}
|
|
2181
2159
|
),
|
|
2182
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ jsx21(
|
|
2183
2161
|
Icon,
|
|
2184
2162
|
{
|
|
2185
2163
|
icon: checked ? squareTick : square,
|
|
@@ -2187,27 +2165,27 @@ var Checkbox = forwardRef14((props, ref) => {
|
|
|
2187
2165
|
className: iconClasses
|
|
2188
2166
|
}
|
|
2189
2167
|
),
|
|
2190
|
-
/* @__PURE__ */
|
|
2168
|
+
/* @__PURE__ */ jsx21("span", { id: labelId, className: "mobius-checkbox__visible-label", children: label })
|
|
2191
2169
|
] }),
|
|
2192
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ jsx21(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2193
2171
|
] });
|
|
2194
2172
|
});
|
|
2195
2173
|
Checkbox.displayName = "Checkbox";
|
|
2196
2174
|
|
|
2197
2175
|
// src/components/Checkbox/CheckboxGroup.tsx
|
|
2198
|
-
import
|
|
2176
|
+
import classNames19 from "classnames/dedupe";
|
|
2199
2177
|
import {
|
|
2200
2178
|
Children as Children3,
|
|
2201
2179
|
cloneElement as cloneElement4,
|
|
2202
|
-
forwardRef as
|
|
2180
|
+
forwardRef as forwardRef14,
|
|
2203
2181
|
isValidElement,
|
|
2204
2182
|
useEffect as useEffect16,
|
|
2205
2183
|
useId as useId6,
|
|
2206
2184
|
useRef as useRef9,
|
|
2207
2185
|
useState as useState12
|
|
2208
2186
|
} from "react";
|
|
2209
|
-
import { jsx as
|
|
2210
|
-
var CheckboxGroup =
|
|
2187
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2188
|
+
var CheckboxGroup = forwardRef14((props, ref) => {
|
|
2211
2189
|
const {
|
|
2212
2190
|
label,
|
|
2213
2191
|
isDisabled = false,
|
|
@@ -2238,7 +2216,7 @@ var CheckboxGroup = forwardRef15((props, ref) => {
|
|
|
2238
2216
|
isInitializedRef.current = true;
|
|
2239
2217
|
}
|
|
2240
2218
|
}, [defaultValue]);
|
|
2241
|
-
const checkboxGroupClasses =
|
|
2219
|
+
const checkboxGroupClasses = classNames19(
|
|
2242
2220
|
"mobius",
|
|
2243
2221
|
"mobius-checkbox-group",
|
|
2244
2222
|
className,
|
|
@@ -2253,7 +2231,7 @@ var CheckboxGroup = forwardRef15((props, ref) => {
|
|
|
2253
2231
|
validationState,
|
|
2254
2232
|
isInvalid
|
|
2255
2233
|
});
|
|
2256
|
-
const labelClasses =
|
|
2234
|
+
const labelClasses = classNames19(
|
|
2257
2235
|
{
|
|
2258
2236
|
"--is-disabled": isDisabled
|
|
2259
2237
|
},
|
|
@@ -2300,8 +2278,8 @@ var CheckboxGroup = forwardRef15((props, ref) => {
|
|
|
2300
2278
|
"--checkbox-items-per-row": itemsPerRow || Children3.count(children)
|
|
2301
2279
|
},
|
|
2302
2280
|
children: [
|
|
2303
|
-
label && /* @__PURE__ */
|
|
2304
|
-
/* @__PURE__ */
|
|
2281
|
+
label && /* @__PURE__ */ jsx22(Label, { elementType: "span", id: labelId, className: labelClasses, children: label }),
|
|
2282
|
+
/* @__PURE__ */ jsx22("div", { className: "mobius-checkbox-group__wrapper", children: childrenArray.map((child) => {
|
|
2305
2283
|
if (isValidElement(child)) {
|
|
2306
2284
|
const isLastItem = child === lastCheckbox;
|
|
2307
2285
|
const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
|
|
@@ -2322,7 +2300,7 @@ var CheckboxGroup = forwardRef15((props, ref) => {
|
|
|
2322
2300
|
}
|
|
2323
2301
|
return child;
|
|
2324
2302
|
}) }),
|
|
2325
|
-
errorMessage && /* @__PURE__ */
|
|
2303
|
+
errorMessage && /* @__PURE__ */ jsx22(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2326
2304
|
]
|
|
2327
2305
|
}
|
|
2328
2306
|
);
|
|
@@ -2330,24 +2308,24 @@ var CheckboxGroup = forwardRef15((props, ref) => {
|
|
|
2330
2308
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
2331
2309
|
|
|
2332
2310
|
// src/components/Container/Container.tsx
|
|
2333
|
-
import { forwardRef as
|
|
2334
|
-
import
|
|
2335
|
-
import { jsx as
|
|
2336
|
-
var Container =
|
|
2311
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
2312
|
+
import classNames20 from "classnames/dedupe";
|
|
2313
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2314
|
+
var Container = forwardRef15((props, ref) => {
|
|
2337
2315
|
const { elementType: Element = "div", size = "md", ...otherProps } = props;
|
|
2338
|
-
const classes =
|
|
2316
|
+
const classes = classNames20(
|
|
2339
2317
|
"mobius",
|
|
2340
2318
|
"mobius-container",
|
|
2341
2319
|
sizeClasses(size),
|
|
2342
2320
|
otherProps.className
|
|
2343
2321
|
);
|
|
2344
|
-
return /* @__PURE__ */
|
|
2322
|
+
return /* @__PURE__ */ jsx23(Element, { ref, ...otherProps, className: classes });
|
|
2345
2323
|
});
|
|
2346
2324
|
Container.displayName = "Container";
|
|
2347
2325
|
|
|
2348
2326
|
// src/components/DateField/DateField.tsx
|
|
2349
|
-
import
|
|
2350
|
-
import { forwardRef as
|
|
2327
|
+
import classNames21 from "classnames/dedupe";
|
|
2328
|
+
import { forwardRef as forwardRef16, useEffect as useEffect17, useRef as useRef10, useState as useState13 } from "react";
|
|
2351
2329
|
|
|
2352
2330
|
// src/components/DateField/validation.ts
|
|
2353
2331
|
var convertToDateFormat = (date, format) => {
|
|
@@ -2382,9 +2360,9 @@ var isValidDate = (date, format = "yyyy-mm-dd") => {
|
|
|
2382
2360
|
};
|
|
2383
2361
|
|
|
2384
2362
|
// src/components/DateField/DateField.tsx
|
|
2385
|
-
import { jsx as
|
|
2363
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2386
2364
|
var MIN_MAX_ERROR = '"min" value should not be greater than "max" value.';
|
|
2387
|
-
var DateField =
|
|
2365
|
+
var DateField = forwardRef16(
|
|
2388
2366
|
(props, ref) => {
|
|
2389
2367
|
const {
|
|
2390
2368
|
min,
|
|
@@ -2399,7 +2377,7 @@ var DateField = forwardRef17(
|
|
|
2399
2377
|
const [error3, setError] = useState13(errorMessage);
|
|
2400
2378
|
const [isInvalid, setIsInvalid] = useState13(void 0);
|
|
2401
2379
|
const localRef = useRef10(null);
|
|
2402
|
-
const classes =
|
|
2380
|
+
const classes = classNames21("mobius-date-field", className);
|
|
2403
2381
|
const formattedMin = min ? convertToDateFormat(min, format) : void 0;
|
|
2404
2382
|
const formattedMax = max ? convertToDateFormat(max, format) : void 0;
|
|
2405
2383
|
const formattedDefaultValue = defaultValue ? convertToDateFormat(defaultValue, format) : void 0;
|
|
@@ -2445,7 +2423,7 @@ var DateField = forwardRef17(
|
|
|
2445
2423
|
validate();
|
|
2446
2424
|
otherProps.onBlur?.(event);
|
|
2447
2425
|
};
|
|
2448
|
-
return /* @__PURE__ */
|
|
2426
|
+
return /* @__PURE__ */ jsx24(
|
|
2449
2427
|
TextField,
|
|
2450
2428
|
{
|
|
2451
2429
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -2466,38 +2444,38 @@ var DateField = forwardRef17(
|
|
|
2466
2444
|
DateField.displayName = "DateField";
|
|
2467
2445
|
|
|
2468
2446
|
// src/components/Divider/Divider.tsx
|
|
2469
|
-
import
|
|
2470
|
-
import { jsx as
|
|
2447
|
+
import classNames22 from "classnames/dedupe";
|
|
2448
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2471
2449
|
var Divider = ({
|
|
2472
2450
|
"aria-orientation": ariaOrientation = "horizontal",
|
|
2473
2451
|
className,
|
|
2474
2452
|
...rest
|
|
2475
2453
|
}) => {
|
|
2476
|
-
const classes =
|
|
2477
|
-
return /* @__PURE__ */
|
|
2454
|
+
const classes = classNames22("mobius", "mobius-divider", className);
|
|
2455
|
+
return /* @__PURE__ */ jsx25(
|
|
2478
2456
|
"div",
|
|
2479
2457
|
{
|
|
2480
2458
|
className: classes,
|
|
2481
2459
|
role: "separator",
|
|
2482
2460
|
"aria-orientation": ariaOrientation,
|
|
2483
2461
|
...rest,
|
|
2484
|
-
children: /* @__PURE__ */
|
|
2462
|
+
children: /* @__PURE__ */ jsx25("div", { className: "mobius-divider__inner" })
|
|
2485
2463
|
}
|
|
2486
2464
|
);
|
|
2487
2465
|
};
|
|
2488
2466
|
Divider.displayName = "Divider";
|
|
2489
2467
|
|
|
2490
2468
|
// src/components/Drawer/Content.tsx
|
|
2491
|
-
import { forwardRef as
|
|
2492
|
-
import { jsx as
|
|
2493
|
-
var Content =
|
|
2494
|
-
({ children, ...otherProps }, ref) => /* @__PURE__ */
|
|
2469
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
2470
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2471
|
+
var Content = forwardRef17(
|
|
2472
|
+
({ children, ...otherProps }, ref) => /* @__PURE__ */ jsx26("div", { ref, ...otherProps, className: "mobius-drawer__content", children })
|
|
2495
2473
|
);
|
|
2496
2474
|
Content.displayName = "Content";
|
|
2497
2475
|
|
|
2498
2476
|
// src/components/Drawer/Drawer.tsx
|
|
2499
|
-
import
|
|
2500
|
-
import { forwardRef as
|
|
2477
|
+
import classNames23 from "classnames/dedupe";
|
|
2478
|
+
import { forwardRef as forwardRef18, useEffect as useEffect18, useId as useId7, useMemo, useRef as useRef11, useState as useState14 } from "react";
|
|
2501
2479
|
|
|
2502
2480
|
// src/components/Drawer/DrawerContext.tsx
|
|
2503
2481
|
import { createContext } from "react";
|
|
@@ -2509,9 +2487,9 @@ var DrawerContext = createContext({
|
|
|
2509
2487
|
});
|
|
2510
2488
|
|
|
2511
2489
|
// src/components/Drawer/Drawer.tsx
|
|
2512
|
-
import { jsx as
|
|
2490
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2513
2491
|
var TRANSITION_CSS_VARIABLE = "--drawer-transition-duration";
|
|
2514
|
-
var Drawer =
|
|
2492
|
+
var Drawer = forwardRef18((props, ref) => {
|
|
2515
2493
|
const {
|
|
2516
2494
|
isOpen,
|
|
2517
2495
|
className,
|
|
@@ -2536,7 +2514,7 @@ var Drawer = forwardRef19((props, ref) => {
|
|
|
2536
2514
|
});
|
|
2537
2515
|
const hiddenId = `dialog-screen-reader-announce-${useId7()}`;
|
|
2538
2516
|
const headerId = `dialog-header-${useId7()}`;
|
|
2539
|
-
const dialogClasses =
|
|
2517
|
+
const dialogClasses = classNames23(
|
|
2540
2518
|
"mobius",
|
|
2541
2519
|
"mobius-drawer",
|
|
2542
2520
|
`--${direction}`,
|
|
@@ -2566,8 +2544,8 @@ var Drawer = forwardRef19((props, ref) => {
|
|
|
2566
2544
|
"aria-describedby": hiddenId,
|
|
2567
2545
|
"aria-labelledby": headerId,
|
|
2568
2546
|
children: [
|
|
2569
|
-
/* @__PURE__ */
|
|
2570
|
-
/* @__PURE__ */
|
|
2547
|
+
/* @__PURE__ */ jsx27(VisuallyHidden, { children: /* @__PURE__ */ jsx27("div", { id: hiddenId, children: announce }) }),
|
|
2548
|
+
/* @__PURE__ */ jsx27(DrawerContext.Provider, { value: contextValue, children })
|
|
2571
2549
|
]
|
|
2572
2550
|
}
|
|
2573
2551
|
);
|
|
@@ -2582,14 +2560,14 @@ var useDrawer = () => {
|
|
|
2582
2560
|
};
|
|
2583
2561
|
|
|
2584
2562
|
// src/components/Drawer/Header.tsx
|
|
2585
|
-
import { forwardRef as
|
|
2563
|
+
import { forwardRef as forwardRef19 } from "react";
|
|
2586
2564
|
import { cross } from "@simplybusiness/icons";
|
|
2587
|
-
import { jsx as
|
|
2588
|
-
var Header =
|
|
2565
|
+
import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2566
|
+
var Header = forwardRef19(
|
|
2589
2567
|
({ children, ...otherProps }, ref) => {
|
|
2590
2568
|
const { onClose, closeLabel, headerId } = useDrawer();
|
|
2591
2569
|
return /* @__PURE__ */ jsxs16("header", { ref, ...otherProps, className: "mobius-drawer__header", children: [
|
|
2592
|
-
/* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ jsx28("h2", { id: headerId, children }),
|
|
2593
2571
|
/* @__PURE__ */ jsxs16(
|
|
2594
2572
|
Button,
|
|
2595
2573
|
{
|
|
@@ -2599,7 +2577,7 @@ var Header = forwardRef20(
|
|
|
2599
2577
|
className: "mobius-drawer__close",
|
|
2600
2578
|
size: "sm",
|
|
2601
2579
|
children: [
|
|
2602
|
-
/* @__PURE__ */
|
|
2580
|
+
/* @__PURE__ */ jsx28(Icon, { icon: cross }),
|
|
2603
2581
|
" ",
|
|
2604
2582
|
closeLabel
|
|
2605
2583
|
]
|
|
@@ -2619,16 +2597,16 @@ Drawer2.displayName = "Drawer";
|
|
|
2619
2597
|
|
|
2620
2598
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2621
2599
|
import {
|
|
2622
|
-
forwardRef as
|
|
2600
|
+
forwardRef as forwardRef20,
|
|
2623
2601
|
Children as Children4,
|
|
2624
2602
|
isValidElement as isValidElement2,
|
|
2625
2603
|
cloneElement as cloneElement5,
|
|
2626
2604
|
useState as useState15
|
|
2627
2605
|
} from "react";
|
|
2628
2606
|
import useDropdownMenu from "react-accessible-dropdown-menu-hook";
|
|
2629
|
-
import
|
|
2630
|
-
import { jsx as
|
|
2631
|
-
var DropdownMenu =
|
|
2607
|
+
import classNames24 from "classnames/dedupe";
|
|
2608
|
+
import { jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2609
|
+
var DropdownMenu = forwardRef20((props, ref) => {
|
|
2632
2610
|
const {
|
|
2633
2611
|
elementType: Element = "nav",
|
|
2634
2612
|
trigger,
|
|
@@ -2644,13 +2622,13 @@ var DropdownMenu = forwardRef21((props, ref) => {
|
|
|
2644
2622
|
isOpen: open,
|
|
2645
2623
|
setIsOpen
|
|
2646
2624
|
} = useDropdownMenu(numberOfItems);
|
|
2647
|
-
const classes =
|
|
2625
|
+
const classes = classNames24(
|
|
2648
2626
|
"mobius",
|
|
2649
2627
|
"mobius-dropdown-menu",
|
|
2650
2628
|
otherProps.className
|
|
2651
2629
|
);
|
|
2652
|
-
const triggerClasses =
|
|
2653
|
-
const listClasses =
|
|
2630
|
+
const triggerClasses = classNames24("mobius", "mobius-dropdown-menu__trigger");
|
|
2631
|
+
const listClasses = classNames24("mobius", "mobius-dropdown-menu__list", {
|
|
2654
2632
|
"--is-open": open
|
|
2655
2633
|
});
|
|
2656
2634
|
const handleChildClick = ({ onClick }, index) => {
|
|
@@ -2666,8 +2644,8 @@ var DropdownMenu = forwardRef21((props, ref) => {
|
|
|
2666
2644
|
open,
|
|
2667
2645
|
label,
|
|
2668
2646
|
...buttonProps
|
|
2669
|
-
}) : /* @__PURE__ */
|
|
2670
|
-
/* @__PURE__ */
|
|
2647
|
+
}) : /* @__PURE__ */ jsx29(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
2648
|
+
/* @__PURE__ */ jsx29("ul", { className: listClasses, role: "menu", children: Children4.map(children, (child, index) => {
|
|
2671
2649
|
if (isValidElement2(child)) {
|
|
2672
2650
|
return cloneElement5(child, {
|
|
2673
2651
|
onClick: () => handleChildClick(child.props, index),
|
|
@@ -2682,10 +2660,10 @@ var DropdownMenu = forwardRef21((props, ref) => {
|
|
|
2682
2660
|
DropdownMenu.displayName = "DropdownMenu";
|
|
2683
2661
|
|
|
2684
2662
|
// src/components/DropdownMenu/Item.tsx
|
|
2685
|
-
import { forwardRef as
|
|
2686
|
-
import
|
|
2687
|
-
import { jsx as
|
|
2688
|
-
var Item =
|
|
2663
|
+
import { forwardRef as forwardRef21, cloneElement as cloneElement6, isValidElement as isValidElement3, Children as Children5 } from "react";
|
|
2664
|
+
import classNames25 from "classnames/dedupe";
|
|
2665
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2666
|
+
var Item = forwardRef21(
|
|
2689
2667
|
(props, ref) => {
|
|
2690
2668
|
const {
|
|
2691
2669
|
elementType: Element = "li",
|
|
@@ -2694,15 +2672,15 @@ var Item = forwardRef22(
|
|
|
2694
2672
|
children,
|
|
2695
2673
|
...otherProps
|
|
2696
2674
|
} = props;
|
|
2697
|
-
const classes =
|
|
2675
|
+
const classes = classNames25(
|
|
2698
2676
|
"mobius",
|
|
2699
2677
|
"mobius-dropdown-menu__item",
|
|
2700
2678
|
{ "--is-active": active },
|
|
2701
2679
|
otherProps.className
|
|
2702
2680
|
);
|
|
2703
|
-
return /* @__PURE__ */
|
|
2681
|
+
return /* @__PURE__ */ jsx30(Element, { ref, onClick, ...otherProps, children: Children5.map(children, (child) => {
|
|
2704
2682
|
if (isValidElement3(child)) {
|
|
2705
|
-
const childClasses =
|
|
2683
|
+
const childClasses = classNames25(
|
|
2706
2684
|
child.props.className,
|
|
2707
2685
|
classes
|
|
2708
2686
|
);
|
|
@@ -2713,7 +2691,7 @@ var Item = forwardRef22(
|
|
|
2713
2691
|
}
|
|
2714
2692
|
);
|
|
2715
2693
|
}
|
|
2716
|
-
return /* @__PURE__ */
|
|
2694
|
+
return /* @__PURE__ */ jsx30("span", { className: classes, children: child });
|
|
2717
2695
|
}) });
|
|
2718
2696
|
}
|
|
2719
2697
|
);
|
|
@@ -2729,9 +2707,9 @@ var DropdownMenu2 = Object.assign(
|
|
|
2729
2707
|
DropdownMenu2.displayName = "DropdownMenu";
|
|
2730
2708
|
|
|
2731
2709
|
// src/components/Fieldset/Fieldset.tsx
|
|
2732
|
-
import
|
|
2733
|
-
import { cloneElement as cloneElement7, forwardRef as
|
|
2734
|
-
import { jsx as
|
|
2710
|
+
import classNames26 from "classnames/dedupe";
|
|
2711
|
+
import { cloneElement as cloneElement7, forwardRef as forwardRef22, useId as useId8 } from "react";
|
|
2712
|
+
import { jsx as jsx31, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2735
2713
|
var useFieldset = (props) => {
|
|
2736
2714
|
const { legend } = props;
|
|
2737
2715
|
let legendProps = {};
|
|
@@ -2754,15 +2732,15 @@ var useFieldset = (props) => {
|
|
|
2754
2732
|
containerProps
|
|
2755
2733
|
};
|
|
2756
2734
|
};
|
|
2757
|
-
var Fieldset =
|
|
2735
|
+
var Fieldset = forwardRef22((props, _ref) => {
|
|
2758
2736
|
const {
|
|
2759
2737
|
children,
|
|
2760
2738
|
legend,
|
|
2761
|
-
legendComponent = /* @__PURE__ */
|
|
2739
|
+
legendComponent = /* @__PURE__ */ jsx31("legend", {}),
|
|
2762
2740
|
...otherProps
|
|
2763
2741
|
} = props;
|
|
2764
2742
|
const { legendProps, containerProps } = useFieldset(props);
|
|
2765
|
-
const classes =
|
|
2743
|
+
const classes = classNames26("mobius", "mobius-fieldset", props.className);
|
|
2766
2744
|
legendProps.className = "mobius-fieldset__legend";
|
|
2767
2745
|
return /* @__PURE__ */ jsxs18(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
2768
2746
|
legend && cloneElement7(legendComponent, { ...legendProps }, [legend]),
|
|
@@ -2772,10 +2750,10 @@ var Fieldset = forwardRef23((props, _ref) => {
|
|
|
2772
2750
|
Fieldset.displayName = "Fieldset";
|
|
2773
2751
|
|
|
2774
2752
|
// src/components/Grid/Grid.tsx
|
|
2775
|
-
import { forwardRef as
|
|
2776
|
-
import
|
|
2777
|
-
import { jsx as
|
|
2778
|
-
var Grid =
|
|
2753
|
+
import { forwardRef as forwardRef23 } from "react";
|
|
2754
|
+
import classNames27 from "classnames/dedupe";
|
|
2755
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2756
|
+
var Grid = forwardRef23(
|
|
2779
2757
|
(props, _ref) => {
|
|
2780
2758
|
const {
|
|
2781
2759
|
columns = 12,
|
|
@@ -2790,7 +2768,7 @@ var Grid = forwardRef24(
|
|
|
2790
2768
|
style,
|
|
2791
2769
|
...rest
|
|
2792
2770
|
} = props;
|
|
2793
|
-
const classes =
|
|
2771
|
+
const classes = classNames27("mobius", "mobius-grid", className);
|
|
2794
2772
|
const styles = filterUndefinedProps({
|
|
2795
2773
|
boxSizing: "border-box",
|
|
2796
2774
|
display: "grid",
|
|
@@ -2804,22 +2782,22 @@ var Grid = forwardRef24(
|
|
|
2804
2782
|
justifyItems,
|
|
2805
2783
|
...style
|
|
2806
2784
|
});
|
|
2807
|
-
return /* @__PURE__ */
|
|
2785
|
+
return /* @__PURE__ */ jsx32("div", { style: styles, className: classes, ...rest });
|
|
2808
2786
|
}
|
|
2809
2787
|
);
|
|
2810
2788
|
Grid.displayName = "Grid";
|
|
2811
2789
|
|
|
2812
2790
|
// src/components/Grid/Item.tsx
|
|
2813
|
-
import { forwardRef as
|
|
2814
|
-
import
|
|
2815
|
-
import { jsx as
|
|
2791
|
+
import { forwardRef as forwardRef24, useEffect as useEffect19, useState as useState16 } from "react";
|
|
2792
|
+
import classNames28 from "classnames/dedupe";
|
|
2793
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2816
2794
|
var getBreakpointMap = (config) => Object.entries(config).reduce((prev, [key, value]) => {
|
|
2817
2795
|
const previous = Object.values(prev);
|
|
2818
2796
|
const lastDefined = previous[previous.length - 1];
|
|
2819
2797
|
return { ...prev, [key]: value || lastDefined };
|
|
2820
2798
|
}, {});
|
|
2821
2799
|
var DEFAULT_SPAN = 12;
|
|
2822
|
-
var GridItem =
|
|
2800
|
+
var GridItem = forwardRef24((props, _ref) => {
|
|
2823
2801
|
const {
|
|
2824
2802
|
breakpoint: { size: breakpointSize }
|
|
2825
2803
|
} = useBreakpoint();
|
|
@@ -2845,7 +2823,7 @@ var GridItem = forwardRef25((props, _ref) => {
|
|
|
2845
2823
|
xxl
|
|
2846
2824
|
});
|
|
2847
2825
|
const [responsiveSpan, setResponsiveSpan] = useState16();
|
|
2848
|
-
const classes =
|
|
2826
|
+
const classes = classNames28("mobius-grid__item", className);
|
|
2849
2827
|
useEffect19(() => {
|
|
2850
2828
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
2851
2829
|
}, [breakpointSize, breakpointMap]);
|
|
@@ -2854,7 +2832,7 @@ var GridItem = forwardRef25((props, _ref) => {
|
|
|
2854
2832
|
alignSelf,
|
|
2855
2833
|
justifySelf
|
|
2856
2834
|
};
|
|
2857
|
-
return /* @__PURE__ */
|
|
2835
|
+
return /* @__PURE__ */ jsx33("div", { style: { ...styles }, className: classes, ...rest });
|
|
2858
2836
|
});
|
|
2859
2837
|
GridItem.displayName = "GridItem";
|
|
2860
2838
|
|
|
@@ -2865,22 +2843,22 @@ var Grid2 = Object.assign(Grid, {
|
|
|
2865
2843
|
Grid2.displayName = "Grid";
|
|
2866
2844
|
|
|
2867
2845
|
// src/components/Image/Image.tsx
|
|
2868
|
-
import { forwardRef as
|
|
2869
|
-
import
|
|
2870
|
-
import { jsx as
|
|
2871
|
-
var Image =
|
|
2846
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
2847
|
+
import classNames29 from "classnames/dedupe";
|
|
2848
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2849
|
+
var Image = forwardRef25(
|
|
2872
2850
|
({ alt, elementType: Component = "img", ...otherProps }, ref) => {
|
|
2873
|
-
const classes =
|
|
2874
|
-
return /* @__PURE__ */
|
|
2851
|
+
const classes = classNames29("mobius", "mobius-image", otherProps.className);
|
|
2852
|
+
return /* @__PURE__ */ jsx34(Component, { alt, ref, ...otherProps, className: classes });
|
|
2875
2853
|
}
|
|
2876
2854
|
);
|
|
2877
2855
|
Image.displayName = "Image";
|
|
2878
2856
|
|
|
2879
2857
|
// src/components/Link/Link.tsx
|
|
2880
|
-
import { forwardRef as
|
|
2881
|
-
import
|
|
2882
|
-
import { jsx as
|
|
2883
|
-
var Link =
|
|
2858
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
2859
|
+
import classNames30 from "classnames/dedupe";
|
|
2860
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2861
|
+
var Link = forwardRef26(
|
|
2884
2862
|
(props, ref) => {
|
|
2885
2863
|
const {
|
|
2886
2864
|
isDisabled = false,
|
|
@@ -2894,7 +2872,7 @@ var Link = forwardRef27(
|
|
|
2894
2872
|
pointerEvents: "none"
|
|
2895
2873
|
};
|
|
2896
2874
|
const styles = { ...style, ...isDisabled && disabledStyles };
|
|
2897
|
-
const classes =
|
|
2875
|
+
const classes = classNames30(
|
|
2898
2876
|
"mobius",
|
|
2899
2877
|
"mobius-link",
|
|
2900
2878
|
className,
|
|
@@ -2903,7 +2881,7 @@ var Link = forwardRef27(
|
|
|
2903
2881
|
"--is-disabled": isDisabled
|
|
2904
2882
|
}
|
|
2905
2883
|
);
|
|
2906
|
-
return /* @__PURE__ */
|
|
2884
|
+
return /* @__PURE__ */ jsx35(
|
|
2907
2885
|
Component,
|
|
2908
2886
|
{
|
|
2909
2887
|
ref,
|
|
@@ -2919,8 +2897,8 @@ var Link = forwardRef27(
|
|
|
2919
2897
|
Link.displayName = "Link";
|
|
2920
2898
|
|
|
2921
2899
|
// src/components/LinkButton/LinkButton.tsx
|
|
2922
|
-
import
|
|
2923
|
-
import { jsx as
|
|
2900
|
+
import classNames31 from "classnames/dedupe";
|
|
2901
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2924
2902
|
function LinkButton({
|
|
2925
2903
|
href,
|
|
2926
2904
|
children,
|
|
@@ -2931,18 +2909,18 @@ function LinkButton({
|
|
|
2931
2909
|
if (!href) {
|
|
2932
2910
|
throw new Error("LinkButton requires a href prop");
|
|
2933
2911
|
}
|
|
2934
|
-
const classes =
|
|
2912
|
+
const classes = classNames31("mobius", "mobius-link-button", className);
|
|
2935
2913
|
return (
|
|
2936
2914
|
// @ts-expect-error Button only allows elementType of string, not React component
|
|
2937
|
-
/* @__PURE__ */
|
|
2915
|
+
/* @__PURE__ */ jsx36(Button, { elementType, href, className: classes, ...rest, children })
|
|
2938
2916
|
);
|
|
2939
2917
|
}
|
|
2940
2918
|
|
|
2941
2919
|
// src/components/List/List.tsx
|
|
2942
|
-
import { Children as Children6, cloneElement as cloneElement8, forwardRef as
|
|
2943
|
-
import
|
|
2944
|
-
import { jsx as
|
|
2945
|
-
var List =
|
|
2920
|
+
import { Children as Children6, cloneElement as cloneElement8, forwardRef as forwardRef27, isValidElement as isValidElement4 } from "react";
|
|
2921
|
+
import classNames32 from "classnames/dedupe";
|
|
2922
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2923
|
+
var List = forwardRef27(
|
|
2946
2924
|
(props, ref) => {
|
|
2947
2925
|
const Component = props.isOrdered ? "ol" : "ul";
|
|
2948
2926
|
const { children, icon, ...otherProps } = props;
|
|
@@ -2951,7 +2929,7 @@ var List = forwardRef28(
|
|
|
2951
2929
|
...restProps,
|
|
2952
2930
|
reversed: isReversed
|
|
2953
2931
|
};
|
|
2954
|
-
const classes =
|
|
2932
|
+
const classes = classNames32(
|
|
2955
2933
|
"mobius",
|
|
2956
2934
|
"mobius-list",
|
|
2957
2935
|
{
|
|
@@ -2960,7 +2938,7 @@ var List = forwardRef28(
|
|
|
2960
2938
|
},
|
|
2961
2939
|
otherProps.className
|
|
2962
2940
|
);
|
|
2963
|
-
return /* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ jsx37(Component, { ref, ...mappedProps, className: classes, children: Children6.map(children, (child) => {
|
|
2964
2942
|
if (isValidElement4(child)) {
|
|
2965
2943
|
return cloneElement8(child, {
|
|
2966
2944
|
parentIcon: icon
|
|
@@ -2973,13 +2951,13 @@ var List = forwardRef28(
|
|
|
2973
2951
|
List.displayName = "List";
|
|
2974
2952
|
|
|
2975
2953
|
// src/components/List/ListItem.tsx
|
|
2976
|
-
import { forwardRef as
|
|
2977
|
-
import
|
|
2978
|
-
import { jsx as
|
|
2979
|
-
var ListItem =
|
|
2954
|
+
import { forwardRef as forwardRef28 } from "react";
|
|
2955
|
+
import classNames33 from "classnames/dedupe";
|
|
2956
|
+
import { jsx as jsx38, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2957
|
+
var ListItem = forwardRef28((props, ref) => {
|
|
2980
2958
|
const { parentIcon, icon, children, ...otherProps } = props;
|
|
2981
2959
|
const iconContent = icon || parentIcon;
|
|
2982
|
-
const classes =
|
|
2960
|
+
const classes = classNames33(
|
|
2983
2961
|
"mobius",
|
|
2984
2962
|
"mobius-list__item",
|
|
2985
2963
|
{
|
|
@@ -2987,41 +2965,41 @@ var ListItem = forwardRef29((props, ref) => {
|
|
|
2987
2965
|
},
|
|
2988
2966
|
props.className
|
|
2989
2967
|
);
|
|
2990
|
-
const contentClasses =
|
|
2991
|
-
const iconClasses =
|
|
2968
|
+
const contentClasses = classNames33("mobius", "mobius-list__item-content");
|
|
2969
|
+
const iconClasses = classNames33("mobius", "mobius-list__icon");
|
|
2992
2970
|
if (iconContent) {
|
|
2993
|
-
return /* @__PURE__ */
|
|
2994
|
-
/* @__PURE__ */
|
|
2971
|
+
return /* @__PURE__ */ jsx38("li", { ref, ...otherProps, className: classes, children: /* @__PURE__ */ jsxs19("span", { className: contentClasses, children: [
|
|
2972
|
+
/* @__PURE__ */ jsx38("span", { className: iconClasses, children: iconContent }),
|
|
2995
2973
|
children
|
|
2996
2974
|
] }) });
|
|
2997
2975
|
}
|
|
2998
|
-
return /* @__PURE__ */
|
|
2976
|
+
return /* @__PURE__ */ jsx38("li", { ref, ...otherProps, className: classes, children });
|
|
2999
2977
|
});
|
|
3000
2978
|
ListItem.displayName = "ListItem";
|
|
3001
2979
|
|
|
3002
2980
|
// src/components/LoadingIndicator/LoadingIndicator.tsx
|
|
3003
|
-
import { forwardRef as
|
|
3004
|
-
import
|
|
2981
|
+
import { forwardRef as forwardRef29 } from "react";
|
|
2982
|
+
import classNames34 from "classnames/dedupe";
|
|
3005
2983
|
import { loading as loading2 } from "@simplybusiness/icons";
|
|
3006
|
-
import { jsx as
|
|
3007
|
-
var LoadingIndicator =
|
|
2984
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2985
|
+
var LoadingIndicator = forwardRef29((props, ref) => {
|
|
3008
2986
|
const { icon = loading2, ...otherProps } = props;
|
|
3009
|
-
const classes =
|
|
2987
|
+
const classes = classNames34(
|
|
3010
2988
|
"mobius",
|
|
3011
2989
|
"mobius-loading-indicator",
|
|
3012
2990
|
otherProps.className
|
|
3013
2991
|
);
|
|
3014
|
-
return /* @__PURE__ */
|
|
2992
|
+
return /* @__PURE__ */ jsx39(Icon, { icon, spin: true, ref, ...otherProps, className: classes });
|
|
3015
2993
|
});
|
|
3016
2994
|
LoadingIndicator.displayName = "LoadingIndicator";
|
|
3017
2995
|
|
|
3018
2996
|
// src/components/Logo/Logo.tsx
|
|
3019
|
-
import { forwardRef as
|
|
3020
|
-
import
|
|
3021
|
-
import { jsx as
|
|
3022
|
-
var Logo =
|
|
2997
|
+
import { forwardRef as forwardRef30 } from "react";
|
|
2998
|
+
import classNames35 from "classnames/dedupe";
|
|
2999
|
+
import { jsx as jsx40, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3000
|
+
var Logo = forwardRef30((props, ref) => {
|
|
3023
3001
|
const { className, width, height, ...otherProps } = props;
|
|
3024
|
-
const classes =
|
|
3002
|
+
const classes = classNames35("mobius", "mobius-logo", className);
|
|
3025
3003
|
return /* @__PURE__ */ jsxs20(
|
|
3026
3004
|
"svg",
|
|
3027
3005
|
{
|
|
@@ -3032,7 +3010,7 @@ var Logo = forwardRef31((props, ref) => {
|
|
|
3032
3010
|
viewBox: "0 0 144 37",
|
|
3033
3011
|
...otherProps,
|
|
3034
3012
|
children: [
|
|
3035
|
-
/* @__PURE__ */
|
|
3013
|
+
/* @__PURE__ */ jsx40("defs", { children: /* @__PURE__ */ jsxs20(
|
|
3036
3014
|
"linearGradient",
|
|
3037
3015
|
{
|
|
3038
3016
|
id: "logo-gradient",
|
|
@@ -3041,27 +3019,27 @@ var Logo = forwardRef31((props, ref) => {
|
|
|
3041
3019
|
y1: "76.042%",
|
|
3042
3020
|
y2: "26.973%",
|
|
3043
3021
|
children: [
|
|
3044
|
-
/* @__PURE__ */
|
|
3045
|
-
/* @__PURE__ */
|
|
3022
|
+
/* @__PURE__ */ jsx40("stop", { stopColor: "#4632D8", offset: "0%" }),
|
|
3023
|
+
/* @__PURE__ */ jsx40("stop", { stopColor: "#9084E8", offset: "100%" })
|
|
3046
3024
|
]
|
|
3047
3025
|
}
|
|
3048
3026
|
) }),
|
|
3049
3027
|
/* @__PURE__ */ jsxs20("g", { children: [
|
|
3050
|
-
/* @__PURE__ */
|
|
3028
|
+
/* @__PURE__ */ jsx40(
|
|
3051
3029
|
"path",
|
|
3052
3030
|
{
|
|
3053
3031
|
fill: "#0E0A2B",
|
|
3054
3032
|
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"
|
|
3055
3033
|
}
|
|
3056
3034
|
),
|
|
3057
|
-
/* @__PURE__ */
|
|
3035
|
+
/* @__PURE__ */ jsx40(
|
|
3058
3036
|
"path",
|
|
3059
3037
|
{
|
|
3060
3038
|
fill: "url(#logo-gradient)",
|
|
3061
3039
|
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"
|
|
3062
3040
|
}
|
|
3063
3041
|
),
|
|
3064
|
-
/* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ jsx40(
|
|
3065
3043
|
"path",
|
|
3066
3044
|
{
|
|
3067
3045
|
fill: "#0E0A2B",
|
|
@@ -3076,15 +3054,15 @@ var Logo = forwardRef31((props, ref) => {
|
|
|
3076
3054
|
Logo.displayName = "Logo";
|
|
3077
3055
|
|
|
3078
3056
|
// src/components/Modal/Content.tsx
|
|
3079
|
-
import { forwardRef as
|
|
3080
|
-
import { jsx as
|
|
3081
|
-
var Content2 =
|
|
3082
|
-
({ children, ...otherProps }, ref) => /* @__PURE__ */
|
|
3057
|
+
import { forwardRef as forwardRef31 } from "react";
|
|
3058
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3059
|
+
var Content2 = forwardRef31(
|
|
3060
|
+
({ children, ...otherProps }, ref) => /* @__PURE__ */ jsx41("div", { ref, ...otherProps, className: "mobius-modal__content", children })
|
|
3083
3061
|
);
|
|
3084
3062
|
Content2.displayName = "Content";
|
|
3085
3063
|
|
|
3086
3064
|
// src/components/Modal/Header.tsx
|
|
3087
|
-
import { forwardRef as
|
|
3065
|
+
import { forwardRef as forwardRef32 } from "react";
|
|
3088
3066
|
import { cross as cross2 } from "@simplybusiness/icons";
|
|
3089
3067
|
|
|
3090
3068
|
// src/components/Modal/useModal.ts
|
|
@@ -3105,8 +3083,8 @@ var useModal = () => {
|
|
|
3105
3083
|
};
|
|
3106
3084
|
|
|
3107
3085
|
// src/components/Modal/Header.tsx
|
|
3108
|
-
import { jsx as
|
|
3109
|
-
var Header2 =
|
|
3086
|
+
import { jsx as jsx42, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3087
|
+
var Header2 = forwardRef32(
|
|
3110
3088
|
({ children, ...otherProps }, ref) => {
|
|
3111
3089
|
const { onClose, closeLabel } = useModal();
|
|
3112
3090
|
return /* @__PURE__ */ jsxs21("header", { ref, ...otherProps, className: "mobius-modal__header", children: [
|
|
@@ -3119,7 +3097,7 @@ var Header2 = forwardRef33(
|
|
|
3119
3097
|
onPress: onClose,
|
|
3120
3098
|
className: "mobius-modal__close",
|
|
3121
3099
|
children: [
|
|
3122
|
-
/* @__PURE__ */
|
|
3100
|
+
/* @__PURE__ */ jsx42(Icon, { icon: cross2 }),
|
|
3123
3101
|
" ",
|
|
3124
3102
|
closeLabel
|
|
3125
3103
|
]
|
|
@@ -3131,11 +3109,11 @@ var Header2 = forwardRef33(
|
|
|
3131
3109
|
Header2.displayName = "Header";
|
|
3132
3110
|
|
|
3133
3111
|
// src/components/Modal/Modal.tsx
|
|
3134
|
-
import
|
|
3135
|
-
import { forwardRef as
|
|
3136
|
-
import { jsx as
|
|
3112
|
+
import classNames36 from "classnames/dedupe";
|
|
3113
|
+
import { forwardRef as forwardRef33, useEffect as useEffect20, useMemo as useMemo2, useRef as useRef12, useState as useState17 } from "react";
|
|
3114
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3137
3115
|
var TRANSITION_CSS_VARIABLE2 = "--modal-transition-duration";
|
|
3138
|
-
var Modal =
|
|
3116
|
+
var Modal = forwardRef33((props, ref) => {
|
|
3139
3117
|
const {
|
|
3140
3118
|
isOpen,
|
|
3141
3119
|
onClose,
|
|
@@ -3175,7 +3153,7 @@ var Modal = forwardRef34((props, ref) => {
|
|
|
3175
3153
|
CSSVariable: TRANSITION_CSS_VARIABLE2
|
|
3176
3154
|
}
|
|
3177
3155
|
});
|
|
3178
|
-
const modalClasses =
|
|
3156
|
+
const modalClasses = classNames36(
|
|
3179
3157
|
"mobius",
|
|
3180
3158
|
"mobius-modal",
|
|
3181
3159
|
{
|
|
@@ -3195,14 +3173,14 @@ var Modal = forwardRef34((props, ref) => {
|
|
|
3195
3173
|
}),
|
|
3196
3174
|
[close, closeLabel]
|
|
3197
3175
|
);
|
|
3198
|
-
return /* @__PURE__ */
|
|
3176
|
+
return /* @__PURE__ */ jsx43(
|
|
3199
3177
|
"dialog",
|
|
3200
3178
|
{
|
|
3201
3179
|
ref: mergeRefs([dialogRef, ref]),
|
|
3202
3180
|
onCancel: close,
|
|
3203
3181
|
className: modalClasses,
|
|
3204
3182
|
...rest,
|
|
3205
|
-
children: /* @__PURE__ */
|
|
3183
|
+
children: /* @__PURE__ */ jsx43(ModalContext.Provider, { value: contextValue, children })
|
|
3206
3184
|
}
|
|
3207
3185
|
);
|
|
3208
3186
|
});
|
|
@@ -3216,11 +3194,16 @@ var Modal2 = Object.assign(Modal, {
|
|
|
3216
3194
|
Modal2.displayName = "Modal";
|
|
3217
3195
|
|
|
3218
3196
|
// src/components/NumberField/NumberField.tsx
|
|
3219
|
-
import
|
|
3220
|
-
import {
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3197
|
+
import classNames37 from "classnames/dedupe";
|
|
3198
|
+
import {
|
|
3199
|
+
forwardRef as forwardRef34,
|
|
3200
|
+
useCallback as useCallback5,
|
|
3201
|
+
useEffect as useEffect21,
|
|
3202
|
+
useRef as useRef13
|
|
3203
|
+
} from "react";
|
|
3204
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3205
|
+
var SMALLEST_INCREMENT = 1e-3;
|
|
3206
|
+
var NumberField = forwardRef34((props, ref) => {
|
|
3224
3207
|
const {
|
|
3225
3208
|
minValue,
|
|
3226
3209
|
maxValue,
|
|
@@ -3230,6 +3213,11 @@ var NumberField = forwardRef35((props, ref) => {
|
|
|
3230
3213
|
className,
|
|
3231
3214
|
...otherProps
|
|
3232
3215
|
} = props;
|
|
3216
|
+
const {
|
|
3217
|
+
onFocus: customOnFocus,
|
|
3218
|
+
onBlur: customOnBlur,
|
|
3219
|
+
...rest
|
|
3220
|
+
} = otherProps;
|
|
3233
3221
|
const focusedInputRef = useRef13(null);
|
|
3234
3222
|
const wheelHandler = useCallback5((ev) => ev.preventDefault(), []);
|
|
3235
3223
|
useEffect21(() => {
|
|
@@ -3238,25 +3226,59 @@ var NumberField = forwardRef35((props, ref) => {
|
|
|
3238
3226
|
focusedInputRef.current = null;
|
|
3239
3227
|
};
|
|
3240
3228
|
}, [wheelHandler]);
|
|
3241
|
-
const containerClasses =
|
|
3229
|
+
const containerClasses = classNames37("mobius-number-field", className, {
|
|
3242
3230
|
"--hide-spin-buttons": hideSpinButtons
|
|
3243
3231
|
});
|
|
3244
3232
|
const handleBeforeInput = (event) => {
|
|
3245
3233
|
const { data } = event.nativeEvent;
|
|
3246
|
-
if (step
|
|
3234
|
+
if (step && Number.isInteger(step) && data === ".") {
|
|
3247
3235
|
event.preventDefault();
|
|
3248
3236
|
}
|
|
3249
|
-
if (minValue
|
|
3237
|
+
if (minValue && minValue >= 0 && data === "-") {
|
|
3250
3238
|
event.preventDefault();
|
|
3251
3239
|
}
|
|
3252
3240
|
};
|
|
3253
|
-
const {
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3241
|
+
const handleChange = (event) => {
|
|
3242
|
+
const { value } = event.target;
|
|
3243
|
+
const numValue = parseFloat(value);
|
|
3244
|
+
if (value === "" || value === "-" || isNaN(numValue)) {
|
|
3245
|
+
otherProps.onChange?.(event);
|
|
3246
|
+
return;
|
|
3247
|
+
}
|
|
3248
|
+
if (step && step > 1) {
|
|
3249
|
+
const baseValue = minValue ?? 0;
|
|
3250
|
+
const remainder = (numValue - baseValue) % step;
|
|
3251
|
+
if (Math.abs(remainder) > SMALLEST_INCREMENT && Math.abs(remainder - step) > SMALLEST_INCREMENT) {
|
|
3252
|
+
event.preventDefault();
|
|
3253
|
+
return;
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3256
|
+
otherProps.onChange?.(event);
|
|
3257
|
+
};
|
|
3258
|
+
const handleBlur = (event) => {
|
|
3259
|
+
const { value } = event.target;
|
|
3260
|
+
const numValue = parseFloat(value);
|
|
3261
|
+
if (step && step > 1 && !isNaN(numValue)) {
|
|
3262
|
+
const baseValue = minValue ?? 0;
|
|
3263
|
+
const steps = Math.round((numValue - baseValue) / step);
|
|
3264
|
+
const snappedValue = baseValue + steps * step;
|
|
3265
|
+
if (snappedValue !== numValue) {
|
|
3266
|
+
event.target.value = snappedValue.toString();
|
|
3267
|
+
const changeEvent = new Event("change", { bubbles: true });
|
|
3268
|
+
event.target.dispatchEvent(changeEvent);
|
|
3269
|
+
const syntheticChangeEvent = {
|
|
3270
|
+
...event,
|
|
3271
|
+
target: event.target,
|
|
3272
|
+
currentTarget: event.currentTarget
|
|
3273
|
+
};
|
|
3274
|
+
otherProps.onChange?.(syntheticChangeEvent);
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
customOnBlur?.(event);
|
|
3278
|
+
};
|
|
3258
3279
|
const forwardedProps = {
|
|
3259
3280
|
...rest,
|
|
3281
|
+
onChange: handleChange,
|
|
3260
3282
|
onFocus: (e) => {
|
|
3261
3283
|
const el = e.currentTarget;
|
|
3262
3284
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
@@ -3264,16 +3286,9 @@ var NumberField = forwardRef35((props, ref) => {
|
|
|
3264
3286
|
el.addEventListener("wheel", wheelHandler, { passive: false });
|
|
3265
3287
|
customOnFocus?.(e);
|
|
3266
3288
|
},
|
|
3267
|
-
onBlur: (e) =>
|
|
3268
|
-
const el = e.currentTarget;
|
|
3269
|
-
el.removeEventListener("wheel", wheelHandler);
|
|
3270
|
-
if (focusedInputRef.current === el) {
|
|
3271
|
-
focusedInputRef.current = null;
|
|
3272
|
-
}
|
|
3273
|
-
customOnBlur?.(e);
|
|
3274
|
-
}
|
|
3289
|
+
onBlur: (e) => handleBlur(e)
|
|
3275
3290
|
};
|
|
3276
|
-
return /* @__PURE__ */
|
|
3291
|
+
return /* @__PURE__ */ jsx44(
|
|
3277
3292
|
TextField,
|
|
3278
3293
|
{
|
|
3279
3294
|
...forwardedProps,
|
|
@@ -3291,28 +3306,28 @@ var NumberField = forwardRef35((props, ref) => {
|
|
|
3291
3306
|
NumberField.displayName = "NumberField";
|
|
3292
3307
|
|
|
3293
3308
|
// src/components/Option/Option.tsx
|
|
3294
|
-
import { forwardRef as
|
|
3295
|
-
import { jsx as
|
|
3296
|
-
var Option2 =
|
|
3309
|
+
import { forwardRef as forwardRef35 } from "react";
|
|
3310
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3311
|
+
var Option2 = forwardRef35((props, ref) => {
|
|
3297
3312
|
const { isDisabled, ...rest } = props;
|
|
3298
3313
|
const mappedProps = {
|
|
3299
3314
|
...rest,
|
|
3300
3315
|
disabled: isDisabled
|
|
3301
3316
|
};
|
|
3302
|
-
return /* @__PURE__ */
|
|
3317
|
+
return /* @__PURE__ */ jsx45("option", { ...mappedProps, ref });
|
|
3303
3318
|
});
|
|
3304
3319
|
Option2.displayName = "Option";
|
|
3305
3320
|
|
|
3306
3321
|
// src/components/PasswordField/PasswordField.tsx
|
|
3307
|
-
import
|
|
3308
|
-
import { forwardRef as
|
|
3322
|
+
import classNames38 from "classnames/dedupe";
|
|
3323
|
+
import { forwardRef as forwardRef36, useState as useState18, useRef as useRef14 } from "react";
|
|
3309
3324
|
|
|
3310
3325
|
// src/components/PasswordField/ShowHideButton.tsx
|
|
3311
|
-
import { jsx as
|
|
3326
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3312
3327
|
var ShowHideButton = ({
|
|
3313
3328
|
show = false,
|
|
3314
3329
|
onClick
|
|
3315
|
-
}) => /* @__PURE__ */
|
|
3330
|
+
}) => /* @__PURE__ */ jsx46(
|
|
3316
3331
|
"button",
|
|
3317
3332
|
{
|
|
3318
3333
|
className: "mobius-password-field__show-button",
|
|
@@ -3328,25 +3343,25 @@ var ShowHideButton = ({
|
|
|
3328
3343
|
);
|
|
3329
3344
|
|
|
3330
3345
|
// src/components/PasswordField/PasswordField.tsx
|
|
3331
|
-
import { jsx as
|
|
3332
|
-
var PasswordField =
|
|
3346
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3347
|
+
var PasswordField = forwardRef36(
|
|
3333
3348
|
({ className, ...props }, ref) => {
|
|
3334
3349
|
const [show, setShow] = useState18(false);
|
|
3335
3350
|
const type = show ? "text" : "password";
|
|
3336
|
-
const classes =
|
|
3351
|
+
const classes = classNames38("mobius-password-field", className);
|
|
3337
3352
|
const localRef = useRef14(null);
|
|
3338
3353
|
const handleShowHideButtonClick = () => {
|
|
3339
3354
|
setShow((oldShow) => !oldShow);
|
|
3340
3355
|
localRef.current?.focus();
|
|
3341
3356
|
};
|
|
3342
|
-
return /* @__PURE__ */
|
|
3357
|
+
return /* @__PURE__ */ jsx47(
|
|
3343
3358
|
TextField,
|
|
3344
3359
|
{
|
|
3345
3360
|
ref: mergeRefs([localRef, ref]),
|
|
3346
3361
|
className: classes,
|
|
3347
3362
|
...props,
|
|
3348
3363
|
type,
|
|
3349
|
-
suffixInside: /* @__PURE__ */
|
|
3364
|
+
suffixInside: /* @__PURE__ */ jsx47(ShowHideButton, { onClick: handleShowHideButtonClick, show })
|
|
3350
3365
|
}
|
|
3351
3366
|
);
|
|
3352
3367
|
}
|
|
@@ -3366,9 +3381,9 @@ import {
|
|
|
3366
3381
|
useInteractions
|
|
3367
3382
|
} from "@floating-ui/react";
|
|
3368
3383
|
import { cross as cross3 } from "@simplybusiness/icons";
|
|
3369
|
-
import
|
|
3384
|
+
import classNames39 from "classnames";
|
|
3370
3385
|
import { cloneElement as cloneElement9, useRef as useRef15, useState as useState19 } from "react";
|
|
3371
|
-
import { Fragment as Fragment3, jsx as
|
|
3386
|
+
import { Fragment as Fragment3, jsx as jsx48, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3372
3387
|
var OFFSET_FROM_CONTENT_DEFAULT = 10;
|
|
3373
3388
|
var Popover = (props) => {
|
|
3374
3389
|
const { trigger, children, onOpen, onClose, className } = props;
|
|
@@ -3399,7 +3414,7 @@ var Popover = (props) => {
|
|
|
3399
3414
|
}
|
|
3400
3415
|
});
|
|
3401
3416
|
const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);
|
|
3402
|
-
const containerClasses =
|
|
3417
|
+
const containerClasses = classNames39(
|
|
3403
3418
|
"mobius",
|
|
3404
3419
|
"mobius-popover__container",
|
|
3405
3420
|
className
|
|
@@ -3415,7 +3430,7 @@ var Popover = (props) => {
|
|
|
3415
3430
|
};
|
|
3416
3431
|
const triggerComponent = cloneElement9(trigger, {
|
|
3417
3432
|
ref: refs.setReference,
|
|
3418
|
-
className:
|
|
3433
|
+
className: classNames39(
|
|
3419
3434
|
trigger.props.className,
|
|
3420
3435
|
"mobius-popover__toggle"
|
|
3421
3436
|
),
|
|
@@ -3440,7 +3455,7 @@ var Popover = (props) => {
|
|
|
3440
3455
|
...getFloatingProps(),
|
|
3441
3456
|
children: [
|
|
3442
3457
|
/* @__PURE__ */ jsxs22("div", { className: "mobius-popover", children: [
|
|
3443
|
-
/* @__PURE__ */
|
|
3458
|
+
/* @__PURE__ */ jsx48("header", { className: "mobius-popover__header", children: /* @__PURE__ */ jsx48(
|
|
3444
3459
|
Button,
|
|
3445
3460
|
{
|
|
3446
3461
|
type: "button",
|
|
@@ -3448,7 +3463,7 @@ var Popover = (props) => {
|
|
|
3448
3463
|
onClick: toggleVisibility,
|
|
3449
3464
|
"aria-label": "Close",
|
|
3450
3465
|
variant: "ghost",
|
|
3451
|
-
children: /* @__PURE__ */
|
|
3466
|
+
children: /* @__PURE__ */ jsx48(
|
|
3452
3467
|
Icon,
|
|
3453
3468
|
{
|
|
3454
3469
|
icon: cross3,
|
|
@@ -3458,9 +3473,9 @@ var Popover = (props) => {
|
|
|
3458
3473
|
)
|
|
3459
3474
|
}
|
|
3460
3475
|
) }),
|
|
3461
|
-
/* @__PURE__ */
|
|
3476
|
+
/* @__PURE__ */ jsx48("div", { className: "mobius-popover__body", children })
|
|
3462
3477
|
] }),
|
|
3463
|
-
/* @__PURE__ */
|
|
3478
|
+
/* @__PURE__ */ jsx48(
|
|
3464
3479
|
FloatingArrow,
|
|
3465
3480
|
{
|
|
3466
3481
|
ref: arrowRef,
|
|
@@ -3476,9 +3491,9 @@ var Popover = (props) => {
|
|
|
3476
3491
|
};
|
|
3477
3492
|
|
|
3478
3493
|
// src/components/Progress/Progress.tsx
|
|
3479
|
-
import
|
|
3480
|
-
import { forwardRef as
|
|
3481
|
-
import { jsx as
|
|
3494
|
+
import classNames40 from "classnames/dedupe";
|
|
3495
|
+
import { forwardRef as forwardRef37, useId as useId9 } from "react";
|
|
3496
|
+
import { jsx as jsx49, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3482
3497
|
function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
3483
3498
|
if (minValue > maxValue) {
|
|
3484
3499
|
console.warn("minValue is greater than maxValue");
|
|
@@ -3496,7 +3511,7 @@ var sanitizedValue = (value, defaultValue) => {
|
|
|
3496
3511
|
};
|
|
3497
3512
|
var getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
3498
3513
|
if (showLabel) {
|
|
3499
|
-
return /* @__PURE__ */
|
|
3514
|
+
return /* @__PURE__ */ jsx49(
|
|
3500
3515
|
Label,
|
|
3501
3516
|
{
|
|
3502
3517
|
id: progressLabelId,
|
|
@@ -3506,7 +3521,7 @@ var getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
|
3506
3521
|
}
|
|
3507
3522
|
);
|
|
3508
3523
|
}
|
|
3509
|
-
return /* @__PURE__ */
|
|
3524
|
+
return /* @__PURE__ */ jsx49(VisuallyHidden, { children: /* @__PURE__ */ jsx49(
|
|
3510
3525
|
Label,
|
|
3511
3526
|
{
|
|
3512
3527
|
id: progressLabelId,
|
|
@@ -3519,7 +3534,7 @@ var getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
|
3519
3534
|
var DEFAULT_VALUE = 0;
|
|
3520
3535
|
var DEFAULT_MIN_VALUE = 0;
|
|
3521
3536
|
var DEFAULT_MAX_VALUE = 100;
|
|
3522
|
-
var Progress =
|
|
3537
|
+
var Progress = forwardRef37((props, ref) => {
|
|
3523
3538
|
const progressId = useId9();
|
|
3524
3539
|
const progressLabelId = useId9();
|
|
3525
3540
|
const {
|
|
@@ -3546,7 +3561,7 @@ var Progress = forwardRef38((props, ref) => {
|
|
|
3546
3561
|
100
|
|
3547
3562
|
);
|
|
3548
3563
|
const barWidth = `${percentage}%`;
|
|
3549
|
-
const classes =
|
|
3564
|
+
const classes = classNames40("mobius", "mobius-progress", className, {
|
|
3550
3565
|
"--is-primary": variant === "primary",
|
|
3551
3566
|
"--is-secondary": variant === "secondary"
|
|
3552
3567
|
});
|
|
@@ -3567,8 +3582,8 @@ var Progress = forwardRef38((props, ref) => {
|
|
|
3567
3582
|
"aria-labelledby": progressLabelId,
|
|
3568
3583
|
children: [
|
|
3569
3584
|
labelComponent,
|
|
3570
|
-
/* @__PURE__ */
|
|
3571
|
-
showValueLabel && /* @__PURE__ */
|
|
3585
|
+
/* @__PURE__ */ jsx49("div", { className: "mobius-progress__track", children: /* @__PURE__ */ jsx49("div", { className: "mobius-progress__bar", style: { width: barWidth } }) }),
|
|
3586
|
+
showValueLabel && /* @__PURE__ */ jsx49(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
|
|
3572
3587
|
]
|
|
3573
3588
|
}
|
|
3574
3589
|
);
|
|
@@ -3576,10 +3591,10 @@ var Progress = forwardRef38((props, ref) => {
|
|
|
3576
3591
|
Progress.displayName = "Progress";
|
|
3577
3592
|
|
|
3578
3593
|
// src/components/Radio/Radio.tsx
|
|
3579
|
-
import
|
|
3580
|
-
import { Children as Children7, forwardRef as
|
|
3581
|
-
import { Fragment as Fragment4, jsx as
|
|
3582
|
-
var Radio =
|
|
3594
|
+
import classNames41 from "classnames/dedupe";
|
|
3595
|
+
import { Children as Children7, forwardRef as forwardRef38, isValidElement as isValidElement5, useMemo as useMemo3 } from "react";
|
|
3596
|
+
import { Fragment as Fragment4, jsx as jsx50, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3597
|
+
var Radio = forwardRef38(
|
|
3583
3598
|
(props, ref) => {
|
|
3584
3599
|
const {
|
|
3585
3600
|
children,
|
|
@@ -3614,13 +3629,13 @@ var Radio = forwardRef39(
|
|
|
3614
3629
|
"--is-multiline": !!isMultiline,
|
|
3615
3630
|
"--is-required": isRequired
|
|
3616
3631
|
};
|
|
3617
|
-
const containerClasses =
|
|
3632
|
+
const containerClasses = classNames41(
|
|
3618
3633
|
"mobius-radio__label",
|
|
3619
3634
|
radioClasses,
|
|
3620
3635
|
className,
|
|
3621
3636
|
{ "--has-icon-first": hasIconFirst }
|
|
3622
3637
|
);
|
|
3623
|
-
const inputClasses =
|
|
3638
|
+
const inputClasses = classNames41("mobius-radio__input", radioClasses);
|
|
3624
3639
|
const {
|
|
3625
3640
|
// @ts-expect-error - TS doesn't like the orientation prop
|
|
3626
3641
|
orientation,
|
|
@@ -3641,7 +3656,7 @@ var Radio = forwardRef39(
|
|
|
3641
3656
|
};
|
|
3642
3657
|
return /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
3643
3658
|
/* @__PURE__ */ jsxs24(Label, { className: containerClasses, children: [
|
|
3644
|
-
/* @__PURE__ */
|
|
3659
|
+
/* @__PURE__ */ jsx50(
|
|
3645
3660
|
"input",
|
|
3646
3661
|
{
|
|
3647
3662
|
"aria-describedby": otherProps["aria-describedby"],
|
|
@@ -3659,28 +3674,28 @@ var Radio = forwardRef39(
|
|
|
3659
3674
|
}
|
|
3660
3675
|
),
|
|
3661
3676
|
isMultiline ? /* @__PURE__ */ jsxs24("div", { className: "mobius-radio__content--multiline", children: [
|
|
3662
|
-
/* @__PURE__ */
|
|
3663
|
-
/* @__PURE__ */
|
|
3664
|
-
] }) : /* @__PURE__ */
|
|
3677
|
+
/* @__PURE__ */ jsx50("div", { className: "mobius-radio__content-first-line", children: label }),
|
|
3678
|
+
/* @__PURE__ */ jsx50("div", { className: "mobius-radio__extra-content", children })
|
|
3679
|
+
] }) : /* @__PURE__ */ jsx50("div", { className: "mobius-radio__content", children: label || children })
|
|
3665
3680
|
] }),
|
|
3666
|
-
errorMessage && /* @__PURE__ */
|
|
3681
|
+
errorMessage && /* @__PURE__ */ jsx50(ErrorMessage, { errorMessage })
|
|
3667
3682
|
] });
|
|
3668
3683
|
}
|
|
3669
3684
|
);
|
|
3670
3685
|
Radio.displayName = "Radio";
|
|
3671
3686
|
|
|
3672
3687
|
// src/components/Radio/RadioGroup.tsx
|
|
3673
|
-
import
|
|
3688
|
+
import classNames42 from "classnames/dedupe";
|
|
3674
3689
|
import {
|
|
3675
3690
|
Children as Children8,
|
|
3676
3691
|
cloneElement as cloneElement10,
|
|
3677
|
-
forwardRef as
|
|
3692
|
+
forwardRef as forwardRef39,
|
|
3678
3693
|
isValidElement as isValidElement6,
|
|
3679
3694
|
useEffect as useEffect22,
|
|
3680
3695
|
useId as useId10,
|
|
3681
3696
|
useState as useState20
|
|
3682
3697
|
} from "react";
|
|
3683
|
-
import { jsx as
|
|
3698
|
+
import { jsx as jsx51, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3684
3699
|
var getDefaultVal = (children, defaultValue) => {
|
|
3685
3700
|
if (Array.isArray(children) && defaultValue) {
|
|
3686
3701
|
const option = children?.find((item) => item.props.value === defaultValue);
|
|
@@ -3689,7 +3704,7 @@ var getDefaultVal = (children, defaultValue) => {
|
|
|
3689
3704
|
}
|
|
3690
3705
|
return "";
|
|
3691
3706
|
};
|
|
3692
|
-
var RadioGroup =
|
|
3707
|
+
var RadioGroup = forwardRef39((props, ref) => {
|
|
3693
3708
|
const {
|
|
3694
3709
|
label,
|
|
3695
3710
|
isDisabled = false,
|
|
@@ -3725,16 +3740,16 @@ var RadioGroup = forwardRef40((props, ref) => {
|
|
|
3725
3740
|
[`--is-${orientation}`]: true,
|
|
3726
3741
|
[className || ""]: true
|
|
3727
3742
|
};
|
|
3728
|
-
const radioGroupClasses =
|
|
3743
|
+
const radioGroupClasses = classNames42(
|
|
3729
3744
|
"mobius",
|
|
3730
3745
|
"mobius-radio-group",
|
|
3731
3746
|
radioClasses,
|
|
3732
3747
|
validationClasses
|
|
3733
3748
|
);
|
|
3734
|
-
const radioWrapperClasses =
|
|
3749
|
+
const radioWrapperClasses = classNames42("mobius-radio__wrapper", {
|
|
3735
3750
|
[`--is-${orientation}`]: true
|
|
3736
3751
|
});
|
|
3737
|
-
const labelClasses =
|
|
3752
|
+
const labelClasses = classNames42(radioClasses, validationClasses);
|
|
3738
3753
|
const errorMessageId = useId10();
|
|
3739
3754
|
const defaultNameAttrId = useId10();
|
|
3740
3755
|
const nameAttribute = name || defaultNameAttrId;
|
|
@@ -3744,7 +3759,7 @@ var RadioGroup = forwardRef40((props, ref) => {
|
|
|
3744
3759
|
props["aria-describedby"]
|
|
3745
3760
|
]);
|
|
3746
3761
|
const labelId = useId10();
|
|
3747
|
-
return /* @__PURE__ */
|
|
3762
|
+
return /* @__PURE__ */ jsx51(
|
|
3748
3763
|
"div",
|
|
3749
3764
|
{
|
|
3750
3765
|
...rest,
|
|
@@ -3761,8 +3776,8 @@ var RadioGroup = forwardRef40((props, ref) => {
|
|
|
3761
3776
|
className: radioGroupClasses,
|
|
3762
3777
|
role: "radiogroup",
|
|
3763
3778
|
children: /* @__PURE__ */ jsxs25(Stack, { gap: "xs", children: [
|
|
3764
|
-
label && /* @__PURE__ */
|
|
3765
|
-
/* @__PURE__ */
|
|
3779
|
+
label && /* @__PURE__ */ jsx51(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
3780
|
+
/* @__PURE__ */ jsx51("div", { className: radioWrapperClasses, children: Children8.map(children, (child) => {
|
|
3766
3781
|
if (isValidElement6(child)) {
|
|
3767
3782
|
return cloneElement10(
|
|
3768
3783
|
child,
|
|
@@ -3781,7 +3796,7 @@ var RadioGroup = forwardRef40((props, ref) => {
|
|
|
3781
3796
|
}
|
|
3782
3797
|
return child;
|
|
3783
3798
|
}) }),
|
|
3784
|
-
/* @__PURE__ */
|
|
3799
|
+
/* @__PURE__ */ jsx51(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
3785
3800
|
] })
|
|
3786
3801
|
}
|
|
3787
3802
|
);
|
|
@@ -3789,28 +3804,28 @@ var RadioGroup = forwardRef40((props, ref) => {
|
|
|
3789
3804
|
RadioGroup.displayName = "RadioGroup";
|
|
3790
3805
|
|
|
3791
3806
|
// src/components/Segment/SegmentGroup.tsx
|
|
3792
|
-
import
|
|
3793
|
-
import { jsx as
|
|
3807
|
+
import classNames43 from "classnames/dedupe";
|
|
3808
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3794
3809
|
var SegmentGroup = (props) => {
|
|
3795
3810
|
const { children, horizontal, gap, className, ...rest } = props;
|
|
3796
3811
|
const gapClass = gap ? `gap-${gap}` : "";
|
|
3797
|
-
const classes =
|
|
3812
|
+
const classes = classNames43(
|
|
3798
3813
|
"mobius",
|
|
3799
3814
|
"mobius-segment-group",
|
|
3800
3815
|
className,
|
|
3801
3816
|
{ "--is-horizontal": horizontal },
|
|
3802
3817
|
gapClass
|
|
3803
3818
|
);
|
|
3804
|
-
return /* @__PURE__ */
|
|
3819
|
+
return /* @__PURE__ */ jsx52("div", { className: classes, ...rest, children });
|
|
3805
3820
|
};
|
|
3806
3821
|
SegmentGroup.displayName = "SegmentGroup";
|
|
3807
3822
|
|
|
3808
3823
|
// src/components/Segment/Segment.tsx
|
|
3809
|
-
import
|
|
3810
|
-
import { jsx as
|
|
3824
|
+
import classNames44 from "classnames/dedupe";
|
|
3825
|
+
import { jsx as jsx53, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3811
3826
|
var Segment = (props) => {
|
|
3812
3827
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
3813
|
-
const classes =
|
|
3828
|
+
const classes = classNames44(
|
|
3814
3829
|
"mobius",
|
|
3815
3830
|
"mobius-segment",
|
|
3816
3831
|
colour,
|
|
@@ -3818,7 +3833,7 @@ var Segment = (props) => {
|
|
|
3818
3833
|
className
|
|
3819
3834
|
);
|
|
3820
3835
|
return /* @__PURE__ */ jsxs26("div", { className: classes, ...rest, children: [
|
|
3821
|
-
heading && /* @__PURE__ */
|
|
3836
|
+
heading && /* @__PURE__ */ jsx53("div", { className: "mobius-segment__heading", children: heading }),
|
|
3822
3837
|
children
|
|
3823
3838
|
] });
|
|
3824
3839
|
};
|
|
@@ -3826,10 +3841,10 @@ Segment.displayName = "Segment";
|
|
|
3826
3841
|
|
|
3827
3842
|
// src/components/Select/Select.tsx
|
|
3828
3843
|
import { chevronDown as chevronDown2 } from "@simplybusiness/icons";
|
|
3829
|
-
import
|
|
3830
|
-
import { forwardRef as
|
|
3831
|
-
import { jsx as
|
|
3832
|
-
var Select =
|
|
3844
|
+
import classNames45 from "classnames/dedupe";
|
|
3845
|
+
import { forwardRef as forwardRef40, useId as useId11 } from "react";
|
|
3846
|
+
import { jsx as jsx54, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3847
|
+
var Select = forwardRef40((props, ref) => {
|
|
3833
3848
|
const {
|
|
3834
3849
|
label,
|
|
3835
3850
|
onChange,
|
|
@@ -3853,23 +3868,23 @@ var Select = forwardRef41((props, ref) => {
|
|
|
3853
3868
|
"--is-required": typeof isRequired === "boolean" && isRequired,
|
|
3854
3869
|
"--is-optional": typeof isRequired === "boolean" && !isRequired
|
|
3855
3870
|
};
|
|
3856
|
-
const sharedClasses =
|
|
3857
|
-
const wrapperClasses =
|
|
3871
|
+
const sharedClasses = classNames45(validationClasses, stateClasses);
|
|
3872
|
+
const wrapperClasses = classNames45(
|
|
3858
3873
|
"mobius-select__wrapper",
|
|
3859
3874
|
sharedClasses,
|
|
3860
3875
|
otherProps.className
|
|
3861
3876
|
);
|
|
3862
|
-
const selectClasses =
|
|
3877
|
+
const selectClasses = classNames45(
|
|
3863
3878
|
"mobius-select",
|
|
3864
3879
|
sharedClasses,
|
|
3865
3880
|
otherProps.className
|
|
3866
3881
|
);
|
|
3867
|
-
const labelClasses =
|
|
3882
|
+
const labelClasses = classNames45(
|
|
3868
3883
|
"mobius-label",
|
|
3869
3884
|
sharedClasses,
|
|
3870
3885
|
otherProps.className
|
|
3871
3886
|
);
|
|
3872
|
-
const iconClasses =
|
|
3887
|
+
const iconClasses = classNames45("mobius-select__icon", sharedClasses);
|
|
3873
3888
|
const errorMessageId = useId11();
|
|
3874
3889
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
3875
3890
|
const describedBy = spaceDelimitedList([
|
|
@@ -3882,9 +3897,9 @@ var Select = forwardRef41((props, ref) => {
|
|
|
3882
3897
|
}
|
|
3883
3898
|
};
|
|
3884
3899
|
return /* @__PURE__ */ jsxs27(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
|
|
3885
|
-
label && /* @__PURE__ */
|
|
3900
|
+
label && /* @__PURE__ */ jsx54(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
3886
3901
|
/* @__PURE__ */ jsxs27("div", { className: wrapperClasses, children: [
|
|
3887
|
-
/* @__PURE__ */
|
|
3902
|
+
/* @__PURE__ */ jsx54(
|
|
3888
3903
|
"select",
|
|
3889
3904
|
{
|
|
3890
3905
|
...otherProps,
|
|
@@ -3900,15 +3915,15 @@ var Select = forwardRef41((props, ref) => {
|
|
|
3900
3915
|
onChange: handleChange
|
|
3901
3916
|
}
|
|
3902
3917
|
),
|
|
3903
|
-
/* @__PURE__ */
|
|
3918
|
+
/* @__PURE__ */ jsx54("span", { className: iconClasses, children: /* @__PURE__ */ jsx54(Icon, { icon: chevronDown2 }) })
|
|
3904
3919
|
] }),
|
|
3905
|
-
errorMessage && /* @__PURE__ */
|
|
3920
|
+
errorMessage && /* @__PURE__ */ jsx54(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
3906
3921
|
] });
|
|
3907
3922
|
});
|
|
3908
3923
|
Select.displayName = "Select";
|
|
3909
3924
|
|
|
3910
3925
|
// src/components/Slider/Slider.tsx
|
|
3911
|
-
import
|
|
3926
|
+
import classNames46 from "classnames/dedupe";
|
|
3912
3927
|
import { useRef as useRef16, useState as useState21 } from "react";
|
|
3913
3928
|
|
|
3914
3929
|
// src/components/Slider/helpers.ts
|
|
@@ -3921,7 +3936,7 @@ function numberFormatter(value, formatOptions, locale = navigator.languages?.[0]
|
|
|
3921
3936
|
}
|
|
3922
3937
|
|
|
3923
3938
|
// src/components/Slider/Slider.tsx
|
|
3924
|
-
import { jsx as
|
|
3939
|
+
import { jsx as jsx55, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3925
3940
|
var Slider = (props) => {
|
|
3926
3941
|
const {
|
|
3927
3942
|
id,
|
|
@@ -3954,7 +3969,7 @@ var Slider = (props) => {
|
|
|
3954
3969
|
"aria-labelledby": ariaLabelledBy
|
|
3955
3970
|
});
|
|
3956
3971
|
const formattedValue = numberFormatter(currentValue, formatOptions);
|
|
3957
|
-
const classes =
|
|
3972
|
+
const classes = classNames46("mobius", "mobius-slider", className, {
|
|
3958
3973
|
"--is-disabled": isDisabled,
|
|
3959
3974
|
"--is-primary": variant === "primary",
|
|
3960
3975
|
"--is-secondary": variant === "secondary",
|
|
@@ -3978,10 +3993,10 @@ var Slider = (props) => {
|
|
|
3978
3993
|
};
|
|
3979
3994
|
return /* @__PURE__ */ jsxs28("div", { className: classes, children: [
|
|
3980
3995
|
/* @__PURE__ */ jsxs28("div", { className: "mobius-slider__label-wrapper", children: [
|
|
3981
|
-
label && /* @__PURE__ */
|
|
3982
|
-
label && /* @__PURE__ */
|
|
3996
|
+
label && /* @__PURE__ */ jsx55(Label, { ...labelProps, children: label }),
|
|
3997
|
+
label && /* @__PURE__ */ jsx55("output", { style: { flex: "1 0 auto", textAlign: "end" }, children: formattedValue })
|
|
3983
3998
|
] }),
|
|
3984
|
-
/* @__PURE__ */
|
|
3999
|
+
/* @__PURE__ */ jsx55("div", { ref: trackRef, className: "mobius-slider__track-wrapper", children: /* @__PURE__ */ jsx55(
|
|
3985
4000
|
"input",
|
|
3986
4001
|
{
|
|
3987
4002
|
className: "mobius-slider__track",
|
|
@@ -4001,23 +4016,23 @@ var Slider = (props) => {
|
|
|
4001
4016
|
}
|
|
4002
4017
|
) }),
|
|
4003
4018
|
/* @__PURE__ */ jsxs28("div", { className: "mobius-slider__labels", children: [
|
|
4004
|
-
/* @__PURE__ */
|
|
4005
|
-
/* @__PURE__ */
|
|
4019
|
+
/* @__PURE__ */ jsx55("div", { className: "mobius-slider__min-label", "data-testid": "min-label", children: minLabel }),
|
|
4020
|
+
/* @__PURE__ */ jsx55("div", { className: "mobius-slider__max-label", "data-testid": "max-label", children: maxLabel })
|
|
4006
4021
|
] })
|
|
4007
4022
|
] });
|
|
4008
4023
|
};
|
|
4009
4024
|
|
|
4010
4025
|
// src/components/SVG/SVG.tsx
|
|
4011
|
-
import { forwardRef as
|
|
4012
|
-
import
|
|
4013
|
-
import { jsx as
|
|
4014
|
-
var SVG =
|
|
4026
|
+
import { forwardRef as forwardRef41, Children as Children9 } from "react";
|
|
4027
|
+
import classNames47 from "classnames/dedupe";
|
|
4028
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
4029
|
+
var SVG = forwardRef41(
|
|
4015
4030
|
(props, ref) => {
|
|
4016
4031
|
const { children, className, ...otherProps } = props;
|
|
4017
|
-
const classes =
|
|
4032
|
+
const classes = classNames47("mobius", "mobius-svg", className);
|
|
4018
4033
|
const svgNode = Children9.only(children);
|
|
4019
4034
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
4020
|
-
return /* @__PURE__ */
|
|
4035
|
+
return /* @__PURE__ */ jsx56(
|
|
4021
4036
|
"svg",
|
|
4022
4037
|
{
|
|
4023
4038
|
viewBox,
|
|
@@ -4034,13 +4049,13 @@ SVG.displayName = "SVG";
|
|
|
4034
4049
|
|
|
4035
4050
|
// src/components/Switch/Switch.tsx
|
|
4036
4051
|
import {
|
|
4037
|
-
forwardRef as
|
|
4052
|
+
forwardRef as forwardRef42,
|
|
4038
4053
|
useState as useState22,
|
|
4039
4054
|
useEffect as useEffect23
|
|
4040
4055
|
} from "react";
|
|
4041
|
-
import
|
|
4042
|
-
import { jsx as
|
|
4043
|
-
var Switch =
|
|
4056
|
+
import classNames48 from "classnames/dedupe";
|
|
4057
|
+
import { jsx as jsx57, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4058
|
+
var Switch = forwardRef42((props, ref) => {
|
|
4044
4059
|
const {
|
|
4045
4060
|
checked = false,
|
|
4046
4061
|
className,
|
|
@@ -4052,7 +4067,7 @@ var Switch = forwardRef43((props, ref) => {
|
|
|
4052
4067
|
useEffect23(() => {
|
|
4053
4068
|
setEnabled(checked);
|
|
4054
4069
|
}, [checked]);
|
|
4055
|
-
const classes =
|
|
4070
|
+
const classes = classNames48(
|
|
4056
4071
|
"mobius",
|
|
4057
4072
|
"mobius-switch",
|
|
4058
4073
|
{
|
|
@@ -4068,8 +4083,8 @@ var Switch = forwardRef43((props, ref) => {
|
|
|
4068
4083
|
}
|
|
4069
4084
|
};
|
|
4070
4085
|
return /* @__PURE__ */ jsxs29("label", { ref, className: classes, children: [
|
|
4071
|
-
/* @__PURE__ */
|
|
4072
|
-
/* @__PURE__ */
|
|
4086
|
+
/* @__PURE__ */ jsx57(VisuallyHidden, { children: /* @__PURE__ */ jsx57("span", { children: enabled ? "On" : "Off" }) }),
|
|
4087
|
+
/* @__PURE__ */ jsx57(
|
|
4073
4088
|
"input",
|
|
4074
4089
|
{
|
|
4075
4090
|
type: "checkbox",
|
|
@@ -4080,91 +4095,91 @@ var Switch = forwardRef43((props, ref) => {
|
|
|
4080
4095
|
...otherProps
|
|
4081
4096
|
}
|
|
4082
4097
|
),
|
|
4083
|
-
/* @__PURE__ */
|
|
4098
|
+
/* @__PURE__ */ jsx57("span", { className: "mobius-switch__slider" })
|
|
4084
4099
|
] });
|
|
4085
4100
|
});
|
|
4086
4101
|
Switch.displayName = "Switch";
|
|
4087
4102
|
|
|
4088
4103
|
// src/components/Table/Table.tsx
|
|
4089
|
-
import { forwardRef as
|
|
4090
|
-
import
|
|
4091
|
-
import { jsx as
|
|
4092
|
-
var Table =
|
|
4104
|
+
import { forwardRef as forwardRef43 } from "react";
|
|
4105
|
+
import classNames49 from "classnames/dedupe";
|
|
4106
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
4107
|
+
var Table = forwardRef43(
|
|
4093
4108
|
(props, ref) => {
|
|
4094
|
-
const classes =
|
|
4095
|
-
return /* @__PURE__ */
|
|
4109
|
+
const classes = classNames49("mobius", "mobius-table", props.className);
|
|
4110
|
+
return /* @__PURE__ */ jsx58("table", { ref, ...props, className: classes });
|
|
4096
4111
|
}
|
|
4097
4112
|
);
|
|
4098
4113
|
Table.displayName = "Table";
|
|
4099
4114
|
|
|
4100
4115
|
// src/components/Table/Head.tsx
|
|
4116
|
+
import { forwardRef as forwardRef44 } from "react";
|
|
4117
|
+
import classNames50 from "classnames/dedupe";
|
|
4118
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
4119
|
+
var Head = forwardRef44((props, ref) => {
|
|
4120
|
+
const classes = classNames50("mobius", "mobius-table__head", props.className);
|
|
4121
|
+
return /* @__PURE__ */ jsx59("thead", { ref, ...props, className: classes });
|
|
4122
|
+
});
|
|
4123
|
+
Head.displayName = "Table.Head";
|
|
4124
|
+
|
|
4125
|
+
// src/components/Table/Body.tsx
|
|
4101
4126
|
import { forwardRef as forwardRef45 } from "react";
|
|
4102
4127
|
import classNames51 from "classnames/dedupe";
|
|
4103
4128
|
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
4104
|
-
var
|
|
4105
|
-
const classes = classNames51("mobius", "mobius-
|
|
4106
|
-
return /* @__PURE__ */ jsx60("
|
|
4129
|
+
var Body = forwardRef45((props, ref) => {
|
|
4130
|
+
const classes = classNames51("mobius", "mobius-table__body", props.className);
|
|
4131
|
+
return /* @__PURE__ */ jsx60("tbody", { ref, ...props, className: classes });
|
|
4107
4132
|
});
|
|
4108
|
-
|
|
4133
|
+
Body.displayName = "Table.Body";
|
|
4109
4134
|
|
|
4110
|
-
// src/components/Table/
|
|
4135
|
+
// src/components/Table/Foot.tsx
|
|
4111
4136
|
import { forwardRef as forwardRef46 } from "react";
|
|
4112
4137
|
import classNames52 from "classnames/dedupe";
|
|
4113
4138
|
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
4114
|
-
var
|
|
4115
|
-
const classes = classNames52("mobius", "mobius-
|
|
4116
|
-
return /* @__PURE__ */ jsx61("
|
|
4139
|
+
var Foot = forwardRef46((props, ref) => {
|
|
4140
|
+
const classes = classNames52("mobius", "mobius-table__foot", props.className);
|
|
4141
|
+
return /* @__PURE__ */ jsx61("tfoot", { ref, ...props, className: classes });
|
|
4117
4142
|
});
|
|
4118
|
-
|
|
4143
|
+
Foot.displayName = "Table.Foot";
|
|
4119
4144
|
|
|
4120
|
-
// src/components/Table/
|
|
4145
|
+
// src/components/Table/Row.tsx
|
|
4121
4146
|
import { forwardRef as forwardRef47 } from "react";
|
|
4122
4147
|
import classNames53 from "classnames/dedupe";
|
|
4123
4148
|
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
4124
|
-
var
|
|
4125
|
-
const classes = classNames53("mobius", "mobius-table__foot", props.className);
|
|
4126
|
-
return /* @__PURE__ */ jsx62("tfoot", { ref, ...props, className: classes });
|
|
4127
|
-
});
|
|
4128
|
-
Foot.displayName = "Table.Foot";
|
|
4129
|
-
|
|
4130
|
-
// src/components/Table/Row.tsx
|
|
4131
|
-
import { forwardRef as forwardRef48 } from "react";
|
|
4132
|
-
import classNames54 from "classnames/dedupe";
|
|
4133
|
-
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
4134
|
-
var Row = forwardRef48(
|
|
4149
|
+
var Row = forwardRef47(
|
|
4135
4150
|
(props, ref) => {
|
|
4136
|
-
const classes =
|
|
4137
|
-
return /* @__PURE__ */
|
|
4151
|
+
const classes = classNames53("mobius", "mobius-table__row", props.className);
|
|
4152
|
+
return /* @__PURE__ */ jsx62("tr", { ref, ...props, className: classes });
|
|
4138
4153
|
}
|
|
4139
4154
|
);
|
|
4140
4155
|
Row.displayName = "Table.Row";
|
|
4141
4156
|
|
|
4142
4157
|
// src/components/Table/HeaderCell.tsx
|
|
4143
|
-
import { forwardRef as
|
|
4144
|
-
import
|
|
4145
|
-
import { jsx as
|
|
4146
|
-
var HeaderCell =
|
|
4147
|
-
const classes =
|
|
4158
|
+
import { forwardRef as forwardRef48 } from "react";
|
|
4159
|
+
import classNames54 from "classnames/dedupe";
|
|
4160
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
4161
|
+
var HeaderCell = forwardRef48((props, ref) => {
|
|
4162
|
+
const classes = classNames54(
|
|
4148
4163
|
"mobius",
|
|
4149
4164
|
"mobius-table__head-cell",
|
|
4150
4165
|
props.className
|
|
4151
4166
|
);
|
|
4152
|
-
return /* @__PURE__ */
|
|
4167
|
+
return /* @__PURE__ */ jsx63("th", { ...props, ref, className: classes });
|
|
4153
4168
|
});
|
|
4154
4169
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
4155
4170
|
|
|
4156
4171
|
// src/components/Table/Cell.tsx
|
|
4157
|
-
import { forwardRef as
|
|
4158
|
-
import
|
|
4159
|
-
import { jsx as
|
|
4160
|
-
var Cell =
|
|
4172
|
+
import { forwardRef as forwardRef49 } from "react";
|
|
4173
|
+
import classNames55 from "classnames/dedupe";
|
|
4174
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
4175
|
+
var Cell = forwardRef49(
|
|
4161
4176
|
(props, ref) => {
|
|
4162
|
-
const classes =
|
|
4177
|
+
const classes = classNames55(
|
|
4163
4178
|
"mobius",
|
|
4164
4179
|
"mobius-table__body-cell",
|
|
4165
4180
|
props.className
|
|
4166
4181
|
);
|
|
4167
|
-
return /* @__PURE__ */
|
|
4182
|
+
return /* @__PURE__ */ jsx64("td", { ref, ...props, className: classes });
|
|
4168
4183
|
}
|
|
4169
4184
|
);
|
|
4170
4185
|
Cell.displayName = "Table.Cell";
|
|
@@ -4180,6 +4195,33 @@ var Table2 = Object.assign(Table, {
|
|
|
4180
4195
|
});
|
|
4181
4196
|
Table2.displayName = "Table";
|
|
4182
4197
|
|
|
4198
|
+
// src/components/Text/Text.tsx
|
|
4199
|
+
import { forwardRef as forwardRef50 } from "react";
|
|
4200
|
+
import classNames56 from "classnames/dedupe";
|
|
4201
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
4202
|
+
var getElementType = (variant, elementType) => {
|
|
4203
|
+
if (variant) {
|
|
4204
|
+
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
4205
|
+
}
|
|
4206
|
+
return elementType || "p";
|
|
4207
|
+
};
|
|
4208
|
+
var Text = forwardRef50(
|
|
4209
|
+
({ elementType: Component = "p", ...props }, ref) => {
|
|
4210
|
+
const { variant, className, spacing, ...otherProps } = props;
|
|
4211
|
+
const elementType = getElementType(variant, Component);
|
|
4212
|
+
const variantType = variant || elementType;
|
|
4213
|
+
const classes = classNames56(
|
|
4214
|
+
"mobius",
|
|
4215
|
+
"mobius-text",
|
|
4216
|
+
{ [`--is-${variantType}`]: variantType },
|
|
4217
|
+
{ [`--has-line-height-${spacing}`]: spacing },
|
|
4218
|
+
className
|
|
4219
|
+
);
|
|
4220
|
+
return /* @__PURE__ */ jsx65(Component, { ref, ...otherProps, className: classes });
|
|
4221
|
+
}
|
|
4222
|
+
);
|
|
4223
|
+
Text.displayName = "Text";
|
|
4224
|
+
|
|
4183
4225
|
// src/components/TextArea/TextArea.tsx
|
|
4184
4226
|
import classNames58 from "classnames/dedupe";
|
|
4185
4227
|
import { forwardRef as forwardRef52 } from "react";
|
|
@@ -4259,11 +4301,38 @@ var TextArea = forwardRef52((props, ref) => {
|
|
|
4259
4301
|
});
|
|
4260
4302
|
TextArea.displayName = "TextArea";
|
|
4261
4303
|
|
|
4262
|
-
// src/components/
|
|
4304
|
+
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
4263
4305
|
import { forwardRef as forwardRef53 } from "react";
|
|
4306
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
4307
|
+
var TextOrHTML = forwardRef53(
|
|
4308
|
+
({
|
|
4309
|
+
text,
|
|
4310
|
+
htmlClassName,
|
|
4311
|
+
htmlElementType = "span",
|
|
4312
|
+
textWrapper = false,
|
|
4313
|
+
...textProps
|
|
4314
|
+
}, ref) => {
|
|
4315
|
+
const DangerousComponent = htmlElementType;
|
|
4316
|
+
const dangerousElement = /* @__PURE__ */ jsx68(
|
|
4317
|
+
DangerousComponent,
|
|
4318
|
+
{
|
|
4319
|
+
className: htmlClassName,
|
|
4320
|
+
dangerouslySetInnerHTML: { __html: text }
|
|
4321
|
+
}
|
|
4322
|
+
);
|
|
4323
|
+
if (textWrapper) {
|
|
4324
|
+
return /* @__PURE__ */ jsx68(Text, { ref, ...textProps, children: dangerousElement });
|
|
4325
|
+
}
|
|
4326
|
+
return dangerousElement;
|
|
4327
|
+
}
|
|
4328
|
+
);
|
|
4329
|
+
TextOrHTML.displayName = "TextOrHTML";
|
|
4330
|
+
|
|
4331
|
+
// src/components/Title/Title.tsx
|
|
4332
|
+
import { forwardRef as forwardRef54 } from "react";
|
|
4264
4333
|
import classNames59 from "classnames/dedupe";
|
|
4265
|
-
import { jsx as
|
|
4266
|
-
var Title =
|
|
4334
|
+
import { jsx as jsx69, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4335
|
+
var Title = forwardRef54(
|
|
4267
4336
|
(props, ref) => {
|
|
4268
4337
|
const {
|
|
4269
4338
|
elementType: Element = "div",
|
|
@@ -4275,9 +4344,9 @@ var Title = forwardRef53(
|
|
|
4275
4344
|
const headerClasses = classNames59("mobius", "mobius-title__header");
|
|
4276
4345
|
const contentClasses = classNames59("mobius", "mobius-title__description");
|
|
4277
4346
|
const containerClasses = classNames59("mobius", "mobius-title__container");
|
|
4278
|
-
return /* @__PURE__ */
|
|
4279
|
-
/* @__PURE__ */
|
|
4280
|
-
/* @__PURE__ */
|
|
4347
|
+
return /* @__PURE__ */ jsx69(Element, { ref, ...otherProps, className: classes, children: /* @__PURE__ */ jsxs31(Flex, { flexDirection: "column", className: containerClasses, children: [
|
|
4348
|
+
/* @__PURE__ */ jsx69("p", { className: headerClasses, children: title }),
|
|
4349
|
+
/* @__PURE__ */ jsx69("p", { className: contentClasses, children: description })
|
|
4281
4350
|
] }) });
|
|
4282
4351
|
}
|
|
4283
4352
|
);
|
|
@@ -4285,7 +4354,7 @@ Title.displayName = "Title";
|
|
|
4285
4354
|
|
|
4286
4355
|
// src/components/Trust/Trust.tsx
|
|
4287
4356
|
import classNames60 from "classnames/dedupe";
|
|
4288
|
-
import { forwardRef as
|
|
4357
|
+
import { forwardRef as forwardRef55, useEffect as useEffect24, useRef as useRef17, useState as useState23 } from "react";
|
|
4289
4358
|
|
|
4290
4359
|
// src/components/Trust/constants.ts
|
|
4291
4360
|
var REQUIRED_TRUSTPILOT_CLASS_NAME = "trustpilot-widget";
|
|
@@ -4343,8 +4412,8 @@ var TRUSTPILOT_WIDGET = {
|
|
|
4343
4412
|
};
|
|
4344
4413
|
|
|
4345
4414
|
// src/components/Trust/Trust.tsx
|
|
4346
|
-
import { jsx as
|
|
4347
|
-
var Trust =
|
|
4415
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
4416
|
+
var Trust = forwardRef55((props, ref) => {
|
|
4348
4417
|
const {
|
|
4349
4418
|
elementType: Element = "div",
|
|
4350
4419
|
variant,
|
|
@@ -4391,15 +4460,15 @@ var Trust = forwardRef54((props, ref) => {
|
|
|
4391
4460
|
useEffect24(() => {
|
|
4392
4461
|
setIsMounted(true);
|
|
4393
4462
|
}, []);
|
|
4394
|
-
if (!isMounted) return /* @__PURE__ */
|
|
4395
|
-
return /* @__PURE__ */
|
|
4463
|
+
if (!isMounted) return /* @__PURE__ */ jsx70("div", { style: styles });
|
|
4464
|
+
return /* @__PURE__ */ jsx70(
|
|
4396
4465
|
Element,
|
|
4397
4466
|
{
|
|
4398
4467
|
ref: mergeRefs([trustRef, ref]),
|
|
4399
4468
|
className: classes,
|
|
4400
4469
|
style: styles,
|
|
4401
4470
|
...dataProps,
|
|
4402
|
-
children: /* @__PURE__ */
|
|
4471
|
+
children: /* @__PURE__ */ jsx70(
|
|
4403
4472
|
"a",
|
|
4404
4473
|
{
|
|
4405
4474
|
href: link,
|
|
@@ -4414,10 +4483,10 @@ var Trust = forwardRef54((props, ref) => {
|
|
|
4414
4483
|
});
|
|
4415
4484
|
|
|
4416
4485
|
// src/components/ExpandableText/ExpandableText.tsx
|
|
4417
|
-
import { useState as useState24, useEffect as useEffect25, useRef as useRef18, forwardRef as forwardRef55, useId as useId12 } from "react";
|
|
4418
4486
|
import classNames61 from "classnames/dedupe";
|
|
4419
|
-
import {
|
|
4420
|
-
|
|
4487
|
+
import { forwardRef as forwardRef56, useEffect as useEffect25, useId as useId12, useRef as useRef18, useState as useState24 } from "react";
|
|
4488
|
+
import { jsx as jsx71, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4489
|
+
var ExpandableText = forwardRef56((props, ref) => {
|
|
4421
4490
|
const {
|
|
4422
4491
|
text,
|
|
4423
4492
|
maxLines = 3,
|
|
@@ -4447,7 +4516,7 @@ var ExpandableText = forwardRef55((props, ref) => {
|
|
|
4447
4516
|
setIsCollapsed(isOverflowing);
|
|
4448
4517
|
}, [text, shouldCollapse, maxLines]);
|
|
4449
4518
|
if (breakpoint && !shouldCollapse) {
|
|
4450
|
-
return /* @__PURE__ */
|
|
4519
|
+
return /* @__PURE__ */ jsx71("div", { ref, className, ...otherProps, children: /* @__PURE__ */ jsx71(TextOrHTML, { text, textWrapper: true, ...textProps }) });
|
|
4451
4520
|
}
|
|
4452
4521
|
const handleAccordionChange = (expanded) => {
|
|
4453
4522
|
setIsExpanded(expanded);
|
|
@@ -4468,7 +4537,7 @@ var ExpandableText = forwardRef55((props, ref) => {
|
|
|
4468
4537
|
"data-testid": "expandable-text",
|
|
4469
4538
|
...otherProps,
|
|
4470
4539
|
children: [
|
|
4471
|
-
/* @__PURE__ */
|
|
4540
|
+
/* @__PURE__ */ jsx71(
|
|
4472
4541
|
"div",
|
|
4473
4542
|
{
|
|
4474
4543
|
ref: textRef,
|
|
@@ -4476,10 +4545,10 @@ var ExpandableText = forwardRef55((props, ref) => {
|
|
|
4476
4545
|
style: textContainerStyle,
|
|
4477
4546
|
"data-testid": "expandable-text-content",
|
|
4478
4547
|
"aria-describedby": isCollapsed ? expandButtonId : void 0,
|
|
4479
|
-
children: /* @__PURE__ */
|
|
4548
|
+
children: /* @__PURE__ */ jsx71(TextOrHTML, { elementType: "span", textWrapper: true, text, ...textProps })
|
|
4480
4549
|
}
|
|
4481
4550
|
),
|
|
4482
|
-
isCollapsed && /* @__PURE__ */
|
|
4551
|
+
isCollapsed && /* @__PURE__ */ jsx71(
|
|
4483
4552
|
Accordion,
|
|
4484
4553
|
{
|
|
4485
4554
|
showText,
|
|
@@ -4500,9 +4569,9 @@ var ExpandableText = forwardRef55((props, ref) => {
|
|
|
4500
4569
|
ExpandableText.displayName = "ExpandableText";
|
|
4501
4570
|
|
|
4502
4571
|
// src/components/MaskedField/MaskedField.tsx
|
|
4503
|
-
import { forwardRef as
|
|
4572
|
+
import { forwardRef as forwardRef57, useCallback as useCallback7, useEffect as useEffect26 } from "react";
|
|
4504
4573
|
import { useIMask } from "react-imask";
|
|
4505
|
-
import { jsx as
|
|
4574
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
4506
4575
|
var useAcceptHandler = (onChange, useMaskedValue, name) => {
|
|
4507
4576
|
return useCallback7(
|
|
4508
4577
|
(maskedValue, maskInstance) => {
|
|
@@ -4574,7 +4643,7 @@ var ControlledMaskedField = ({
|
|
|
4574
4643
|
setValue(stringValue);
|
|
4575
4644
|
}
|
|
4576
4645
|
}, [value, maskRef, setValue, imaskRef]);
|
|
4577
|
-
return /* @__PURE__ */
|
|
4646
|
+
return /* @__PURE__ */ jsx72(
|
|
4578
4647
|
TextField,
|
|
4579
4648
|
{
|
|
4580
4649
|
...textFieldProps,
|
|
@@ -4598,7 +4667,7 @@ var UncontrolledMaskedField = ({
|
|
|
4598
4667
|
const { ref: imaskRef, maskRef } = useIMask(mask, { onAccept });
|
|
4599
4668
|
const combinedRef = useCombinedRef(imaskRef, forwardedRef);
|
|
4600
4669
|
const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
|
|
4601
|
-
return /* @__PURE__ */
|
|
4670
|
+
return /* @__PURE__ */ jsx72(
|
|
4602
4671
|
TextField,
|
|
4603
4672
|
{
|
|
4604
4673
|
...textFieldProps,
|
|
@@ -4609,10 +4678,10 @@ var UncontrolledMaskedField = ({
|
|
|
4609
4678
|
}
|
|
4610
4679
|
);
|
|
4611
4680
|
};
|
|
4612
|
-
var MaskedField =
|
|
4681
|
+
var MaskedField = forwardRef57((props, forwardedRef) => {
|
|
4613
4682
|
const { value, defaultValue, ...rest } = props;
|
|
4614
4683
|
if ("value" in props) {
|
|
4615
|
-
return /* @__PURE__ */
|
|
4684
|
+
return /* @__PURE__ */ jsx72(
|
|
4616
4685
|
ControlledMaskedField,
|
|
4617
4686
|
{
|
|
4618
4687
|
...rest,
|
|
@@ -4621,7 +4690,7 @@ var MaskedField = forwardRef56((props, forwardedRef) => {
|
|
|
4621
4690
|
}
|
|
4622
4691
|
);
|
|
4623
4692
|
} else {
|
|
4624
|
-
return /* @__PURE__ */
|
|
4693
|
+
return /* @__PURE__ */ jsx72(
|
|
4625
4694
|
UncontrolledMaskedField,
|
|
4626
4695
|
{
|
|
4627
4696
|
...rest,
|
|
@@ -4686,6 +4755,7 @@ export {
|
|
|
4686
4755
|
TextArea,
|
|
4687
4756
|
TextAreaInput,
|
|
4688
4757
|
TextField,
|
|
4758
|
+
TextOrHTML,
|
|
4689
4759
|
Title,
|
|
4690
4760
|
Trust,
|
|
4691
4761
|
VisuallyHidden,
|