@simplybusiness/mobius 10.1.1 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/components/AddressLookup/AddressLookup.js +540 -526
- package/dist/cjs/components/AddressLookup/AddressLookup.js.map +4 -4
- package/dist/cjs/components/AddressLookup/index.js +540 -526
- package/dist/cjs/components/AddressLookup/index.js.map +4 -4
- package/dist/cjs/components/Alert/Alert.js +79 -11
- package/dist/cjs/components/Alert/Alert.js.map +4 -4
- package/dist/cjs/components/Alert/index.js +79 -11
- package/dist/cjs/components/Alert/index.js.map +4 -4
- package/dist/cjs/components/Checkbox/Checkbox.js +506 -492
- package/dist/cjs/components/Checkbox/Checkbox.js.map +4 -4
- package/dist/cjs/components/Checkbox/CheckboxGroup.js +506 -492
- package/dist/cjs/components/Checkbox/CheckboxGroup.js.map +4 -4
- package/dist/cjs/components/Checkbox/index.js +485 -471
- package/dist/cjs/components/Checkbox/index.js.map +4 -4
- package/dist/cjs/components/Combobox/Combobox.js +540 -526
- package/dist/cjs/components/Combobox/Combobox.js.map +4 -4
- package/dist/cjs/components/Combobox/index.js +540 -526
- package/dist/cjs/components/Combobox/index.js.map +4 -4
- package/dist/cjs/components/DateField/DateField.js +527 -513
- package/dist/cjs/components/DateField/DateField.js.map +4 -4
- package/dist/cjs/components/DateField/index.js +527 -513
- package/dist/cjs/components/DateField/index.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js +527 -513
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/index.js +527 -513
- package/dist/cjs/components/ErrorMessage/index.js.map +4 -4
- package/dist/cjs/components/ExpandableText/ExpandableText.js +527 -513
- package/dist/cjs/components/ExpandableText/ExpandableText.js.map +4 -4
- package/dist/cjs/components/ExpandableText/index.js +527 -513
- package/dist/cjs/components/ExpandableText/index.js.map +4 -4
- package/dist/cjs/components/MaskedField/MaskedField.js +537 -523
- package/dist/cjs/components/MaskedField/MaskedField.js.map +4 -4
- package/dist/cjs/components/MaskedField/index.js +537 -523
- package/dist/cjs/components/MaskedField/index.js.map +4 -4
- package/dist/cjs/components/NumberField/NumberField.js +528 -514
- package/dist/cjs/components/NumberField/NumberField.js.map +4 -4
- package/dist/cjs/components/NumberField/index.js +528 -514
- package/dist/cjs/components/NumberField/index.js.map +4 -4
- package/dist/cjs/components/PasswordField/PasswordField.js +524 -510
- package/dist/cjs/components/PasswordField/PasswordField.js.map +4 -4
- package/dist/cjs/components/PasswordField/ShowHideButton.js +523 -509
- package/dist/cjs/components/PasswordField/ShowHideButton.js.map +4 -4
- package/dist/cjs/components/PasswordField/index.js +524 -510
- package/dist/cjs/components/PasswordField/index.js.map +4 -4
- package/dist/cjs/components/Radio/Radio.js +506 -492
- package/dist/cjs/components/Radio/Radio.js.map +4 -4
- package/dist/cjs/components/Radio/RadioGroup.js +505 -491
- package/dist/cjs/components/Radio/RadioGroup.js.map +4 -4
- package/dist/cjs/components/Radio/index.js +484 -470
- package/dist/cjs/components/Radio/index.js.map +4 -4
- package/dist/cjs/components/Select/Select.js +511 -497
- package/dist/cjs/components/Select/Select.js.map +4 -4
- package/dist/cjs/components/Select/index.js +511 -497
- package/dist/cjs/components/Select/index.js.map +4 -4
- package/dist/cjs/components/TextArea/TextArea.js +521 -507
- package/dist/cjs/components/TextArea/TextArea.js.map +4 -4
- package/dist/cjs/components/TextArea/index.js +521 -507
- package/dist/cjs/components/TextArea/index.js.map +4 -4
- package/dist/cjs/components/TextField/TextField.js +537 -523
- package/dist/cjs/components/TextField/TextField.js.map +4 -4
- package/dist/cjs/components/TextField/index.js +537 -523
- package/dist/cjs/components/TextField/index.js.map +4 -4
- package/dist/cjs/components/index.js +567 -553
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/index.js +567 -553
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/meta.json +1372 -1305
- package/dist/esm/{chunk-FTSJNY4J.js → chunk-N5WGQAHM.js} +14 -2
- package/dist/esm/chunk-N5WGQAHM.js.map +7 -0
- package/dist/esm/{chunk-C4BILMFX.js → chunk-RR4UQSOZ.js} +5 -1
- package/dist/esm/chunk-RR4UQSOZ.js.map +7 -0
- package/dist/esm/components/AddressLookup/AddressLookup.js +2 -2
- package/dist/esm/components/AddressLookup/index.js +2 -2
- package/dist/esm/components/Alert/Alert.js +4 -1
- package/dist/esm/components/Alert/index.js +4 -1
- package/dist/esm/components/Checkbox/Checkbox.js +2 -2
- package/dist/esm/components/Checkbox/CheckboxGroup.js +2 -2
- package/dist/esm/components/Checkbox/index.js +2 -2
- package/dist/esm/components/Combobox/Combobox.js +2 -2
- package/dist/esm/components/Combobox/index.js +2 -2
- package/dist/esm/components/DateField/DateField.js +2 -2
- package/dist/esm/components/DateField/index.js +2 -2
- package/dist/esm/components/ErrorMessage/ErrorMessage.js +2 -2
- package/dist/esm/components/ErrorMessage/index.js +2 -2
- package/dist/esm/components/ExpandableText/ExpandableText.js +2 -2
- package/dist/esm/components/ExpandableText/index.js +2 -2
- package/dist/esm/components/MaskedField/MaskedField.js +2 -2
- package/dist/esm/components/MaskedField/index.js +2 -2
- package/dist/esm/components/NumberField/NumberField.js +2 -2
- package/dist/esm/components/NumberField/index.js +2 -2
- package/dist/esm/components/PasswordField/PasswordField.js +2 -2
- package/dist/esm/components/PasswordField/ShowHideButton.js +2 -2
- package/dist/esm/components/PasswordField/index.js +2 -2
- package/dist/esm/components/Radio/Radio.js +2 -2
- package/dist/esm/components/Radio/RadioGroup.js +2 -2
- package/dist/esm/components/Radio/index.js +2 -2
- package/dist/esm/components/Select/Select.js +2 -2
- package/dist/esm/components/Select/index.js +2 -2
- package/dist/esm/components/TextArea/TextArea.js +2 -2
- package/dist/esm/components/TextArea/index.js +2 -2
- package/dist/esm/components/TextField/TextField.js +2 -2
- package/dist/esm/components/TextField/index.js +2 -2
- package/dist/esm/components/index.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/meta.json +164 -131
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/AddressLookup/AddressLookup.test.tsx +76 -0
- package/src/components/AddressLookup/AddressLookup.tsx +9 -0
- package/src/components/Alert/Alert.tsx +10 -1
- package/src/components/Drawer/Drawer.css +24 -3
- package/src/components/Modal/Modal.css +42 -3
- package/dist/esm/chunk-C4BILMFX.js.map +0 -7
- package/dist/esm/chunk-FTSJNY4J.js.map +0 -7
|
@@ -1951,6 +1951,10 @@ var init_AddressLookup = __esm({
|
|
|
1951
1951
|
);
|
|
1952
1952
|
const handleSelected = (selected) => {
|
|
1953
1953
|
setError(null);
|
|
1954
|
+
const isEmpty = typeof selected === "string" ? selected === "" : !selected.id && !selected.value;
|
|
1955
|
+
if (isEmpty) {
|
|
1956
|
+
return Promise.resolve();
|
|
1957
|
+
}
|
|
1954
1958
|
if (typeof selected === "string" || !selected.id) {
|
|
1955
1959
|
setError(new Error("Selected option missing id"));
|
|
1956
1960
|
return Promise.resolve();
|
|
@@ -1998,19 +2002,98 @@ var init_AddressLookup2 = __esm({
|
|
|
1998
2002
|
}
|
|
1999
2003
|
});
|
|
2000
2004
|
|
|
2005
|
+
// src/components/Text/Text.tsx
|
|
2006
|
+
var import_dedupe10, import_Text, import_jsx_runtime12, getElementType, Text;
|
|
2007
|
+
var init_Text = __esm({
|
|
2008
|
+
"src/components/Text/Text.tsx"() {
|
|
2009
|
+
"use strict";
|
|
2010
|
+
import_dedupe10 = __toESM(require("classnames/dedupe"));
|
|
2011
|
+
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
2012
|
+
import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2013
|
+
getElementType = (variant, elementType) => {
|
|
2014
|
+
if (variant) {
|
|
2015
|
+
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
2016
|
+
}
|
|
2017
|
+
return elementType || "p";
|
|
2018
|
+
};
|
|
2019
|
+
Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
2020
|
+
const { variant, className, spacing, ...otherProps } = props;
|
|
2021
|
+
const elementType = getElementType(variant, Component);
|
|
2022
|
+
const variantType = variant || elementType;
|
|
2023
|
+
const classes = (0, import_dedupe10.default)(
|
|
2024
|
+
"mobius",
|
|
2025
|
+
"mobius-text",
|
|
2026
|
+
{ [`--is-${variantType}`]: variantType },
|
|
2027
|
+
{ [`--has-line-height-${spacing}`]: spacing },
|
|
2028
|
+
className
|
|
2029
|
+
);
|
|
2030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
2031
|
+
};
|
|
2032
|
+
Text.displayName = "Text";
|
|
2033
|
+
}
|
|
2034
|
+
});
|
|
2035
|
+
|
|
2036
|
+
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
2037
|
+
var import_react14, import_jsx_runtime13, isHTML, TextOrHTML;
|
|
2038
|
+
var init_TextOrHTML = __esm({
|
|
2039
|
+
"src/components/TextOrHTML/TextOrHTML.tsx"() {
|
|
2040
|
+
"use strict";
|
|
2041
|
+
import_react14 = require("react");
|
|
2042
|
+
init_Text();
|
|
2043
|
+
import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2044
|
+
isHTML = (text) => /^\s*<[a-z]/i.test(text);
|
|
2045
|
+
TextOrHTML = ({
|
|
2046
|
+
ref,
|
|
2047
|
+
text,
|
|
2048
|
+
htmlClassName,
|
|
2049
|
+
htmlElementType,
|
|
2050
|
+
textWrapper = false,
|
|
2051
|
+
autoDetect = false,
|
|
2052
|
+
...textProps
|
|
2053
|
+
}) => {
|
|
2054
|
+
const textIsHTML = autoDetect && isHTML(text);
|
|
2055
|
+
const shouldWrapInText = autoDetect ? textWrapper || !textIsHTML : textWrapper;
|
|
2056
|
+
const resolvedElementType = htmlElementType ?? (textIsHTML ? "div" : "span");
|
|
2057
|
+
const DangerousComponent = resolvedElementType;
|
|
2058
|
+
const dangerousHTML = (0, import_react14.useMemo)(() => ({ __html: text }), [text]);
|
|
2059
|
+
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2060
|
+
DangerousComponent,
|
|
2061
|
+
{
|
|
2062
|
+
className: htmlClassName,
|
|
2063
|
+
dangerouslySetInnerHTML: dangerousHTML
|
|
2064
|
+
}
|
|
2065
|
+
);
|
|
2066
|
+
if (shouldWrapInText) {
|
|
2067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
2068
|
+
}
|
|
2069
|
+
return dangerousElement;
|
|
2070
|
+
};
|
|
2071
|
+
TextOrHTML.displayName = "TextOrHTML";
|
|
2072
|
+
}
|
|
2073
|
+
});
|
|
2074
|
+
|
|
2075
|
+
// src/components/TextOrHTML/index.tsx
|
|
2076
|
+
var init_TextOrHTML2 = __esm({
|
|
2077
|
+
"src/components/TextOrHTML/index.tsx"() {
|
|
2078
|
+
"use strict";
|
|
2079
|
+
init_TextOrHTML();
|
|
2080
|
+
}
|
|
2081
|
+
});
|
|
2082
|
+
|
|
2001
2083
|
// src/components/Alert/Alert.tsx
|
|
2002
2084
|
function isAlertVariant(value) {
|
|
2003
2085
|
return value === "info" || value === "success" || value === "warning" || value === "error";
|
|
2004
2086
|
}
|
|
2005
|
-
var import_icons3,
|
|
2087
|
+
var import_icons3, import_dedupe11, import_Alert, import_jsx_runtime14, Alert;
|
|
2006
2088
|
var init_Alert = __esm({
|
|
2007
2089
|
"src/components/Alert/Alert.tsx"() {
|
|
2008
2090
|
"use strict";
|
|
2009
2091
|
import_icons3 = require("@simplybusiness/icons");
|
|
2010
|
-
|
|
2092
|
+
import_dedupe11 = __toESM(require("classnames/dedupe"));
|
|
2011
2093
|
init_Icon2();
|
|
2094
|
+
init_TextOrHTML2();
|
|
2012
2095
|
import_Alert = require("@simplybusiness/mobius/src/components/Alert/Alert.css");
|
|
2013
|
-
|
|
2096
|
+
import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2014
2097
|
Alert = ({ ref, ...props }) => {
|
|
2015
2098
|
const {
|
|
2016
2099
|
elementType: Element = "div",
|
|
@@ -2023,7 +2106,7 @@ var init_Alert = __esm({
|
|
|
2023
2106
|
if (!show) return null;
|
|
2024
2107
|
const variant = variantProp && isAlertVariant(variantProp) ? variantProp : "info";
|
|
2025
2108
|
const colorValue = variant === "success" ? `var(--color-valid)` : `var(--color-${variant})`;
|
|
2026
|
-
const classes = (0,
|
|
2109
|
+
const classes = (0, import_dedupe11.default)(
|
|
2027
2110
|
"mobius",
|
|
2028
2111
|
"mobius-alert",
|
|
2029
2112
|
{
|
|
@@ -2041,14 +2124,23 @@ var init_Alert = __esm({
|
|
|
2041
2124
|
warning: import_icons3.warning,
|
|
2042
2125
|
error: import_icons3.error
|
|
2043
2126
|
};
|
|
2044
|
-
const headerClasses = (0,
|
|
2045
|
-
const iconClasses = (0,
|
|
2046
|
-
const contentClasses = (0,
|
|
2047
|
-
return /* @__PURE__ */ (0,
|
|
2048
|
-
/* @__PURE__ */ (0,
|
|
2049
|
-
/* @__PURE__ */ (0,
|
|
2050
|
-
header && /* @__PURE__ */ (0,
|
|
2051
|
-
|
|
2127
|
+
const headerClasses = (0, import_dedupe11.default)("mobius", "mobius-alert__header");
|
|
2128
|
+
const iconClasses = (0, import_dedupe11.default)("mobius", "mobius-alert__icon");
|
|
2129
|
+
const contentClasses = (0, import_dedupe11.default)("mobius", "mobius-alert__content");
|
|
2130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Element, { ref, role: "alert", ...otherProps, className: classes, children: [
|
|
2131
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { icon: icon[variant], color: colorValue }) }),
|
|
2132
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2133
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2134
|
+
TextOrHTML,
|
|
2135
|
+
{
|
|
2136
|
+
autoDetect: true,
|
|
2137
|
+
htmlElementType: "span",
|
|
2138
|
+
className: headerClasses,
|
|
2139
|
+
htmlClassName: headerClasses,
|
|
2140
|
+
text: header
|
|
2141
|
+
}
|
|
2142
|
+
),
|
|
2143
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: contentClasses, children })
|
|
2052
2144
|
] })
|
|
2053
2145
|
] });
|
|
2054
2146
|
};
|
|
@@ -2065,14 +2157,14 @@ var init_Alert2 = __esm({
|
|
|
2065
2157
|
});
|
|
2066
2158
|
|
|
2067
2159
|
// src/components/Box/Box.tsx
|
|
2068
|
-
var
|
|
2160
|
+
var import_dedupe12, import_Box, import_jsx_runtime15, Box;
|
|
2069
2161
|
var init_Box = __esm({
|
|
2070
2162
|
"src/components/Box/Box.tsx"() {
|
|
2071
2163
|
"use strict";
|
|
2072
|
-
|
|
2164
|
+
import_dedupe12 = __toESM(require("classnames/dedupe"));
|
|
2073
2165
|
init_utils();
|
|
2074
2166
|
import_Box = require("@simplybusiness/mobius/src/components/Box/Box.css");
|
|
2075
|
-
|
|
2167
|
+
import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2076
2168
|
Box = ({ ref, ...props }) => {
|
|
2077
2169
|
const {
|
|
2078
2170
|
elementType: Element = "div",
|
|
@@ -2098,7 +2190,7 @@ var init_Box = __esm({
|
|
|
2098
2190
|
style,
|
|
2099
2191
|
...otherProps
|
|
2100
2192
|
} = props;
|
|
2101
|
-
const classes = (0,
|
|
2193
|
+
const classes = (0, import_dedupe12.default)("mobius", "mobius-box", otherProps.className);
|
|
2102
2194
|
const styleProps = filterUndefinedProps({
|
|
2103
2195
|
padding: getSpacingValue(padding),
|
|
2104
2196
|
paddingInline: getSpacingValue(paddingInline || paddingX),
|
|
@@ -2115,7 +2207,7 @@ var init_Box = __esm({
|
|
|
2115
2207
|
height,
|
|
2116
2208
|
...style
|
|
2117
2209
|
});
|
|
2118
|
-
return /* @__PURE__ */ (0,
|
|
2210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Element, { ref, style: styleProps, ...otherProps, className: classes });
|
|
2119
2211
|
};
|
|
2120
2212
|
Box.displayName = "Box";
|
|
2121
2213
|
}
|
|
@@ -2130,27 +2222,27 @@ var init_Box2 = __esm({
|
|
|
2130
2222
|
});
|
|
2131
2223
|
|
|
2132
2224
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
2133
|
-
var
|
|
2225
|
+
var import_react15, import_dedupe13, import_Breadcrumbs, import_jsx_runtime16, Breadcrumbs;
|
|
2134
2226
|
var init_Breadcrumbs = __esm({
|
|
2135
2227
|
"src/components/Breadcrumbs/Breadcrumbs.tsx"() {
|
|
2136
2228
|
"use strict";
|
|
2137
2229
|
"use client";
|
|
2138
|
-
|
|
2139
|
-
|
|
2230
|
+
import_react15 = require("react");
|
|
2231
|
+
import_dedupe13 = __toESM(require("classnames/dedupe"));
|
|
2140
2232
|
import_Breadcrumbs = require("@simplybusiness/mobius/src/components/Breadcrumbs/Breadcrumbs.css");
|
|
2141
|
-
|
|
2233
|
+
import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2142
2234
|
Breadcrumbs = ({ ref, ...props }) => {
|
|
2143
2235
|
const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
|
|
2144
2236
|
const { navProps } = { navProps: { "aria-label": ariaLabel } };
|
|
2145
2237
|
const { children, ...otherProps } = props;
|
|
2146
|
-
const childArray =
|
|
2147
|
-
const classes = (0,
|
|
2238
|
+
const childArray = import_react15.Children.toArray(children);
|
|
2239
|
+
const classes = (0, import_dedupe13.default)(
|
|
2148
2240
|
"mobius",
|
|
2149
2241
|
"mobius-breadcrumb",
|
|
2150
2242
|
otherProps.className
|
|
2151
2243
|
);
|
|
2152
|
-
return /* @__PURE__ */ (0,
|
|
2153
|
-
(child, i) => (0,
|
|
2244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { children: childArray.map(
|
|
2245
|
+
(child, i) => (0, import_react15.cloneElement)(
|
|
2154
2246
|
child,
|
|
2155
2247
|
{
|
|
2156
2248
|
key: i,
|
|
@@ -2164,22 +2256,22 @@ var init_Breadcrumbs = __esm({
|
|
|
2164
2256
|
});
|
|
2165
2257
|
|
|
2166
2258
|
// src/components/Breadcrumbs/BreadcrumbItem.tsx
|
|
2167
|
-
var
|
|
2259
|
+
var import_react16, import_dedupe14, import_jsx_runtime17, BreadcrumbItem;
|
|
2168
2260
|
var init_BreadcrumbItem = __esm({
|
|
2169
2261
|
"src/components/Breadcrumbs/BreadcrumbItem.tsx"() {
|
|
2170
2262
|
"use strict";
|
|
2171
2263
|
"use client";
|
|
2172
|
-
|
|
2173
|
-
|
|
2264
|
+
import_react16 = require("react");
|
|
2265
|
+
import_dedupe14 = __toESM(require("classnames/dedupe"));
|
|
2174
2266
|
init_Box2();
|
|
2175
|
-
|
|
2267
|
+
import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2176
2268
|
BreadcrumbItem = ({ ref, ...props }) => {
|
|
2177
2269
|
const {
|
|
2178
2270
|
isDisabled = false,
|
|
2179
2271
|
isCurrent = false,
|
|
2180
2272
|
"aria-current": ariaCurrent = "page",
|
|
2181
2273
|
children,
|
|
2182
|
-
separator = /* @__PURE__ */ (0,
|
|
2274
|
+
separator = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box, { className: "mobius-breadcrumb__separator", "aria-hidden": "true", children: ">" }),
|
|
2183
2275
|
...otherProps
|
|
2184
2276
|
} = props;
|
|
2185
2277
|
const { itemProps } = {
|
|
@@ -2189,14 +2281,14 @@ var init_BreadcrumbItem = __esm({
|
|
|
2189
2281
|
...otherProps
|
|
2190
2282
|
}
|
|
2191
2283
|
};
|
|
2192
|
-
const classes = (0,
|
|
2284
|
+
const classes = (0, import_dedupe14.default)(
|
|
2193
2285
|
"mobius",
|
|
2194
2286
|
"mobius-breadcrumb__item",
|
|
2195
2287
|
props.className
|
|
2196
2288
|
);
|
|
2197
|
-
const child = typeof children === "string" ? /* @__PURE__ */ (0,
|
|
2198
|
-
return /* @__PURE__ */ (0,
|
|
2199
|
-
(0,
|
|
2289
|
+
const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { ...itemProps, children }) : import_react16.Children.only(children);
|
|
2290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: classes, children: [
|
|
2291
|
+
(0, import_react16.cloneElement)(child, {
|
|
2200
2292
|
...child.props,
|
|
2201
2293
|
...itemProps,
|
|
2202
2294
|
ref
|
|
@@ -2218,19 +2310,19 @@ var init_Breadcrumbs2 = __esm({
|
|
|
2218
2310
|
});
|
|
2219
2311
|
|
|
2220
2312
|
// src/components/Button/Loading.tsx
|
|
2221
|
-
var import_icons4,
|
|
2313
|
+
var import_icons4, import_jsx_runtime18, Loading;
|
|
2222
2314
|
var init_Loading = __esm({
|
|
2223
2315
|
"src/components/Button/Loading.tsx"() {
|
|
2224
2316
|
"use strict";
|
|
2225
2317
|
import_icons4 = require("@simplybusiness/icons");
|
|
2226
2318
|
init_Icon2();
|
|
2227
2319
|
init_VisuallyHidden2();
|
|
2228
|
-
|
|
2320
|
+
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2229
2321
|
Loading = (props) => {
|
|
2230
2322
|
const { children } = props;
|
|
2231
|
-
return /* @__PURE__ */ (0,
|
|
2232
|
-
/* @__PURE__ */ (0,
|
|
2233
|
-
/* @__PURE__ */ (0,
|
|
2323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2324
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { icon: import_icons4.loading, spin: true, size: "md" }) }),
|
|
2325
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(VisuallyHidden, { className: "mobius-button__loading-text", children: "Loading" }),
|
|
2234
2326
|
children
|
|
2235
2327
|
] });
|
|
2236
2328
|
};
|
|
@@ -2238,33 +2330,33 @@ var init_Loading = __esm({
|
|
|
2238
2330
|
});
|
|
2239
2331
|
|
|
2240
2332
|
// src/components/Button/Success.tsx
|
|
2241
|
-
var import_icons5,
|
|
2333
|
+
var import_icons5, import_jsx_runtime19, Success;
|
|
2242
2334
|
var init_Success = __esm({
|
|
2243
2335
|
"src/components/Button/Success.tsx"() {
|
|
2244
2336
|
"use strict";
|
|
2245
2337
|
import_icons5 = require("@simplybusiness/icons");
|
|
2246
2338
|
init_Icon2();
|
|
2247
2339
|
init_VisuallyHidden2();
|
|
2248
|
-
|
|
2249
|
-
Success = () => /* @__PURE__ */ (0,
|
|
2250
|
-
/* @__PURE__ */ (0,
|
|
2251
|
-
/* @__PURE__ */ (0,
|
|
2340
|
+
import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2341
|
+
Success = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2342
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { icon: import_icons5.tick, size: "md" }) }),
|
|
2343
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(VisuallyHidden, { className: "mobius-button__success-text", children: "Success" })
|
|
2252
2344
|
] });
|
|
2253
2345
|
}
|
|
2254
2346
|
});
|
|
2255
2347
|
|
|
2256
2348
|
// src/components/Button/Button.tsx
|
|
2257
|
-
var
|
|
2349
|
+
var import_dedupe15, import_Button, import_jsx_runtime20, Button;
|
|
2258
2350
|
var init_Button = __esm({
|
|
2259
2351
|
"src/components/Button/Button.tsx"() {
|
|
2260
2352
|
"use strict";
|
|
2261
2353
|
"use client";
|
|
2262
|
-
|
|
2354
|
+
import_dedupe15 = __toESM(require("classnames/dedupe"));
|
|
2263
2355
|
init_Loading();
|
|
2264
2356
|
init_useButton2();
|
|
2265
2357
|
init_Success();
|
|
2266
2358
|
import_Button = require("@simplybusiness/mobius/src/components/Button/Button.css");
|
|
2267
|
-
|
|
2359
|
+
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2268
2360
|
Button = ({ ref, ...props }) => {
|
|
2269
2361
|
const {
|
|
2270
2362
|
children,
|
|
@@ -2279,7 +2371,7 @@ var init_Button = __esm({
|
|
|
2279
2371
|
...otherProps
|
|
2280
2372
|
} = props;
|
|
2281
2373
|
const { buttonProps } = useButton(props);
|
|
2282
|
-
otherProps.className = (0,
|
|
2374
|
+
otherProps.className = (0, import_dedupe15.default)(
|
|
2283
2375
|
"mobius",
|
|
2284
2376
|
"mobius-button",
|
|
2285
2377
|
`--variant-${variant}`,
|
|
@@ -2291,9 +2383,9 @@ var init_Button = __esm({
|
|
|
2291
2383
|
},
|
|
2292
2384
|
otherProps.className
|
|
2293
2385
|
);
|
|
2294
|
-
return /* @__PURE__ */ (0,
|
|
2295
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2296
|
-
isSuccess && !isLoading && /* @__PURE__ */ (0,
|
|
2386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Component, { ref, ...buttonProps, ...otherProps, children: [
|
|
2387
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Loading, { children }) : children,
|
|
2388
|
+
isSuccess && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Success, {})
|
|
2297
2389
|
] });
|
|
2298
2390
|
};
|
|
2299
2391
|
Button.displayName = "Button";
|
|
@@ -2309,16 +2401,16 @@ var init_Button2 = __esm({
|
|
|
2309
2401
|
});
|
|
2310
2402
|
|
|
2311
2403
|
// src/components/Stack/Stack.tsx
|
|
2312
|
-
var
|
|
2404
|
+
var import_dedupe16, import_Stack, import_jsx_runtime21, Stack;
|
|
2313
2405
|
var init_Stack = __esm({
|
|
2314
2406
|
"src/components/Stack/Stack.tsx"() {
|
|
2315
2407
|
"use strict";
|
|
2316
|
-
|
|
2408
|
+
import_dedupe16 = __toESM(require("classnames/dedupe"));
|
|
2317
2409
|
import_Stack = require("@simplybusiness/mobius/src/components/Stack/Stack.css");
|
|
2318
|
-
|
|
2410
|
+
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2319
2411
|
Stack = ({ ref, ...props }) => {
|
|
2320
2412
|
const { elementType: Element = "div", gap, ...otherProps } = props;
|
|
2321
|
-
const classes = (0,
|
|
2413
|
+
const classes = (0, import_dedupe16.default)(
|
|
2322
2414
|
"mobius",
|
|
2323
2415
|
"mobius-stack",
|
|
2324
2416
|
{
|
|
@@ -2326,7 +2418,7 @@ var init_Stack = __esm({
|
|
|
2326
2418
|
},
|
|
2327
2419
|
otherProps.className
|
|
2328
2420
|
);
|
|
2329
|
-
return /* @__PURE__ */ (0,
|
|
2421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
2330
2422
|
};
|
|
2331
2423
|
Stack.displayName = "Stack";
|
|
2332
2424
|
}
|
|
@@ -2341,13 +2433,13 @@ var init_Stack2 = __esm({
|
|
|
2341
2433
|
});
|
|
2342
2434
|
|
|
2343
2435
|
// src/components/Checkbox/Checkbox.tsx
|
|
2344
|
-
var
|
|
2436
|
+
var import_react17, import_dedupe17, import_icons6, import_Checkbox, import_jsx_runtime22, Checkbox;
|
|
2345
2437
|
var init_Checkbox = __esm({
|
|
2346
2438
|
"src/components/Checkbox/Checkbox.tsx"() {
|
|
2347
2439
|
"use strict";
|
|
2348
2440
|
"use client";
|
|
2349
|
-
|
|
2350
|
-
|
|
2441
|
+
import_react17 = require("react");
|
|
2442
|
+
import_dedupe17 = __toESM(require("classnames/dedupe"));
|
|
2351
2443
|
import_icons6 = require("@simplybusiness/icons");
|
|
2352
2444
|
init_ErrorMessage2();
|
|
2353
2445
|
init_spaceDelimitedList();
|
|
@@ -2355,7 +2447,7 @@ var init_Checkbox = __esm({
|
|
|
2355
2447
|
init_Icon2();
|
|
2356
2448
|
init_Stack2();
|
|
2357
2449
|
import_Checkbox = require("@simplybusiness/mobius/src/components/Checkbox/Checkbox.css");
|
|
2358
|
-
|
|
2450
|
+
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2359
2451
|
Checkbox = ({ ref, ...props }) => {
|
|
2360
2452
|
const {
|
|
2361
2453
|
id,
|
|
@@ -2375,18 +2467,18 @@ var init_Checkbox = __esm({
|
|
|
2375
2467
|
["aria-describedby"]: ariaDescribedBy,
|
|
2376
2468
|
...rest
|
|
2377
2469
|
} = props;
|
|
2378
|
-
const [checked, setChecked] = (0,
|
|
2379
|
-
const fallbackRef = (0,
|
|
2470
|
+
const [checked, setChecked] = (0, import_react17.useState)(defaultSelected);
|
|
2471
|
+
const fallbackRef = (0, import_react17.useRef)(null);
|
|
2380
2472
|
const refObj = ref || fallbackRef;
|
|
2381
|
-
const inputId = (0,
|
|
2473
|
+
const inputId = (0, import_react17.useId)();
|
|
2382
2474
|
const isControlled = typeof selected === "boolean";
|
|
2383
|
-
(0,
|
|
2475
|
+
(0, import_react17.useEffect)(() => {
|
|
2384
2476
|
if (isControlled) {
|
|
2385
2477
|
setChecked(selected);
|
|
2386
2478
|
}
|
|
2387
2479
|
}, [selected, isControlled]);
|
|
2388
2480
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2389
|
-
const sharedClasses = (0,
|
|
2481
|
+
const sharedClasses = (0, import_dedupe17.default)(
|
|
2390
2482
|
{
|
|
2391
2483
|
"--is-disabled": isDisabled,
|
|
2392
2484
|
"--is-selected": checked,
|
|
@@ -2395,31 +2487,31 @@ var init_Checkbox = __esm({
|
|
|
2395
2487
|
},
|
|
2396
2488
|
validationClasses
|
|
2397
2489
|
);
|
|
2398
|
-
const wrapperClasses = (0,
|
|
2490
|
+
const wrapperClasses = (0, import_dedupe17.default)(
|
|
2399
2491
|
"mobius",
|
|
2400
2492
|
"mobius-checkbox",
|
|
2401
2493
|
sharedClasses,
|
|
2402
2494
|
className
|
|
2403
2495
|
);
|
|
2404
|
-
const labelClasses = (0,
|
|
2405
|
-
const inputClasses = (0,
|
|
2406
|
-
const iconClasses = (0,
|
|
2407
|
-
const errorMessageId = (0,
|
|
2496
|
+
const labelClasses = (0, import_dedupe17.default)("mobius-checkbox__label", sharedClasses);
|
|
2497
|
+
const inputClasses = (0, import_dedupe17.default)("mobius-checkbox__input", sharedClasses);
|
|
2498
|
+
const iconClasses = (0, import_dedupe17.default)("mobius-checkbox__icon", sharedClasses);
|
|
2499
|
+
const errorMessageId = (0, import_react17.useId)();
|
|
2408
2500
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2409
2501
|
const describedBy = spaceDelimitedList([
|
|
2410
2502
|
shouldErrorMessageShow,
|
|
2411
2503
|
ariaDescribedBy
|
|
2412
2504
|
]);
|
|
2413
|
-
const labelId = (0,
|
|
2505
|
+
const labelId = (0, import_react17.useId)();
|
|
2414
2506
|
const handleChange = (event) => {
|
|
2415
2507
|
setChecked(!checked);
|
|
2416
2508
|
if (onChange) {
|
|
2417
2509
|
onChange(event, isLastItem);
|
|
2418
2510
|
}
|
|
2419
2511
|
};
|
|
2420
|
-
return /* @__PURE__ */ (0,
|
|
2421
|
-
/* @__PURE__ */ (0,
|
|
2422
|
-
/* @__PURE__ */ (0,
|
|
2512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Stack, { gap: "xs", className: wrapperClasses, children: [
|
|
2513
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: labelClasses, children: [
|
|
2514
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2423
2515
|
"input",
|
|
2424
2516
|
{
|
|
2425
2517
|
"aria-describedby": describedBy,
|
|
@@ -2440,7 +2532,7 @@ var init_Checkbox = __esm({
|
|
|
2440
2532
|
...rest
|
|
2441
2533
|
}
|
|
2442
2534
|
),
|
|
2443
|
-
/* @__PURE__ */ (0,
|
|
2535
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2444
2536
|
Icon,
|
|
2445
2537
|
{
|
|
2446
2538
|
icon: checked ? import_icons6.squareTick : import_icons6.square,
|
|
@@ -2448,9 +2540,9 @@ var init_Checkbox = __esm({
|
|
|
2448
2540
|
className: iconClasses
|
|
2449
2541
|
}
|
|
2450
2542
|
),
|
|
2451
|
-
/* @__PURE__ */ (0,
|
|
2543
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { id: labelId, className: "mobius-checkbox__visible-label", children: label })
|
|
2452
2544
|
] }),
|
|
2453
|
-
/* @__PURE__ */ (0,
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2454
2546
|
] });
|
|
2455
2547
|
};
|
|
2456
2548
|
Checkbox.displayName = "Checkbox";
|
|
@@ -2458,18 +2550,18 @@ var init_Checkbox = __esm({
|
|
|
2458
2550
|
});
|
|
2459
2551
|
|
|
2460
2552
|
// src/components/Label/Label.tsx
|
|
2461
|
-
var
|
|
2553
|
+
var import_dedupe18, import_Label, import_jsx_runtime23, Label;
|
|
2462
2554
|
var init_Label = __esm({
|
|
2463
2555
|
"src/components/Label/Label.tsx"() {
|
|
2464
2556
|
"use strict";
|
|
2465
|
-
|
|
2557
|
+
import_dedupe18 = __toESM(require("classnames/dedupe"));
|
|
2466
2558
|
import_Label = require("@simplybusiness/mobius/src/components/Label/Label.css");
|
|
2467
|
-
|
|
2559
|
+
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2468
2560
|
Label = ({ ref, ...props }) => {
|
|
2469
2561
|
const { elementType: Element = "label", children, ...otherProps } = props;
|
|
2470
|
-
const classes = (0,
|
|
2562
|
+
const classes = (0, import_dedupe18.default)("mobius", "mobius-label", props.className);
|
|
2471
2563
|
otherProps.className = classes;
|
|
2472
|
-
return /* @__PURE__ */ (0,
|
|
2564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Element, { ref, ...otherProps, className: classes, children });
|
|
2473
2565
|
};
|
|
2474
2566
|
Label.displayName = "Label";
|
|
2475
2567
|
}
|
|
@@ -2484,20 +2576,20 @@ var init_Label2 = __esm({
|
|
|
2484
2576
|
});
|
|
2485
2577
|
|
|
2486
2578
|
// src/components/Checkbox/CheckboxGroup.tsx
|
|
2487
|
-
var
|
|
2579
|
+
var import_dedupe19, import_react18, import_CheckboxGroup, import_jsx_runtime24, CheckboxGroup;
|
|
2488
2580
|
var init_CheckboxGroup = __esm({
|
|
2489
2581
|
"src/components/Checkbox/CheckboxGroup.tsx"() {
|
|
2490
2582
|
"use strict";
|
|
2491
2583
|
"use client";
|
|
2492
|
-
|
|
2493
|
-
|
|
2584
|
+
import_dedupe19 = __toESM(require("classnames/dedupe"));
|
|
2585
|
+
import_react18 = require("react");
|
|
2494
2586
|
init_hooks();
|
|
2495
2587
|
init_spaceDelimitedList();
|
|
2496
2588
|
init_ErrorMessage2();
|
|
2497
2589
|
init_Label2();
|
|
2498
2590
|
init_Checkbox();
|
|
2499
2591
|
import_CheckboxGroup = require("@simplybusiness/mobius/src/components/Checkbox/CheckboxGroup.css");
|
|
2500
|
-
|
|
2592
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2501
2593
|
CheckboxGroup = ({ ref, ...props }) => {
|
|
2502
2594
|
const {
|
|
2503
2595
|
label,
|
|
@@ -2515,10 +2607,10 @@ var init_CheckboxGroup = __esm({
|
|
|
2515
2607
|
lastItemDisables = false,
|
|
2516
2608
|
...rest
|
|
2517
2609
|
} = props;
|
|
2518
|
-
const [selected, setSelected] = (0,
|
|
2519
|
-
const isInitializedRef = (0,
|
|
2520
|
-
const prevDefaultValueRef = (0,
|
|
2521
|
-
(0,
|
|
2610
|
+
const [selected, setSelected] = (0, import_react18.useState)(defaultValue);
|
|
2611
|
+
const isInitializedRef = (0, import_react18.useRef)(false);
|
|
2612
|
+
const prevDefaultValueRef = (0, import_react18.useRef)(defaultValue);
|
|
2613
|
+
(0, import_react18.useEffect)(() => {
|
|
2522
2614
|
const hasChanged = defaultValue.length !== prevDefaultValueRef.current.length || defaultValue.some(
|
|
2523
2615
|
(val, index) => val !== prevDefaultValueRef.current[index]
|
|
2524
2616
|
);
|
|
@@ -2528,7 +2620,7 @@ var init_CheckboxGroup = __esm({
|
|
|
2528
2620
|
isInitializedRef.current = true;
|
|
2529
2621
|
}
|
|
2530
2622
|
}, [defaultValue]);
|
|
2531
|
-
const checkboxGroupClasses = (0,
|
|
2623
|
+
const checkboxGroupClasses = (0, import_dedupe19.default)(
|
|
2532
2624
|
"mobius",
|
|
2533
2625
|
"mobius-checkbox-group",
|
|
2534
2626
|
className,
|
|
@@ -2540,19 +2632,19 @@ var init_CheckboxGroup = __esm({
|
|
|
2540
2632
|
}
|
|
2541
2633
|
);
|
|
2542
2634
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2543
|
-
const labelClasses = (0,
|
|
2635
|
+
const labelClasses = (0, import_dedupe19.default)(
|
|
2544
2636
|
{
|
|
2545
2637
|
"--is-disabled": isDisabled
|
|
2546
2638
|
},
|
|
2547
2639
|
validationClasses
|
|
2548
2640
|
);
|
|
2549
|
-
const errorMessageId = (0,
|
|
2641
|
+
const errorMessageId = (0, import_react18.useId)();
|
|
2550
2642
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2551
2643
|
const describedBy = spaceDelimitedList([
|
|
2552
2644
|
shouldErrorMessageShow,
|
|
2553
2645
|
props["aria-describedby"]
|
|
2554
2646
|
]);
|
|
2555
|
-
const labelId = (0,
|
|
2647
|
+
const labelId = (0, import_react18.useId)();
|
|
2556
2648
|
const handleChange = (event, isLastItem = false) => {
|
|
2557
2649
|
const {
|
|
2558
2650
|
target: { value, checked }
|
|
@@ -2570,12 +2662,12 @@ var init_CheckboxGroup = __esm({
|
|
|
2570
2662
|
setSelected(newValue);
|
|
2571
2663
|
onChange?.(newValue);
|
|
2572
2664
|
};
|
|
2573
|
-
const childrenArray =
|
|
2665
|
+
const childrenArray = import_react18.Children.toArray(children);
|
|
2574
2666
|
const lastCheckbox = childrenArray.filter(
|
|
2575
|
-
(child) => (0,
|
|
2667
|
+
(child) => (0, import_react18.isValidElement)(child) && child.type === Checkbox
|
|
2576
2668
|
).pop();
|
|
2577
2669
|
const lastCheckboxIsChecked = lastCheckbox && selected.includes(lastCheckbox.props.value);
|
|
2578
|
-
return /* @__PURE__ */ (0,
|
|
2670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2579
2671
|
"div",
|
|
2580
2672
|
{
|
|
2581
2673
|
...rest,
|
|
@@ -2584,16 +2676,16 @@ var init_CheckboxGroup = __esm({
|
|
|
2584
2676
|
className: checkboxGroupClasses,
|
|
2585
2677
|
role: "group",
|
|
2586
2678
|
style: {
|
|
2587
|
-
"--checkbox-items-per-row": itemsPerRow ||
|
|
2679
|
+
"--checkbox-items-per-row": itemsPerRow || import_react18.Children.count(children)
|
|
2588
2680
|
},
|
|
2589
2681
|
children: [
|
|
2590
|
-
label && /* @__PURE__ */ (0,
|
|
2591
|
-
/* @__PURE__ */ (0,
|
|
2592
|
-
if ((0,
|
|
2682
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Label, { elementType: "span", id: labelId, className: labelClasses, children: label }),
|
|
2683
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mobius-checkbox-group__wrapper", children: childrenArray.map((child) => {
|
|
2684
|
+
if ((0, import_react18.isValidElement)(child)) {
|
|
2593
2685
|
const isLastItem = child === lastCheckbox;
|
|
2594
2686
|
const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
|
|
2595
2687
|
const childProps = child.props;
|
|
2596
|
-
return (0,
|
|
2688
|
+
return (0, import_react18.cloneElement)(
|
|
2597
2689
|
child,
|
|
2598
2690
|
{
|
|
2599
2691
|
isDisabled: isChildDisabled,
|
|
@@ -2609,7 +2701,7 @@ var init_CheckboxGroup = __esm({
|
|
|
2609
2701
|
}
|
|
2610
2702
|
return child;
|
|
2611
2703
|
}) }),
|
|
2612
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
2704
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2613
2705
|
]
|
|
2614
2706
|
}
|
|
2615
2707
|
);
|
|
@@ -2636,23 +2728,23 @@ var init_Checkbox2 = __esm({
|
|
|
2636
2728
|
});
|
|
2637
2729
|
|
|
2638
2730
|
// src/components/Container/Container.tsx
|
|
2639
|
-
var
|
|
2731
|
+
var import_dedupe20, import_Container, import_jsx_runtime25, Container;
|
|
2640
2732
|
var init_Container = __esm({
|
|
2641
2733
|
"src/components/Container/Container.tsx"() {
|
|
2642
2734
|
"use strict";
|
|
2643
|
-
|
|
2735
|
+
import_dedupe20 = __toESM(require("classnames/dedupe"));
|
|
2644
2736
|
init_utils();
|
|
2645
2737
|
import_Container = require("@simplybusiness/mobius/src/components/Container/Container.css");
|
|
2646
|
-
|
|
2738
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2647
2739
|
Container = ({ ref, ...props }) => {
|
|
2648
2740
|
const { elementType: Element = "div", size = "md", ...otherProps } = props;
|
|
2649
|
-
const classes = (0,
|
|
2741
|
+
const classes = (0, import_dedupe20.default)(
|
|
2650
2742
|
"mobius",
|
|
2651
2743
|
"mobius-container",
|
|
2652
2744
|
sizeClasses(size),
|
|
2653
2745
|
otherProps.className
|
|
2654
2746
|
);
|
|
2655
|
-
return /* @__PURE__ */ (0,
|
|
2747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
2656
2748
|
};
|
|
2657
2749
|
Container.displayName = "Container";
|
|
2658
2750
|
}
|
|
@@ -2714,23 +2806,23 @@ var init_DateField = __esm({
|
|
|
2714
2806
|
});
|
|
2715
2807
|
|
|
2716
2808
|
// src/components/Drawer/Content.tsx
|
|
2717
|
-
var
|
|
2809
|
+
var import_jsx_runtime26, Content;
|
|
2718
2810
|
var init_Content = __esm({
|
|
2719
2811
|
"src/components/Drawer/Content.tsx"() {
|
|
2720
2812
|
"use strict";
|
|
2721
|
-
|
|
2722
|
-
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
2813
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2814
|
+
Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref, ...otherProps, className: "mobius-drawer__content", children });
|
|
2723
2815
|
Content.displayName = "Content";
|
|
2724
2816
|
}
|
|
2725
2817
|
});
|
|
2726
2818
|
|
|
2727
2819
|
// src/components/Drawer/DrawerContext.tsx
|
|
2728
|
-
var
|
|
2820
|
+
var import_react19, DrawerContext;
|
|
2729
2821
|
var init_DrawerContext = __esm({
|
|
2730
2822
|
"src/components/Drawer/DrawerContext.tsx"() {
|
|
2731
2823
|
"use strict";
|
|
2732
|
-
|
|
2733
|
-
DrawerContext = (0,
|
|
2824
|
+
import_react19 = require("react");
|
|
2825
|
+
DrawerContext = (0, import_react19.createContext)({
|
|
2734
2826
|
onClose: () => {
|
|
2735
2827
|
},
|
|
2736
2828
|
closeLabel: void 0,
|
|
@@ -2740,19 +2832,19 @@ var init_DrawerContext = __esm({
|
|
|
2740
2832
|
});
|
|
2741
2833
|
|
|
2742
2834
|
// src/components/Drawer/Drawer.tsx
|
|
2743
|
-
var
|
|
2835
|
+
var import_dedupe21, import_react20, import_Drawer, import_jsx_runtime27, TRANSITION_CSS_VARIABLE, Drawer;
|
|
2744
2836
|
var init_Drawer = __esm({
|
|
2745
2837
|
"src/components/Drawer/Drawer.tsx"() {
|
|
2746
2838
|
"use strict";
|
|
2747
2839
|
"use client";
|
|
2748
|
-
|
|
2749
|
-
|
|
2840
|
+
import_dedupe21 = __toESM(require("classnames/dedupe"));
|
|
2841
|
+
import_react20 = require("react");
|
|
2750
2842
|
init_hooks();
|
|
2751
2843
|
init_utils();
|
|
2752
2844
|
init_VisuallyHidden2();
|
|
2753
2845
|
init_DrawerContext();
|
|
2754
2846
|
import_Drawer = require("@simplybusiness/mobius/src/components/Drawer/Drawer.css");
|
|
2755
|
-
|
|
2847
|
+
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2756
2848
|
TRANSITION_CSS_VARIABLE = "--drawer-transition-duration";
|
|
2757
2849
|
Drawer = ({ ref, ...props }) => {
|
|
2758
2850
|
const {
|
|
@@ -2765,8 +2857,8 @@ var init_Drawer = __esm({
|
|
|
2765
2857
|
onClose,
|
|
2766
2858
|
children
|
|
2767
2859
|
} = props;
|
|
2768
|
-
const dialogRef = (0,
|
|
2769
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
2860
|
+
const dialogRef = (0, import_react20.useRef)(null);
|
|
2861
|
+
const [shouldTransition, setShouldTransition] = (0, import_react20.useState)(false);
|
|
2770
2862
|
const { close } = useDialog({
|
|
2771
2863
|
ref: dialogRef,
|
|
2772
2864
|
isOpen,
|
|
@@ -2777,9 +2869,9 @@ var init_Drawer = __esm({
|
|
|
2777
2869
|
CSSVariable: TRANSITION_CSS_VARIABLE
|
|
2778
2870
|
}
|
|
2779
2871
|
});
|
|
2780
|
-
const hiddenId = `dialog-screen-reader-announce-${(0,
|
|
2781
|
-
const headerId = `dialog-header-${(0,
|
|
2782
|
-
const dialogClasses = (0,
|
|
2872
|
+
const hiddenId = `dialog-screen-reader-announce-${(0, import_react20.useId)()}`;
|
|
2873
|
+
const headerId = `dialog-header-${(0, import_react20.useId)()}`;
|
|
2874
|
+
const dialogClasses = (0, import_dedupe21.default)(
|
|
2783
2875
|
"mobius",
|
|
2784
2876
|
"mobius-drawer",
|
|
2785
2877
|
`--${direction}`,
|
|
@@ -2788,10 +2880,10 @@ var init_Drawer = __esm({
|
|
|
2788
2880
|
"--should-transition": shouldTransition
|
|
2789
2881
|
}
|
|
2790
2882
|
);
|
|
2791
|
-
(0,
|
|
2883
|
+
(0, import_react20.useEffect)(() => {
|
|
2792
2884
|
setShouldTransition(supportsDialog());
|
|
2793
2885
|
}, []);
|
|
2794
|
-
const contextValue = (0,
|
|
2886
|
+
const contextValue = (0, import_react20.useMemo)(
|
|
2795
2887
|
() => ({
|
|
2796
2888
|
onClose: close,
|
|
2797
2889
|
closeLabel,
|
|
@@ -2799,18 +2891,18 @@ var init_Drawer = __esm({
|
|
|
2799
2891
|
}),
|
|
2800
2892
|
[close, closeLabel, headerId]
|
|
2801
2893
|
);
|
|
2802
|
-
return /* @__PURE__ */ (0,
|
|
2894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2803
2895
|
"dialog",
|
|
2804
2896
|
{
|
|
2805
|
-
id: (0,
|
|
2897
|
+
id: (0, import_react20.useId)(),
|
|
2806
2898
|
ref: mergeRefs([dialogRef, ref]),
|
|
2807
2899
|
onCancel: close,
|
|
2808
2900
|
className: dialogClasses,
|
|
2809
2901
|
"aria-describedby": hiddenId,
|
|
2810
2902
|
"aria-labelledby": headerId,
|
|
2811
2903
|
children: [
|
|
2812
|
-
/* @__PURE__ */ (0,
|
|
2813
|
-
/* @__PURE__ */ (0,
|
|
2904
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { id: hiddenId, children: announce }) }),
|
|
2905
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DrawerContext.Provider, { value: contextValue, children })
|
|
2814
2906
|
]
|
|
2815
2907
|
}
|
|
2816
2908
|
);
|
|
@@ -2820,21 +2912,21 @@ var init_Drawer = __esm({
|
|
|
2820
2912
|
});
|
|
2821
2913
|
|
|
2822
2914
|
// src/components/Drawer/useDrawer.ts
|
|
2823
|
-
var
|
|
2915
|
+
var import_react21, useDrawer;
|
|
2824
2916
|
var init_useDrawer = __esm({
|
|
2825
2917
|
"src/components/Drawer/useDrawer.ts"() {
|
|
2826
2918
|
"use strict";
|
|
2827
|
-
|
|
2919
|
+
import_react21 = require("react");
|
|
2828
2920
|
init_DrawerContext();
|
|
2829
2921
|
useDrawer = () => {
|
|
2830
|
-
const { onClose, closeLabel, headerId } = (0,
|
|
2922
|
+
const { onClose, closeLabel, headerId } = (0, import_react21.useContext)(DrawerContext);
|
|
2831
2923
|
return { onClose, closeLabel, headerId };
|
|
2832
2924
|
};
|
|
2833
2925
|
}
|
|
2834
2926
|
});
|
|
2835
2927
|
|
|
2836
2928
|
// src/components/Drawer/Header.tsx
|
|
2837
|
-
var import_icons7,
|
|
2929
|
+
var import_icons7, import_jsx_runtime28, Header;
|
|
2838
2930
|
var init_Header = __esm({
|
|
2839
2931
|
"src/components/Drawer/Header.tsx"() {
|
|
2840
2932
|
"use strict";
|
|
@@ -2842,12 +2934,12 @@ var init_Header = __esm({
|
|
|
2842
2934
|
init_Button2();
|
|
2843
2935
|
init_Icon2();
|
|
2844
2936
|
init_useDrawer();
|
|
2845
|
-
|
|
2937
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2846
2938
|
Header = ({ ref, children, ...otherProps }) => {
|
|
2847
2939
|
const { onClose, closeLabel, headerId } = useDrawer();
|
|
2848
|
-
return /* @__PURE__ */ (0,
|
|
2849
|
-
/* @__PURE__ */ (0,
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("header", { ref, ...otherProps, className: "mobius-drawer__header", children: [
|
|
2941
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { id: headerId, children }),
|
|
2942
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2851
2943
|
Button,
|
|
2852
2944
|
{
|
|
2853
2945
|
"aria-label": "Close",
|
|
@@ -2856,7 +2948,7 @@ var init_Header = __esm({
|
|
|
2856
2948
|
className: "mobius-drawer__close",
|
|
2857
2949
|
size: "sm",
|
|
2858
2950
|
children: [
|
|
2859
|
-
/* @__PURE__ */ (0,
|
|
2951
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { icon: import_icons7.cross }),
|
|
2860
2952
|
" ",
|
|
2861
2953
|
closeLabel
|
|
2862
2954
|
]
|
|
@@ -2885,17 +2977,17 @@ var init_Drawer2 = __esm({
|
|
|
2885
2977
|
});
|
|
2886
2978
|
|
|
2887
2979
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2888
|
-
var
|
|
2980
|
+
var import_react22, import_react_accessible_dropdown_menu_hook, import_dedupe22, import_DropdownMenu, import_jsx_runtime29, DropdownMenu;
|
|
2889
2981
|
var init_DropdownMenu = __esm({
|
|
2890
2982
|
"src/components/DropdownMenu/DropdownMenu.tsx"() {
|
|
2891
2983
|
"use strict";
|
|
2892
2984
|
"use client";
|
|
2893
|
-
|
|
2985
|
+
import_react22 = require("react");
|
|
2894
2986
|
import_react_accessible_dropdown_menu_hook = __toESM(require("react-accessible-dropdown-menu-hook"));
|
|
2895
|
-
|
|
2987
|
+
import_dedupe22 = __toESM(require("classnames/dedupe"));
|
|
2896
2988
|
init_Button2();
|
|
2897
2989
|
import_DropdownMenu = require("@simplybusiness/mobius/src/components/DropdownMenu/DropdownMenu.css");
|
|
2898
|
-
|
|
2990
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2899
2991
|
DropdownMenu = ({ ref, ...props }) => {
|
|
2900
2992
|
const {
|
|
2901
2993
|
elementType: Element = "nav",
|
|
@@ -2904,21 +2996,21 @@ var init_DropdownMenu = __esm({
|
|
|
2904
2996
|
children,
|
|
2905
2997
|
...otherProps
|
|
2906
2998
|
} = props;
|
|
2907
|
-
const [activeId, setActiveId] = (0,
|
|
2908
|
-
const numberOfItems =
|
|
2999
|
+
const [activeId, setActiveId] = (0, import_react22.useState)(null);
|
|
3000
|
+
const numberOfItems = import_react22.Children.count(children);
|
|
2909
3001
|
const {
|
|
2910
3002
|
buttonProps,
|
|
2911
3003
|
itemProps,
|
|
2912
3004
|
isOpen: open,
|
|
2913
3005
|
setIsOpen
|
|
2914
3006
|
} = (0, import_react_accessible_dropdown_menu_hook.default)(numberOfItems);
|
|
2915
|
-
const classes = (0,
|
|
3007
|
+
const classes = (0, import_dedupe22.default)(
|
|
2916
3008
|
"mobius",
|
|
2917
3009
|
"mobius-dropdown-menu",
|
|
2918
3010
|
otherProps.className
|
|
2919
3011
|
);
|
|
2920
|
-
const triggerClasses = (0,
|
|
2921
|
-
const listClasses = (0,
|
|
3012
|
+
const triggerClasses = (0, import_dedupe22.default)("mobius", "mobius-dropdown-menu__trigger");
|
|
3013
|
+
const listClasses = (0, import_dedupe22.default)("mobius", "mobius-dropdown-menu__list", {
|
|
2922
3014
|
"--is-open": open
|
|
2923
3015
|
});
|
|
2924
3016
|
const handleChildClick = ({ onClick }, index) => {
|
|
@@ -2928,16 +3020,16 @@ var init_DropdownMenu = __esm({
|
|
|
2928
3020
|
onClick();
|
|
2929
3021
|
}
|
|
2930
3022
|
};
|
|
2931
|
-
return /* @__PURE__ */ (0,
|
|
2932
|
-
trigger ? (0,
|
|
3023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Element, { ref, ...otherProps, className: classes, children: [
|
|
3024
|
+
trigger ? (0, import_react22.cloneElement)(trigger, {
|
|
2933
3025
|
className: triggerClasses,
|
|
2934
3026
|
open,
|
|
2935
3027
|
label,
|
|
2936
3028
|
...buttonProps
|
|
2937
|
-
}) : /* @__PURE__ */ (0,
|
|
2938
|
-
/* @__PURE__ */ (0,
|
|
2939
|
-
if ((0,
|
|
2940
|
-
return (0,
|
|
3029
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
3030
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("ul", { className: listClasses, role: "menu", children: import_react22.Children.map(children, (child, index) => {
|
|
3031
|
+
if ((0, import_react22.isValidElement)(child)) {
|
|
3032
|
+
return (0, import_react22.cloneElement)(child, {
|
|
2941
3033
|
onClick: () => handleChildClick(child.props, index),
|
|
2942
3034
|
active: index === activeId,
|
|
2943
3035
|
...itemProps[index]
|
|
@@ -2952,13 +3044,13 @@ var init_DropdownMenu = __esm({
|
|
|
2952
3044
|
});
|
|
2953
3045
|
|
|
2954
3046
|
// src/components/DropdownMenu/Item.tsx
|
|
2955
|
-
var
|
|
3047
|
+
var import_react23, import_dedupe23, import_jsx_runtime30, Item;
|
|
2956
3048
|
var init_Item = __esm({
|
|
2957
3049
|
"src/components/DropdownMenu/Item.tsx"() {
|
|
2958
3050
|
"use strict";
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
3051
|
+
import_react23 = require("react");
|
|
3052
|
+
import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
3053
|
+
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2962
3054
|
Item = ({ ref, ...props }) => {
|
|
2963
3055
|
const {
|
|
2964
3056
|
elementType: Element = "li",
|
|
@@ -2967,26 +3059,26 @@ var init_Item = __esm({
|
|
|
2967
3059
|
children,
|
|
2968
3060
|
...otherProps
|
|
2969
3061
|
} = props;
|
|
2970
|
-
const classes = (0,
|
|
3062
|
+
const classes = (0, import_dedupe23.default)(
|
|
2971
3063
|
"mobius",
|
|
2972
3064
|
"mobius-dropdown-menu__item",
|
|
2973
3065
|
{ "--is-active": active },
|
|
2974
3066
|
otherProps.className
|
|
2975
3067
|
);
|
|
2976
|
-
return /* @__PURE__ */ (0,
|
|
2977
|
-
if ((0,
|
|
2978
|
-
const childClasses = (0,
|
|
3068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Element, { ref, onClick, ...otherProps, children: import_react23.Children.map(children, (child) => {
|
|
3069
|
+
if ((0, import_react23.isValidElement)(child)) {
|
|
3070
|
+
const childClasses = (0, import_dedupe23.default)(
|
|
2979
3071
|
child.props.className,
|
|
2980
3072
|
classes
|
|
2981
3073
|
);
|
|
2982
|
-
return (0,
|
|
3074
|
+
return (0, import_react23.cloneElement)(
|
|
2983
3075
|
child,
|
|
2984
3076
|
{
|
|
2985
3077
|
className: childClasses
|
|
2986
3078
|
}
|
|
2987
3079
|
);
|
|
2988
3080
|
}
|
|
2989
|
-
return /* @__PURE__ */ (0,
|
|
3081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: classes, children: child });
|
|
2990
3082
|
}) });
|
|
2991
3083
|
};
|
|
2992
3084
|
Item.displayName = "DropdownMenu.Item";
|
|
@@ -3011,23 +3103,23 @@ var init_DropdownMenu2 = __esm({
|
|
|
3011
3103
|
});
|
|
3012
3104
|
|
|
3013
3105
|
// src/components/Fieldset/Fieldset.tsx
|
|
3014
|
-
var
|
|
3106
|
+
var import_dedupe24, import_react24, import_Fieldset, import_jsx_runtime31, useFieldset, Fieldset;
|
|
3015
3107
|
var init_Fieldset = __esm({
|
|
3016
3108
|
"src/components/Fieldset/Fieldset.tsx"() {
|
|
3017
3109
|
"use strict";
|
|
3018
3110
|
"use client";
|
|
3019
|
-
|
|
3020
|
-
|
|
3111
|
+
import_dedupe24 = __toESM(require("classnames/dedupe"));
|
|
3112
|
+
import_react24 = require("react");
|
|
3021
3113
|
init_Flex2();
|
|
3022
3114
|
import_Fieldset = require("@simplybusiness/mobius/src/components/Fieldset/Fieldset.css");
|
|
3023
|
-
|
|
3115
|
+
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3024
3116
|
useFieldset = (props) => {
|
|
3025
3117
|
const { legend } = props;
|
|
3026
3118
|
let legendProps = {};
|
|
3027
3119
|
let containerProps = {
|
|
3028
3120
|
role: "group"
|
|
3029
3121
|
};
|
|
3030
|
-
const legendId = (0,
|
|
3122
|
+
const legendId = (0, import_react24.useId)();
|
|
3031
3123
|
if (legend) {
|
|
3032
3124
|
legendProps = {
|
|
3033
3125
|
...legendProps,
|
|
@@ -3047,14 +3139,14 @@ var init_Fieldset = __esm({
|
|
|
3047
3139
|
const {
|
|
3048
3140
|
children,
|
|
3049
3141
|
legend,
|
|
3050
|
-
legendComponent = /* @__PURE__ */ (0,
|
|
3142
|
+
legendComponent = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("legend", {}),
|
|
3051
3143
|
...otherProps
|
|
3052
3144
|
} = props;
|
|
3053
3145
|
const { legendProps, containerProps } = useFieldset(props);
|
|
3054
|
-
const classes = (0,
|
|
3146
|
+
const classes = (0, import_dedupe24.default)("mobius", "mobius-fieldset", props.className);
|
|
3055
3147
|
legendProps.className = "mobius-fieldset__legend";
|
|
3056
|
-
return /* @__PURE__ */ (0,
|
|
3057
|
-
legend && (0,
|
|
3148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
3149
|
+
legend && (0, import_react24.cloneElement)(legendComponent, { ...legendProps }, [legend]),
|
|
3058
3150
|
children
|
|
3059
3151
|
] });
|
|
3060
3152
|
};
|
|
@@ -3071,13 +3163,13 @@ var init_Fieldset2 = __esm({
|
|
|
3071
3163
|
});
|
|
3072
3164
|
|
|
3073
3165
|
// src/components/Grid/Grid.tsx
|
|
3074
|
-
var
|
|
3166
|
+
var import_dedupe25, import_jsx_runtime32, Grid;
|
|
3075
3167
|
var init_Grid = __esm({
|
|
3076
3168
|
"src/components/Grid/Grid.tsx"() {
|
|
3077
3169
|
"use strict";
|
|
3078
|
-
|
|
3170
|
+
import_dedupe25 = __toESM(require("classnames/dedupe"));
|
|
3079
3171
|
init_utils();
|
|
3080
|
-
|
|
3172
|
+
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3081
3173
|
Grid = ({ ref: _ref, ...props }) => {
|
|
3082
3174
|
const {
|
|
3083
3175
|
columns = 12,
|
|
@@ -3092,7 +3184,7 @@ var init_Grid = __esm({
|
|
|
3092
3184
|
style,
|
|
3093
3185
|
...rest
|
|
3094
3186
|
} = props;
|
|
3095
|
-
const classes = (0,
|
|
3187
|
+
const classes = (0, import_dedupe25.default)("mobius", "mobius-grid", className);
|
|
3096
3188
|
const styles = filterUndefinedProps({
|
|
3097
3189
|
boxSizing: "border-box",
|
|
3098
3190
|
display: "grid",
|
|
@@ -3106,22 +3198,22 @@ var init_Grid = __esm({
|
|
|
3106
3198
|
justifyItems,
|
|
3107
3199
|
...style
|
|
3108
3200
|
});
|
|
3109
|
-
return /* @__PURE__ */ (0,
|
|
3201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: styles, className: classes, ...rest });
|
|
3110
3202
|
};
|
|
3111
3203
|
Grid.displayName = "Grid";
|
|
3112
3204
|
}
|
|
3113
3205
|
});
|
|
3114
3206
|
|
|
3115
3207
|
// src/components/Grid/Item.tsx
|
|
3116
|
-
var
|
|
3208
|
+
var import_react25, import_dedupe26, import_jsx_runtime33, getBreakpointMap, DEFAULT_SPAN, GridItem;
|
|
3117
3209
|
var init_Item2 = __esm({
|
|
3118
3210
|
"src/components/Grid/Item.tsx"() {
|
|
3119
3211
|
"use strict";
|
|
3120
3212
|
"use client";
|
|
3121
|
-
|
|
3122
|
-
|
|
3213
|
+
import_react25 = require("react");
|
|
3214
|
+
import_dedupe26 = __toESM(require("classnames/dedupe"));
|
|
3123
3215
|
init_hooks();
|
|
3124
|
-
|
|
3216
|
+
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3125
3217
|
getBreakpointMap = (config) => Object.entries(config).reduce(
|
|
3126
3218
|
(prev, [key, value]) => {
|
|
3127
3219
|
const previous = Object.values(prev);
|
|
@@ -3156,9 +3248,9 @@ var init_Item2 = __esm({
|
|
|
3156
3248
|
xl,
|
|
3157
3249
|
xxl
|
|
3158
3250
|
});
|
|
3159
|
-
const [responsiveSpan, setResponsiveSpan] = (0,
|
|
3160
|
-
const classes = (0,
|
|
3161
|
-
(0,
|
|
3251
|
+
const [responsiveSpan, setResponsiveSpan] = (0, import_react25.useState)();
|
|
3252
|
+
const classes = (0, import_dedupe26.default)("mobius-grid__item", className);
|
|
3253
|
+
(0, import_react25.useEffect)(() => {
|
|
3162
3254
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
3163
3255
|
}, [breakpointSize, breakpointMap]);
|
|
3164
3256
|
const styles = {
|
|
@@ -3166,7 +3258,7 @@ var init_Item2 = __esm({
|
|
|
3166
3258
|
alignSelf,
|
|
3167
3259
|
justifySelf
|
|
3168
3260
|
};
|
|
3169
|
-
return /* @__PURE__ */ (0,
|
|
3261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { ...styles }, className: classes, ...rest });
|
|
3170
3262
|
};
|
|
3171
3263
|
GridItem.displayName = "GridItem";
|
|
3172
3264
|
}
|
|
@@ -3187,20 +3279,20 @@ var init_Grid2 = __esm({
|
|
|
3187
3279
|
});
|
|
3188
3280
|
|
|
3189
3281
|
// src/components/Image/Image.tsx
|
|
3190
|
-
var
|
|
3282
|
+
var import_dedupe27, import_jsx_runtime34, Image;
|
|
3191
3283
|
var init_Image = __esm({
|
|
3192
3284
|
"src/components/Image/Image.tsx"() {
|
|
3193
3285
|
"use strict";
|
|
3194
|
-
|
|
3195
|
-
|
|
3286
|
+
import_dedupe27 = __toESM(require("classnames/dedupe"));
|
|
3287
|
+
import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3196
3288
|
Image = ({
|
|
3197
3289
|
ref,
|
|
3198
3290
|
alt,
|
|
3199
3291
|
elementType: Component = "img",
|
|
3200
3292
|
...otherProps
|
|
3201
3293
|
}) => {
|
|
3202
|
-
const classes = (0,
|
|
3203
|
-
return /* @__PURE__ */ (0,
|
|
3294
|
+
const classes = (0, import_dedupe27.default)("mobius", "mobius-image", otherProps.className);
|
|
3295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Component, { alt, ref, ...otherProps, className: classes });
|
|
3204
3296
|
};
|
|
3205
3297
|
Image.displayName = "Image";
|
|
3206
3298
|
}
|
|
@@ -3215,13 +3307,13 @@ var init_Image2 = __esm({
|
|
|
3215
3307
|
});
|
|
3216
3308
|
|
|
3217
3309
|
// src/components/Link/Link.tsx
|
|
3218
|
-
var
|
|
3310
|
+
var import_dedupe28, import_Link, import_jsx_runtime35, Link;
|
|
3219
3311
|
var init_Link = __esm({
|
|
3220
3312
|
"src/components/Link/Link.tsx"() {
|
|
3221
3313
|
"use strict";
|
|
3222
|
-
|
|
3314
|
+
import_dedupe28 = __toESM(require("classnames/dedupe"));
|
|
3223
3315
|
import_Link = require("@simplybusiness/mobius/src/components/Link/Link.css");
|
|
3224
|
-
|
|
3316
|
+
import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3225
3317
|
Link = ({ ref, ...props }) => {
|
|
3226
3318
|
const {
|
|
3227
3319
|
isDisabled = false,
|
|
@@ -3235,7 +3327,7 @@ var init_Link = __esm({
|
|
|
3235
3327
|
pointerEvents: "none"
|
|
3236
3328
|
};
|
|
3237
3329
|
const styles = { ...style, ...isDisabled && disabledStyles };
|
|
3238
|
-
const classes = (0,
|
|
3330
|
+
const classes = (0, import_dedupe28.default)(
|
|
3239
3331
|
"mobius",
|
|
3240
3332
|
"mobius-link",
|
|
3241
3333
|
className,
|
|
@@ -3244,7 +3336,7 @@ var init_Link = __esm({
|
|
|
3244
3336
|
"--is-disabled": isDisabled
|
|
3245
3337
|
}
|
|
3246
3338
|
);
|
|
3247
|
-
return /* @__PURE__ */ (0,
|
|
3339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3248
3340
|
Component,
|
|
3249
3341
|
{
|
|
3250
3342
|
ref,
|
|
@@ -3269,12 +3361,12 @@ var init_Link2 = __esm({
|
|
|
3269
3361
|
});
|
|
3270
3362
|
|
|
3271
3363
|
// src/components/LinkButton/LinkButton.tsx
|
|
3272
|
-
var
|
|
3364
|
+
var import_dedupe29, import_jsx_runtime36;
|
|
3273
3365
|
var init_LinkButton = __esm({
|
|
3274
3366
|
"src/components/LinkButton/LinkButton.tsx"() {
|
|
3275
3367
|
"use strict";
|
|
3276
|
-
|
|
3277
|
-
|
|
3368
|
+
import_dedupe29 = __toESM(require("classnames/dedupe"));
|
|
3369
|
+
import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3278
3370
|
}
|
|
3279
3371
|
});
|
|
3280
3372
|
|
|
@@ -3287,14 +3379,14 @@ var init_LinkButton2 = __esm({
|
|
|
3287
3379
|
});
|
|
3288
3380
|
|
|
3289
3381
|
// src/components/List/List.tsx
|
|
3290
|
-
var
|
|
3382
|
+
var import_react26, import_dedupe30, import_List, import_jsx_runtime37, List;
|
|
3291
3383
|
var init_List = __esm({
|
|
3292
3384
|
"src/components/List/List.tsx"() {
|
|
3293
3385
|
"use strict";
|
|
3294
|
-
|
|
3295
|
-
|
|
3386
|
+
import_react26 = require("react");
|
|
3387
|
+
import_dedupe30 = __toESM(require("classnames/dedupe"));
|
|
3296
3388
|
import_List = require("@simplybusiness/mobius/src/components/List/List.css");
|
|
3297
|
-
|
|
3389
|
+
import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3298
3390
|
List = ({ ref, ...props }) => {
|
|
3299
3391
|
const Component = props.isOrdered ? "ol" : "ul";
|
|
3300
3392
|
const { children, icon, ...otherProps } = props;
|
|
@@ -3303,7 +3395,7 @@ var init_List = __esm({
|
|
|
3303
3395
|
...restProps,
|
|
3304
3396
|
reversed: isReversed
|
|
3305
3397
|
};
|
|
3306
|
-
const classes = (0,
|
|
3398
|
+
const classes = (0, import_dedupe30.default)(
|
|
3307
3399
|
"mobius",
|
|
3308
3400
|
"mobius-list",
|
|
3309
3401
|
{
|
|
@@ -3312,9 +3404,9 @@ var init_List = __esm({
|
|
|
3312
3404
|
},
|
|
3313
3405
|
otherProps.className
|
|
3314
3406
|
);
|
|
3315
|
-
return /* @__PURE__ */ (0,
|
|
3316
|
-
if ((0,
|
|
3317
|
-
return (0,
|
|
3407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Component, { ref, ...mappedProps, className: classes, children: import_react26.Children.map(children, (child) => {
|
|
3408
|
+
if ((0, import_react26.isValidElement)(child)) {
|
|
3409
|
+
return (0, import_react26.cloneElement)(child, {
|
|
3318
3410
|
parentIcon: icon
|
|
3319
3411
|
});
|
|
3320
3412
|
}
|
|
@@ -3326,16 +3418,16 @@ var init_List = __esm({
|
|
|
3326
3418
|
});
|
|
3327
3419
|
|
|
3328
3420
|
// src/components/List/ListItem.tsx
|
|
3329
|
-
var
|
|
3421
|
+
var import_dedupe31, import_jsx_runtime38, ListItem;
|
|
3330
3422
|
var init_ListItem = __esm({
|
|
3331
3423
|
"src/components/List/ListItem.tsx"() {
|
|
3332
3424
|
"use strict";
|
|
3333
|
-
|
|
3334
|
-
|
|
3425
|
+
import_dedupe31 = __toESM(require("classnames/dedupe"));
|
|
3426
|
+
import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3335
3427
|
ListItem = ({ ref, ...props }) => {
|
|
3336
3428
|
const { parentIcon, icon, children, ...otherProps } = props;
|
|
3337
3429
|
const iconContent = icon || parentIcon;
|
|
3338
|
-
const classes = (0,
|
|
3430
|
+
const classes = (0, import_dedupe31.default)(
|
|
3339
3431
|
"mobius",
|
|
3340
3432
|
"mobius-list__item",
|
|
3341
3433
|
{
|
|
@@ -3343,15 +3435,15 @@ var init_ListItem = __esm({
|
|
|
3343
3435
|
},
|
|
3344
3436
|
props.className
|
|
3345
3437
|
);
|
|
3346
|
-
const contentClasses = (0,
|
|
3347
|
-
const iconClasses = (0,
|
|
3438
|
+
const contentClasses = (0, import_dedupe31.default)("mobius", "mobius-list__item-content");
|
|
3439
|
+
const iconClasses = (0, import_dedupe31.default)("mobius", "mobius-list__icon");
|
|
3348
3440
|
if (iconContent) {
|
|
3349
|
-
return /* @__PURE__ */ (0,
|
|
3350
|
-
/* @__PURE__ */ (0,
|
|
3441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: contentClasses, children: [
|
|
3442
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: iconClasses, children: iconContent }),
|
|
3351
3443
|
children
|
|
3352
3444
|
] }) });
|
|
3353
3445
|
}
|
|
3354
|
-
return /* @__PURE__ */ (0,
|
|
3446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { ref, ...otherProps, className: classes, children });
|
|
3355
3447
|
};
|
|
3356
3448
|
ListItem.displayName = "ListItem";
|
|
3357
3449
|
}
|
|
@@ -3367,23 +3459,23 @@ var init_List2 = __esm({
|
|
|
3367
3459
|
});
|
|
3368
3460
|
|
|
3369
3461
|
// src/components/LoadingIndicator/LoadingIndicator.tsx
|
|
3370
|
-
var
|
|
3462
|
+
var import_dedupe32, import_icons8, import_LoadingIndicator, import_jsx_runtime39, LoadingIndicator;
|
|
3371
3463
|
var init_LoadingIndicator = __esm({
|
|
3372
3464
|
"src/components/LoadingIndicator/LoadingIndicator.tsx"() {
|
|
3373
3465
|
"use strict";
|
|
3374
|
-
|
|
3466
|
+
import_dedupe32 = __toESM(require("classnames/dedupe"));
|
|
3375
3467
|
import_icons8 = require("@simplybusiness/icons");
|
|
3376
3468
|
init_Icon2();
|
|
3377
3469
|
import_LoadingIndicator = require("@simplybusiness/mobius/src/components/LoadingIndicator/LoadingIndicator.css");
|
|
3378
|
-
|
|
3470
|
+
import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3379
3471
|
LoadingIndicator = ({ ref, ...props }) => {
|
|
3380
3472
|
const { icon = import_icons8.loading, ...otherProps } = props;
|
|
3381
|
-
const classes = (0,
|
|
3473
|
+
const classes = (0, import_dedupe32.default)(
|
|
3382
3474
|
"mobius",
|
|
3383
3475
|
"mobius-loading-indicator",
|
|
3384
3476
|
otherProps.className
|
|
3385
3477
|
);
|
|
3386
|
-
return /* @__PURE__ */ (0,
|
|
3478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { icon, spin: true, ref, ...otherProps, className: classes });
|
|
3387
3479
|
};
|
|
3388
3480
|
LoadingIndicator.displayName = "LoadingIndicator";
|
|
3389
3481
|
}
|
|
@@ -3398,16 +3490,16 @@ var init_LoadingIndicator2 = __esm({
|
|
|
3398
3490
|
});
|
|
3399
3491
|
|
|
3400
3492
|
// src/components/Logo/Logo.tsx
|
|
3401
|
-
var
|
|
3493
|
+
var import_dedupe33, import_jsx_runtime40, Logo;
|
|
3402
3494
|
var init_Logo = __esm({
|
|
3403
3495
|
"src/components/Logo/Logo.tsx"() {
|
|
3404
3496
|
"use strict";
|
|
3405
|
-
|
|
3406
|
-
|
|
3497
|
+
import_dedupe33 = __toESM(require("classnames/dedupe"));
|
|
3498
|
+
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3407
3499
|
Logo = ({ ref, ...props }) => {
|
|
3408
3500
|
const { className, width, height, ...otherProps } = props;
|
|
3409
|
-
const classes = (0,
|
|
3410
|
-
return /* @__PURE__ */ (0,
|
|
3501
|
+
const classes = (0, import_dedupe33.default)("mobius", "mobius-logo", className);
|
|
3502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3411
3503
|
"svg",
|
|
3412
3504
|
{
|
|
3413
3505
|
width,
|
|
@@ -3417,7 +3509,7 @@ var init_Logo = __esm({
|
|
|
3417
3509
|
viewBox: "0 0 144 37",
|
|
3418
3510
|
...otherProps,
|
|
3419
3511
|
children: [
|
|
3420
|
-
/* @__PURE__ */ (0,
|
|
3512
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3421
3513
|
"linearGradient",
|
|
3422
3514
|
{
|
|
3423
3515
|
id: "logo-gradient",
|
|
@@ -3426,27 +3518,27 @@ var init_Logo = __esm({
|
|
|
3426
3518
|
y1: "76.042%",
|
|
3427
3519
|
y2: "26.973%",
|
|
3428
3520
|
children: [
|
|
3429
|
-
/* @__PURE__ */ (0,
|
|
3430
|
-
/* @__PURE__ */ (0,
|
|
3521
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("stop", { stopColor: "#4632D8", offset: "0%" }),
|
|
3522
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("stop", { stopColor: "#9084E8", offset: "100%" })
|
|
3431
3523
|
]
|
|
3432
3524
|
}
|
|
3433
3525
|
) }),
|
|
3434
|
-
/* @__PURE__ */ (0,
|
|
3435
|
-
/* @__PURE__ */ (0,
|
|
3526
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("g", { children: [
|
|
3527
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3436
3528
|
"path",
|
|
3437
3529
|
{
|
|
3438
3530
|
fill: "#0E0A2B",
|
|
3439
3531
|
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"
|
|
3440
3532
|
}
|
|
3441
3533
|
),
|
|
3442
|
-
/* @__PURE__ */ (0,
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3443
3535
|
"path",
|
|
3444
3536
|
{
|
|
3445
3537
|
fill: "url(#logo-gradient)",
|
|
3446
3538
|
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"
|
|
3447
3539
|
}
|
|
3448
3540
|
),
|
|
3449
|
-
/* @__PURE__ */ (0,
|
|
3541
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3450
3542
|
"path",
|
|
3451
3543
|
{
|
|
3452
3544
|
fill: "#0E0A2B",
|
|
@@ -3471,23 +3563,23 @@ var init_Logo2 = __esm({
|
|
|
3471
3563
|
});
|
|
3472
3564
|
|
|
3473
3565
|
// src/components/Modal/Content.tsx
|
|
3474
|
-
var
|
|
3566
|
+
var import_jsx_runtime41, Content2;
|
|
3475
3567
|
var init_Content2 = __esm({
|
|
3476
3568
|
"src/components/Modal/Content.tsx"() {
|
|
3477
3569
|
"use strict";
|
|
3478
|
-
|
|
3479
|
-
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0,
|
|
3570
|
+
import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3571
|
+
Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { ref, ...otherProps, className: "mobius-modal__content", children });
|
|
3480
3572
|
Content2.displayName = "Content";
|
|
3481
3573
|
}
|
|
3482
3574
|
});
|
|
3483
3575
|
|
|
3484
3576
|
// src/components/Modal/ModalContext.tsx
|
|
3485
|
-
var
|
|
3577
|
+
var import_react27, ModalContext;
|
|
3486
3578
|
var init_ModalContext = __esm({
|
|
3487
3579
|
"src/components/Modal/ModalContext.tsx"() {
|
|
3488
3580
|
"use strict";
|
|
3489
|
-
|
|
3490
|
-
ModalContext = (0,
|
|
3581
|
+
import_react27 = require("react");
|
|
3582
|
+
ModalContext = (0, import_react27.createContext)({
|
|
3491
3583
|
onClose: () => {
|
|
3492
3584
|
},
|
|
3493
3585
|
closeLabel: void 0
|
|
@@ -3496,21 +3588,21 @@ var init_ModalContext = __esm({
|
|
|
3496
3588
|
});
|
|
3497
3589
|
|
|
3498
3590
|
// src/components/Modal/useModal.ts
|
|
3499
|
-
var
|
|
3591
|
+
var import_react28, useModal;
|
|
3500
3592
|
var init_useModal = __esm({
|
|
3501
3593
|
"src/components/Modal/useModal.ts"() {
|
|
3502
3594
|
"use strict";
|
|
3503
|
-
|
|
3595
|
+
import_react28 = require("react");
|
|
3504
3596
|
init_ModalContext();
|
|
3505
3597
|
useModal = () => {
|
|
3506
|
-
const { onClose, closeLabel } = (0,
|
|
3598
|
+
const { onClose, closeLabel } = (0, import_react28.useContext)(ModalContext);
|
|
3507
3599
|
return { onClose, closeLabel };
|
|
3508
3600
|
};
|
|
3509
3601
|
}
|
|
3510
3602
|
});
|
|
3511
3603
|
|
|
3512
3604
|
// src/components/Modal/Header.tsx
|
|
3513
|
-
var import_icons9,
|
|
3605
|
+
var import_icons9, import_jsx_runtime42, Header2;
|
|
3514
3606
|
var init_Header2 = __esm({
|
|
3515
3607
|
"src/components/Modal/Header.tsx"() {
|
|
3516
3608
|
"use strict";
|
|
@@ -3518,12 +3610,12 @@ var init_Header2 = __esm({
|
|
|
3518
3610
|
init_Button2();
|
|
3519
3611
|
init_Icon2();
|
|
3520
3612
|
init_useModal();
|
|
3521
|
-
|
|
3613
|
+
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3522
3614
|
Header2 = ({ ref, children, ...otherProps }) => {
|
|
3523
3615
|
const { onClose, closeLabel } = useModal();
|
|
3524
|
-
return /* @__PURE__ */ (0,
|
|
3616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { ref, ...otherProps, className: "mobius-modal__header", children: [
|
|
3525
3617
|
children,
|
|
3526
|
-
/* @__PURE__ */ (0,
|
|
3618
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3527
3619
|
Button,
|
|
3528
3620
|
{
|
|
3529
3621
|
"aria-label": "Close",
|
|
@@ -3531,7 +3623,7 @@ var init_Header2 = __esm({
|
|
|
3531
3623
|
onPress: onClose,
|
|
3532
3624
|
className: "mobius-modal__close",
|
|
3533
3625
|
children: [
|
|
3534
|
-
/* @__PURE__ */ (0,
|
|
3626
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { icon: import_icons9.cross }),
|
|
3535
3627
|
" ",
|
|
3536
3628
|
closeLabel
|
|
3537
3629
|
]
|
|
@@ -3544,19 +3636,19 @@ var init_Header2 = __esm({
|
|
|
3544
3636
|
});
|
|
3545
3637
|
|
|
3546
3638
|
// src/components/Modal/Modal.tsx
|
|
3547
|
-
var
|
|
3639
|
+
var import_dedupe34, import_react29, import_Modal, import_jsx_runtime43, TRANSITION_CSS_VARIABLE2, Modal;
|
|
3548
3640
|
var init_Modal = __esm({
|
|
3549
3641
|
"src/components/Modal/Modal.tsx"() {
|
|
3550
3642
|
"use strict";
|
|
3551
3643
|
"use client";
|
|
3552
|
-
|
|
3553
|
-
|
|
3644
|
+
import_dedupe34 = __toESM(require("classnames/dedupe"));
|
|
3645
|
+
import_react29 = require("react");
|
|
3554
3646
|
init_hooks();
|
|
3555
3647
|
init_utils();
|
|
3556
3648
|
init_polyfill_tests();
|
|
3557
3649
|
init_ModalContext();
|
|
3558
3650
|
import_Modal = require("@simplybusiness/mobius/src/components/Modal/Modal.css");
|
|
3559
|
-
|
|
3651
|
+
import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3560
3652
|
TRANSITION_CSS_VARIABLE2 = "--modal-transition-duration";
|
|
3561
3653
|
Modal = ({ ref, ...props }) => {
|
|
3562
3654
|
const {
|
|
@@ -3570,11 +3662,11 @@ var init_Modal = __esm({
|
|
|
3570
3662
|
animation,
|
|
3571
3663
|
...rest
|
|
3572
3664
|
} = props;
|
|
3573
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3574
|
-
(0,
|
|
3665
|
+
const [shouldTransition, setShouldTransition] = (0, import_react29.useState)(false);
|
|
3666
|
+
(0, import_react29.useEffect)(() => {
|
|
3575
3667
|
setShouldTransition(supportsDialog());
|
|
3576
3668
|
}, []);
|
|
3577
|
-
const dialogRef = (0,
|
|
3669
|
+
const dialogRef = (0, import_react29.useRef)(null);
|
|
3578
3670
|
const { close } = useDialog({
|
|
3579
3671
|
ref: dialogRef,
|
|
3580
3672
|
isOpen,
|
|
@@ -3585,7 +3677,7 @@ var init_Modal = __esm({
|
|
|
3585
3677
|
CSSVariable: TRANSITION_CSS_VARIABLE2
|
|
3586
3678
|
}
|
|
3587
3679
|
});
|
|
3588
|
-
const modalClasses = (0,
|
|
3680
|
+
const modalClasses = (0, import_dedupe34.default)(
|
|
3589
3681
|
"mobius",
|
|
3590
3682
|
"mobius-modal",
|
|
3591
3683
|
{
|
|
@@ -3598,21 +3690,21 @@ var init_Modal = __esm({
|
|
|
3598
3690
|
},
|
|
3599
3691
|
className
|
|
3600
3692
|
);
|
|
3601
|
-
const contextValue = (0,
|
|
3693
|
+
const contextValue = (0, import_react29.useMemo)(
|
|
3602
3694
|
() => ({
|
|
3603
3695
|
onClose: close,
|
|
3604
3696
|
closeLabel
|
|
3605
3697
|
}),
|
|
3606
3698
|
[close, closeLabel]
|
|
3607
3699
|
);
|
|
3608
|
-
return /* @__PURE__ */ (0,
|
|
3700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3609
3701
|
"dialog",
|
|
3610
3702
|
{
|
|
3611
3703
|
ref: mergeRefs([dialogRef, ref]),
|
|
3612
3704
|
onCancel: close,
|
|
3613
3705
|
className: modalClasses,
|
|
3614
3706
|
...rest,
|
|
3615
|
-
children: /* @__PURE__ */ (0,
|
|
3707
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ModalContext.Provider, { value: contextValue, children })
|
|
3616
3708
|
}
|
|
3617
3709
|
);
|
|
3618
3710
|
};
|
|
@@ -3637,16 +3729,16 @@ var init_Modal2 = __esm({
|
|
|
3637
3729
|
});
|
|
3638
3730
|
|
|
3639
3731
|
// src/components/NumberField/NumberField.tsx
|
|
3640
|
-
var
|
|
3732
|
+
var import_dedupe35, import_react30, import_NumberField, import_jsx_runtime44, NumberField;
|
|
3641
3733
|
var init_NumberField = __esm({
|
|
3642
3734
|
"src/components/NumberField/NumberField.tsx"() {
|
|
3643
3735
|
"use strict";
|
|
3644
3736
|
"use client";
|
|
3645
|
-
|
|
3646
|
-
|
|
3737
|
+
import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3738
|
+
import_react30 = require("react");
|
|
3647
3739
|
init_TextField2();
|
|
3648
3740
|
import_NumberField = require("@simplybusiness/mobius/src/components/NumberField/NumberField.css");
|
|
3649
|
-
|
|
3741
|
+
import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3650
3742
|
NumberField = ({ ref, ...props }) => {
|
|
3651
3743
|
const {
|
|
3652
3744
|
minValue,
|
|
@@ -3662,15 +3754,15 @@ var init_NumberField = __esm({
|
|
|
3662
3754
|
onBlur: customOnBlur,
|
|
3663
3755
|
...rest
|
|
3664
3756
|
} = otherProps;
|
|
3665
|
-
const focusedInputRef = (0,
|
|
3666
|
-
const wheelHandler = (0,
|
|
3667
|
-
(0,
|
|
3757
|
+
const focusedInputRef = (0, import_react30.useRef)(null);
|
|
3758
|
+
const wheelHandler = (0, import_react30.useCallback)((ev) => ev.preventDefault(), []);
|
|
3759
|
+
(0, import_react30.useEffect)(() => {
|
|
3668
3760
|
return () => {
|
|
3669
3761
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
3670
3762
|
focusedInputRef.current = null;
|
|
3671
3763
|
};
|
|
3672
3764
|
}, [wheelHandler]);
|
|
3673
|
-
const containerClasses = (0,
|
|
3765
|
+
const containerClasses = (0, import_dedupe35.default)("mobius-number-field", className, {
|
|
3674
3766
|
"--hide-spin-buttons": hideSpinButtons
|
|
3675
3767
|
});
|
|
3676
3768
|
const handleBeforeInput = (event) => {
|
|
@@ -3714,7 +3806,7 @@ var init_NumberField = __esm({
|
|
|
3714
3806
|
},
|
|
3715
3807
|
onBlur: (e) => handleBlur(e)
|
|
3716
3808
|
};
|
|
3717
|
-
return /* @__PURE__ */ (0,
|
|
3809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3718
3810
|
TextField,
|
|
3719
3811
|
{
|
|
3720
3812
|
...forwardedProps,
|
|
@@ -3742,18 +3834,18 @@ var init_NumberField2 = __esm({
|
|
|
3742
3834
|
});
|
|
3743
3835
|
|
|
3744
3836
|
// src/components/Option/Option.tsx
|
|
3745
|
-
var
|
|
3837
|
+
var import_jsx_runtime45, Option2;
|
|
3746
3838
|
var init_Option2 = __esm({
|
|
3747
3839
|
"src/components/Option/Option.tsx"() {
|
|
3748
3840
|
"use strict";
|
|
3749
|
-
|
|
3841
|
+
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3750
3842
|
Option2 = ({ ref, ...props }) => {
|
|
3751
3843
|
const { isDisabled, ...rest } = props;
|
|
3752
3844
|
const mappedProps = {
|
|
3753
3845
|
...rest,
|
|
3754
3846
|
disabled: isDisabled
|
|
3755
3847
|
};
|
|
3756
|
-
return /* @__PURE__ */ (0,
|
|
3848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("option", { ...mappedProps, ref });
|
|
3757
3849
|
};
|
|
3758
3850
|
Option2.displayName = "Option";
|
|
3759
3851
|
}
|
|
@@ -3768,17 +3860,17 @@ var init_Option3 = __esm({
|
|
|
3768
3860
|
});
|
|
3769
3861
|
|
|
3770
3862
|
// src/components/PasswordField/ShowHideButton.tsx
|
|
3771
|
-
var import_icons10,
|
|
3863
|
+
var import_icons10, import_jsx_runtime46, ShowHideButton;
|
|
3772
3864
|
var init_ShowHideButton = __esm({
|
|
3773
3865
|
"src/components/PasswordField/ShowHideButton.tsx"() {
|
|
3774
3866
|
"use strict";
|
|
3775
3867
|
import_icons10 = require("@simplybusiness/icons");
|
|
3776
3868
|
init_src();
|
|
3777
|
-
|
|
3869
|
+
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3778
3870
|
ShowHideButton = ({
|
|
3779
3871
|
show = false,
|
|
3780
3872
|
onClick
|
|
3781
|
-
}) => /* @__PURE__ */ (0,
|
|
3873
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3782
3874
|
"button",
|
|
3783
3875
|
{
|
|
3784
3876
|
className: "mobius-password-field__show-button",
|
|
@@ -3789,35 +3881,35 @@ var init_ShowHideButton = __esm({
|
|
|
3789
3881
|
},
|
|
3790
3882
|
"aria-label": `${show ? "Hide" : "Show"} password`,
|
|
3791
3883
|
"data-testid": "show-hide-button",
|
|
3792
|
-
children: /* @__PURE__ */ (0,
|
|
3884
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Icon, { icon: show ? import_icons10.eyeSlash : import_icons10.eye, "aria-hidden": "true" })
|
|
3793
3885
|
}
|
|
3794
3886
|
);
|
|
3795
3887
|
}
|
|
3796
3888
|
});
|
|
3797
3889
|
|
|
3798
3890
|
// src/components/PasswordField/PasswordField.tsx
|
|
3799
|
-
var
|
|
3891
|
+
var import_dedupe36, import_react31, import_PasswordField, import_jsx_runtime47, PasswordField;
|
|
3800
3892
|
var init_PasswordField = __esm({
|
|
3801
3893
|
"src/components/PasswordField/PasswordField.tsx"() {
|
|
3802
3894
|
"use strict";
|
|
3803
3895
|
"use client";
|
|
3804
|
-
|
|
3805
|
-
|
|
3896
|
+
import_dedupe36 = __toESM(require("classnames/dedupe"));
|
|
3897
|
+
import_react31 = require("react");
|
|
3806
3898
|
init_mergeRefs();
|
|
3807
3899
|
init_TextField2();
|
|
3808
3900
|
init_ShowHideButton();
|
|
3809
3901
|
import_PasswordField = require("@simplybusiness/mobius/src/components/PasswordField/PasswordField.css");
|
|
3810
|
-
|
|
3902
|
+
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3811
3903
|
PasswordField = ({
|
|
3812
3904
|
ref,
|
|
3813
3905
|
className,
|
|
3814
3906
|
autoComplete = "current-password",
|
|
3815
3907
|
...props
|
|
3816
3908
|
}) => {
|
|
3817
|
-
const [show, setShow] = (0,
|
|
3909
|
+
const [show, setShow] = (0, import_react31.useState)(false);
|
|
3818
3910
|
const type = show ? "text" : "password";
|
|
3819
|
-
const classes = (0,
|
|
3820
|
-
const localRef = (0,
|
|
3911
|
+
const classes = (0, import_dedupe36.default)("mobius-password-field", className);
|
|
3912
|
+
const localRef = (0, import_react31.useRef)(null);
|
|
3821
3913
|
const handleShowHideButtonClick = () => {
|
|
3822
3914
|
const selectionStart = localRef.current?.selectionStart;
|
|
3823
3915
|
const selectionEnd = localRef.current?.selectionEnd;
|
|
@@ -3829,7 +3921,7 @@ var init_PasswordField = __esm({
|
|
|
3829
3921
|
}
|
|
3830
3922
|
});
|
|
3831
3923
|
};
|
|
3832
|
-
return /* @__PURE__ */ (0,
|
|
3924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3833
3925
|
TextField,
|
|
3834
3926
|
{
|
|
3835
3927
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -3837,7 +3929,7 @@ var init_PasswordField = __esm({
|
|
|
3837
3929
|
...props,
|
|
3838
3930
|
autoComplete,
|
|
3839
3931
|
type,
|
|
3840
|
-
suffixInside: /* @__PURE__ */ (0,
|
|
3932
|
+
suffixInside: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ShowHideButton, { onClick: handleShowHideButtonClick, show })
|
|
3841
3933
|
}
|
|
3842
3934
|
);
|
|
3843
3935
|
};
|
|
@@ -3854,17 +3946,17 @@ var init_PasswordField2 = __esm({
|
|
|
3854
3946
|
});
|
|
3855
3947
|
|
|
3856
3948
|
// src/components/Popover/Popover.tsx
|
|
3857
|
-
var
|
|
3949
|
+
var import_react32, import_icons11, import_dedupe37, import_react33, import_mobius_hooks6, import_Popover, import_jsx_runtime48;
|
|
3858
3950
|
var init_Popover = __esm({
|
|
3859
3951
|
"src/components/Popover/Popover.tsx"() {
|
|
3860
3952
|
"use strict";
|
|
3861
|
-
|
|
3953
|
+
import_react32 = require("@floating-ui/react");
|
|
3862
3954
|
import_icons11 = require("@simplybusiness/icons");
|
|
3863
|
-
|
|
3864
|
-
|
|
3955
|
+
import_dedupe37 = __toESM(require("classnames/dedupe"));
|
|
3956
|
+
import_react33 = require("react");
|
|
3865
3957
|
import_mobius_hooks6 = require("@simplybusiness/mobius-hooks");
|
|
3866
3958
|
import_Popover = require("@simplybusiness/mobius/src/components/Popover/Popover.css");
|
|
3867
|
-
|
|
3959
|
+
import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3868
3960
|
}
|
|
3869
3961
|
});
|
|
3870
3962
|
|
|
@@ -3888,17 +3980,17 @@ function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
|
3888
3980
|
console.warn("Progress value is greater than maxValue");
|
|
3889
3981
|
}
|
|
3890
3982
|
}
|
|
3891
|
-
var
|
|
3983
|
+
var import_dedupe38, import_react34, import_Progress, import_jsx_runtime49, sanitizedValue, getLabelComponent, DEFAULT_VALUE, DEFAULT_MIN_VALUE, DEFAULT_MAX_VALUE, Progress;
|
|
3892
3984
|
var init_Progress = __esm({
|
|
3893
3985
|
"src/components/Progress/Progress.tsx"() {
|
|
3894
3986
|
"use strict";
|
|
3895
3987
|
"use client";
|
|
3896
|
-
|
|
3897
|
-
|
|
3988
|
+
import_dedupe38 = __toESM(require("classnames/dedupe"));
|
|
3989
|
+
import_react34 = require("react");
|
|
3898
3990
|
init_Label2();
|
|
3899
3991
|
init_VisuallyHidden2();
|
|
3900
3992
|
import_Progress = require("@simplybusiness/mobius/src/components/Progress/Progress.css");
|
|
3901
|
-
|
|
3993
|
+
import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3902
3994
|
sanitizedValue = (value, defaultValue) => {
|
|
3903
3995
|
if (value === void 0 || Number.isNaN(value)) {
|
|
3904
3996
|
return defaultValue;
|
|
@@ -3907,7 +3999,7 @@ var init_Progress = __esm({
|
|
|
3907
3999
|
};
|
|
3908
4000
|
getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
3909
4001
|
if (showLabel) {
|
|
3910
|
-
return /* @__PURE__ */ (0,
|
|
4002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3911
4003
|
Label,
|
|
3912
4004
|
{
|
|
3913
4005
|
id: progressLabelId,
|
|
@@ -3917,7 +4009,7 @@ var init_Progress = __esm({
|
|
|
3917
4009
|
}
|
|
3918
4010
|
);
|
|
3919
4011
|
}
|
|
3920
|
-
return /* @__PURE__ */ (0,
|
|
4012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3921
4013
|
Label,
|
|
3922
4014
|
{
|
|
3923
4015
|
id: progressLabelId,
|
|
@@ -3931,8 +4023,8 @@ var init_Progress = __esm({
|
|
|
3931
4023
|
DEFAULT_MIN_VALUE = 0;
|
|
3932
4024
|
DEFAULT_MAX_VALUE = 100;
|
|
3933
4025
|
Progress = ({ ref, ...props }) => {
|
|
3934
|
-
const progressId = (0,
|
|
3935
|
-
const progressLabelId = (0,
|
|
4026
|
+
const progressId = (0, import_react34.useId)();
|
|
4027
|
+
const progressLabelId = (0, import_react34.useId)();
|
|
3936
4028
|
const {
|
|
3937
4029
|
id,
|
|
3938
4030
|
label,
|
|
@@ -3957,7 +4049,7 @@ var init_Progress = __esm({
|
|
|
3957
4049
|
100
|
|
3958
4050
|
);
|
|
3959
4051
|
const barWidth = `${percentage}%`;
|
|
3960
|
-
const classes = (0,
|
|
4052
|
+
const classes = (0, import_dedupe38.default)("mobius", "mobius-progress", className, {
|
|
3961
4053
|
"--is-primary": variant === "primary",
|
|
3962
4054
|
"--is-secondary": variant === "secondary"
|
|
3963
4055
|
});
|
|
@@ -3967,7 +4059,7 @@ var init_Progress = __esm({
|
|
|
3967
4059
|
progressBarProps["aria-valuenow"] = value.toString();
|
|
3968
4060
|
progressBarProps["aria-valuetext"] = valueFormatter instanceof Function ? valueFormatter(value, minValue, maxValue) : barWidth;
|
|
3969
4061
|
const labelComponent = getLabelComponent(label, progressLabelId, showLabel);
|
|
3970
|
-
return /* @__PURE__ */ (0,
|
|
4062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3971
4063
|
"div",
|
|
3972
4064
|
{
|
|
3973
4065
|
id: id || progressId,
|
|
@@ -3978,8 +4070,8 @@ var init_Progress = __esm({
|
|
|
3978
4070
|
"aria-labelledby": progressLabelId,
|
|
3979
4071
|
children: [
|
|
3980
4072
|
labelComponent,
|
|
3981
|
-
/* @__PURE__ */ (0,
|
|
3982
|
-
showValueLabel && /* @__PURE__ */ (0,
|
|
4073
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mobius-progress__track", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mobius-progress__bar", style: { width: barWidth } }) }),
|
|
4074
|
+
showValueLabel && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
|
|
3983
4075
|
]
|
|
3984
4076
|
}
|
|
3985
4077
|
);
|
|
@@ -3997,17 +4089,17 @@ var init_Progress2 = __esm({
|
|
|
3997
4089
|
});
|
|
3998
4090
|
|
|
3999
4091
|
// src/components/Radio/Radio.tsx
|
|
4000
|
-
var
|
|
4092
|
+
var import_dedupe39, import_react35, import_Radio, import_jsx_runtime50, Radio;
|
|
4001
4093
|
var init_Radio = __esm({
|
|
4002
4094
|
"src/components/Radio/Radio.tsx"() {
|
|
4003
4095
|
"use strict";
|
|
4004
4096
|
"use client";
|
|
4005
|
-
|
|
4006
|
-
|
|
4097
|
+
import_dedupe39 = __toESM(require("classnames/dedupe"));
|
|
4098
|
+
import_react35 = require("react");
|
|
4007
4099
|
init_ErrorMessage2();
|
|
4008
4100
|
init_Label2();
|
|
4009
4101
|
import_Radio = require("@simplybusiness/mobius/src/components/Radio/Radio.css");
|
|
4010
|
-
|
|
4102
|
+
import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4011
4103
|
Radio = ({ ref, ...props }) => {
|
|
4012
4104
|
const {
|
|
4013
4105
|
children,
|
|
@@ -4031,19 +4123,19 @@ var init_Radio = __esm({
|
|
|
4031
4123
|
const isMultiline = label && children;
|
|
4032
4124
|
const isControlled = selected !== void 0;
|
|
4033
4125
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
4034
|
-
const contentRef = (0,
|
|
4035
|
-
const prevOverflowRef = (0,
|
|
4126
|
+
const contentRef = (0, import_react35.useRef)(null);
|
|
4127
|
+
const prevOverflowRef = (0, import_react35.useRef)({
|
|
4036
4128
|
vertical: false,
|
|
4037
4129
|
horizontal: false
|
|
4038
4130
|
});
|
|
4039
|
-
const hasIconFirst = (0,
|
|
4040
|
-
if (!children ||
|
|
4041
|
-
const firstChild =
|
|
4042
|
-
if (!(0,
|
|
4131
|
+
const hasIconFirst = (0, import_react35.useMemo)(() => {
|
|
4132
|
+
if (!children || import_react35.Children.count(children) === 0) return false;
|
|
4133
|
+
const firstChild = import_react35.Children.toArray(children)[0];
|
|
4134
|
+
if (!(0, import_react35.isValidElement)(firstChild)) return false;
|
|
4043
4135
|
const props2 = firstChild.props;
|
|
4044
4136
|
return "icon" in props2 && props2.icon !== void 0;
|
|
4045
4137
|
}, [children]);
|
|
4046
|
-
(0,
|
|
4138
|
+
(0, import_react35.useLayoutEffect)(() => {
|
|
4047
4139
|
if (!contentRef.current || !onOverflow) return;
|
|
4048
4140
|
if (orientation === "vertical") {
|
|
4049
4141
|
return;
|
|
@@ -4072,13 +4164,13 @@ var init_Radio = __esm({
|
|
|
4072
4164
|
"--is-multiline": !!isMultiline,
|
|
4073
4165
|
"--is-required": isRequired
|
|
4074
4166
|
};
|
|
4075
|
-
const containerClasses = (0,
|
|
4167
|
+
const containerClasses = (0, import_dedupe39.default)(
|
|
4076
4168
|
"mobius-radio__label",
|
|
4077
4169
|
radioClasses,
|
|
4078
4170
|
className,
|
|
4079
4171
|
{ "--has-icon-first": hasIconFirst }
|
|
4080
4172
|
);
|
|
4081
|
-
const inputClasses = (0,
|
|
4173
|
+
const inputClasses = (0, import_dedupe39.default)("mobius-radio__input", radioClasses);
|
|
4082
4174
|
const { "aria-describedby": _ariaDescribedBy, ...rest } = otherProps;
|
|
4083
4175
|
const handleChange = (event) => {
|
|
4084
4176
|
if (setSelected) {
|
|
@@ -4092,9 +4184,9 @@ var init_Radio = __esm({
|
|
|
4092
4184
|
onChange(adaptedEvent);
|
|
4093
4185
|
}
|
|
4094
4186
|
};
|
|
4095
|
-
return /* @__PURE__ */ (0,
|
|
4096
|
-
/* @__PURE__ */ (0,
|
|
4097
|
-
/* @__PURE__ */ (0,
|
|
4187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Label, { className: containerClasses, children: [
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4098
4190
|
"input",
|
|
4099
4191
|
{
|
|
4100
4192
|
"aria-describedby": otherProps["aria-describedby"],
|
|
@@ -4111,12 +4203,12 @@ var init_Radio = __esm({
|
|
|
4111
4203
|
...rest
|
|
4112
4204
|
}
|
|
4113
4205
|
),
|
|
4114
|
-
isMultiline ? /* @__PURE__ */ (0,
|
|
4115
|
-
/* @__PURE__ */ (0,
|
|
4116
|
-
/* @__PURE__ */ (0,
|
|
4117
|
-
] }) : /* @__PURE__ */ (0,
|
|
4206
|
+
isMultiline ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { ref: contentRef, className: "mobius-radio__content--multiline", children: [
|
|
4207
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mobius-radio__content-first-line", children: label }),
|
|
4208
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mobius-radio__extra-content", children })
|
|
4209
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ref: contentRef, className: "mobius-radio__content", children: label || children })
|
|
4118
4210
|
] }),
|
|
4119
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
4211
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ErrorMessage, { errorMessage })
|
|
4120
4212
|
] });
|
|
4121
4213
|
};
|
|
4122
4214
|
Radio.displayName = "Radio";
|
|
@@ -4124,19 +4216,19 @@ var init_Radio = __esm({
|
|
|
4124
4216
|
});
|
|
4125
4217
|
|
|
4126
4218
|
// src/components/Radio/RadioGroup.tsx
|
|
4127
|
-
var
|
|
4219
|
+
var import_dedupe40, import_react36, import_jsx_runtime51, getDefaultVal, RadioGroup;
|
|
4128
4220
|
var init_RadioGroup = __esm({
|
|
4129
4221
|
"src/components/Radio/RadioGroup.tsx"() {
|
|
4130
4222
|
"use strict";
|
|
4131
4223
|
"use client";
|
|
4132
|
-
|
|
4133
|
-
|
|
4224
|
+
import_dedupe40 = __toESM(require("classnames/dedupe"));
|
|
4225
|
+
import_react36 = require("react");
|
|
4134
4226
|
init_hooks();
|
|
4135
4227
|
init_spaceDelimitedList();
|
|
4136
4228
|
init_ErrorMessage2();
|
|
4137
4229
|
init_Label2();
|
|
4138
4230
|
init_Stack2();
|
|
4139
|
-
|
|
4231
|
+
import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4140
4232
|
getDefaultVal = (children, defaultValue) => {
|
|
4141
4233
|
if (Array.isArray(children) && defaultValue) {
|
|
4142
4234
|
const option = children?.find((item) => item.props.value === defaultValue);
|
|
@@ -4164,15 +4256,15 @@ var init_RadioGroup = __esm({
|
|
|
4164
4256
|
...rest
|
|
4165
4257
|
} = props;
|
|
4166
4258
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
4167
|
-
const [selected, setSelected] = (0,
|
|
4168
|
-
const overflowsRef = (0,
|
|
4169
|
-
const [hasOverflow, setHasOverflow] = (0,
|
|
4170
|
-
(0,
|
|
4259
|
+
const [selected, setSelected] = (0, import_react36.useState)(defaultSelected);
|
|
4260
|
+
const overflowsRef = (0, import_react36.useRef)({});
|
|
4261
|
+
const [hasOverflow, setHasOverflow] = (0, import_react36.useState)(false);
|
|
4262
|
+
(0, import_react36.useEffect)(() => {
|
|
4171
4263
|
if (value !== void 0) {
|
|
4172
4264
|
setSelected(value);
|
|
4173
4265
|
}
|
|
4174
4266
|
}, [value]);
|
|
4175
|
-
const handleOverflow = (0,
|
|
4267
|
+
const handleOverflow = (0, import_react36.useCallback)(
|
|
4176
4268
|
(radioValue, overflow) => {
|
|
4177
4269
|
overflowsRef.current = {
|
|
4178
4270
|
...overflowsRef.current,
|
|
@@ -4196,26 +4288,26 @@ var init_RadioGroup = __esm({
|
|
|
4196
4288
|
[`--is-${effectiveOrientation}`]: true,
|
|
4197
4289
|
[className || ""]: true
|
|
4198
4290
|
};
|
|
4199
|
-
const radioGroupClasses = (0,
|
|
4291
|
+
const radioGroupClasses = (0, import_dedupe40.default)(
|
|
4200
4292
|
"mobius",
|
|
4201
4293
|
"mobius-radio-group",
|
|
4202
4294
|
radioClasses,
|
|
4203
4295
|
validationClasses
|
|
4204
4296
|
);
|
|
4205
|
-
const radioWrapperClasses = (0,
|
|
4297
|
+
const radioWrapperClasses = (0, import_dedupe40.default)("mobius-radio__wrapper", {
|
|
4206
4298
|
[`--is-${effectiveOrientation}`]: true
|
|
4207
4299
|
});
|
|
4208
|
-
const labelClasses = (0,
|
|
4209
|
-
const errorMessageId = (0,
|
|
4210
|
-
const defaultNameAttrId = (0,
|
|
4300
|
+
const labelClasses = (0, import_dedupe40.default)(radioClasses, validationClasses);
|
|
4301
|
+
const errorMessageId = (0, import_react36.useId)();
|
|
4302
|
+
const defaultNameAttrId = (0, import_react36.useId)();
|
|
4211
4303
|
const nameAttribute = name || defaultNameAttrId;
|
|
4212
4304
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4213
4305
|
const describedBy = spaceDelimitedList([
|
|
4214
4306
|
shouldErrorMessageShow,
|
|
4215
4307
|
props["aria-describedby"]
|
|
4216
4308
|
]);
|
|
4217
|
-
const labelId = (0,
|
|
4218
|
-
return /* @__PURE__ */ (0,
|
|
4309
|
+
const labelId = (0, import_react36.useId)();
|
|
4310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4219
4311
|
"div",
|
|
4220
4312
|
{
|
|
4221
4313
|
...rest,
|
|
@@ -4231,12 +4323,12 @@ var init_RadioGroup = __esm({
|
|
|
4231
4323
|
ref,
|
|
4232
4324
|
className: radioGroupClasses,
|
|
4233
4325
|
role: "radiogroup",
|
|
4234
|
-
children: /* @__PURE__ */ (0,
|
|
4235
|
-
label && /* @__PURE__ */ (0,
|
|
4236
|
-
/* @__PURE__ */ (0,
|
|
4237
|
-
if ((0,
|
|
4326
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Stack, { gap: "xs", children: [
|
|
4327
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
4328
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: radioWrapperClasses, children: import_react36.Children.map(children, (child) => {
|
|
4329
|
+
if ((0, import_react36.isValidElement)(child)) {
|
|
4238
4330
|
const childValue = child.props.value;
|
|
4239
|
-
return (0,
|
|
4331
|
+
return (0, import_react36.cloneElement)(
|
|
4240
4332
|
child,
|
|
4241
4333
|
{
|
|
4242
4334
|
orientation: effectiveOrientation,
|
|
@@ -4254,7 +4346,7 @@ var init_RadioGroup = __esm({
|
|
|
4254
4346
|
}
|
|
4255
4347
|
return child;
|
|
4256
4348
|
}) }),
|
|
4257
|
-
/* @__PURE__ */ (0,
|
|
4349
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4258
4350
|
] })
|
|
4259
4351
|
}
|
|
4260
4352
|
);
|
|
@@ -4273,47 +4365,47 @@ var init_Radio2 = __esm({
|
|
|
4273
4365
|
});
|
|
4274
4366
|
|
|
4275
4367
|
// src/components/Segment/SegmentGroup.tsx
|
|
4276
|
-
var
|
|
4368
|
+
var import_dedupe41, import_jsx_runtime52, SegmentGroup;
|
|
4277
4369
|
var init_SegmentGroup = __esm({
|
|
4278
4370
|
"src/components/Segment/SegmentGroup.tsx"() {
|
|
4279
4371
|
"use strict";
|
|
4280
|
-
|
|
4281
|
-
|
|
4372
|
+
import_dedupe41 = __toESM(require("classnames/dedupe"));
|
|
4373
|
+
import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4282
4374
|
SegmentGroup = (props) => {
|
|
4283
4375
|
const { children, horizontal, gap, className, ...rest } = props;
|
|
4284
4376
|
const gapClass = gap ? `gap-${gap}` : "";
|
|
4285
|
-
const classes = (0,
|
|
4377
|
+
const classes = (0, import_dedupe41.default)(
|
|
4286
4378
|
"mobius",
|
|
4287
4379
|
"mobius-segment-group",
|
|
4288
4380
|
className,
|
|
4289
4381
|
{ "--is-horizontal": horizontal },
|
|
4290
4382
|
gapClass
|
|
4291
4383
|
);
|
|
4292
|
-
return /* @__PURE__ */ (0,
|
|
4384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: classes, ...rest, children });
|
|
4293
4385
|
};
|
|
4294
4386
|
SegmentGroup.displayName = "SegmentGroup";
|
|
4295
4387
|
}
|
|
4296
4388
|
});
|
|
4297
4389
|
|
|
4298
4390
|
// src/components/Segment/Segment.tsx
|
|
4299
|
-
var
|
|
4391
|
+
var import_dedupe42, import_Segment, import_jsx_runtime53, Segment;
|
|
4300
4392
|
var init_Segment = __esm({
|
|
4301
4393
|
"src/components/Segment/Segment.tsx"() {
|
|
4302
4394
|
"use strict";
|
|
4303
|
-
|
|
4395
|
+
import_dedupe42 = __toESM(require("classnames/dedupe"));
|
|
4304
4396
|
import_Segment = require("@simplybusiness/mobius/src/components/Segment/Segment.css");
|
|
4305
|
-
|
|
4397
|
+
import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4306
4398
|
Segment = (props) => {
|
|
4307
4399
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
4308
|
-
const classes = (0,
|
|
4400
|
+
const classes = (0, import_dedupe42.default)(
|
|
4309
4401
|
"mobius",
|
|
4310
4402
|
"mobius-segment",
|
|
4311
4403
|
colour,
|
|
4312
4404
|
{ inverted },
|
|
4313
4405
|
className
|
|
4314
4406
|
);
|
|
4315
|
-
return /* @__PURE__ */ (0,
|
|
4316
|
-
heading && /* @__PURE__ */ (0,
|
|
4407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: classes, ...rest, children: [
|
|
4408
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mobius-segment__heading", children: heading }),
|
|
4317
4409
|
children
|
|
4318
4410
|
] });
|
|
4319
4411
|
};
|
|
@@ -4331,14 +4423,14 @@ var init_Segment2 = __esm({
|
|
|
4331
4423
|
});
|
|
4332
4424
|
|
|
4333
4425
|
// src/components/Select/Select.tsx
|
|
4334
|
-
var import_icons12,
|
|
4426
|
+
var import_icons12, import_dedupe43, import_react37, import_Select, import_jsx_runtime54, Select;
|
|
4335
4427
|
var init_Select = __esm({
|
|
4336
4428
|
"src/components/Select/Select.tsx"() {
|
|
4337
4429
|
"use strict";
|
|
4338
4430
|
"use client";
|
|
4339
4431
|
import_icons12 = require("@simplybusiness/icons");
|
|
4340
|
-
|
|
4341
|
-
|
|
4432
|
+
import_dedupe43 = __toESM(require("classnames/dedupe"));
|
|
4433
|
+
import_react37 = require("react");
|
|
4342
4434
|
init_hooks();
|
|
4343
4435
|
init_useLabel2();
|
|
4344
4436
|
init_spaceDelimitedList();
|
|
@@ -4347,7 +4439,7 @@ var init_Select = __esm({
|
|
|
4347
4439
|
init_Label2();
|
|
4348
4440
|
init_Stack2();
|
|
4349
4441
|
import_Select = require("@simplybusiness/mobius/src/components/Select/Select.css");
|
|
4350
|
-
|
|
4442
|
+
import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4351
4443
|
Select = ({ ref, ...props }) => {
|
|
4352
4444
|
const {
|
|
4353
4445
|
label,
|
|
@@ -4368,24 +4460,24 @@ var init_Select = __esm({
|
|
|
4368
4460
|
"--is-required": typeof isRequired === "boolean" && isRequired,
|
|
4369
4461
|
"--is-optional": typeof isRequired === "boolean" && !isRequired
|
|
4370
4462
|
};
|
|
4371
|
-
const sharedClasses = (0,
|
|
4372
|
-
const wrapperClasses = (0,
|
|
4463
|
+
const sharedClasses = (0, import_dedupe43.default)(validationClasses, stateClasses);
|
|
4464
|
+
const wrapperClasses = (0, import_dedupe43.default)(
|
|
4373
4465
|
"mobius-select__wrapper",
|
|
4374
4466
|
sharedClasses,
|
|
4375
4467
|
otherProps.className
|
|
4376
4468
|
);
|
|
4377
|
-
const selectClasses = (0,
|
|
4469
|
+
const selectClasses = (0, import_dedupe43.default)(
|
|
4378
4470
|
"mobius-select",
|
|
4379
4471
|
sharedClasses,
|
|
4380
4472
|
otherProps.className
|
|
4381
4473
|
);
|
|
4382
|
-
const labelClasses = (0,
|
|
4474
|
+
const labelClasses = (0, import_dedupe43.default)(
|
|
4383
4475
|
"mobius-label",
|
|
4384
4476
|
sharedClasses,
|
|
4385
4477
|
otherProps.className
|
|
4386
4478
|
);
|
|
4387
|
-
const iconClasses = (0,
|
|
4388
|
-
const errorMessageId = (0,
|
|
4479
|
+
const iconClasses = (0, import_dedupe43.default)("mobius-select__icon", sharedClasses);
|
|
4480
|
+
const errorMessageId = (0, import_react37.useId)();
|
|
4389
4481
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4390
4482
|
const describedBy = spaceDelimitedList([
|
|
4391
4483
|
shouldErrorMessageShow,
|
|
@@ -4396,10 +4488,10 @@ var init_Select = __esm({
|
|
|
4396
4488
|
onChange(e);
|
|
4397
4489
|
}
|
|
4398
4490
|
};
|
|
4399
|
-
return /* @__PURE__ */ (0,
|
|
4400
|
-
label && /* @__PURE__ */ (0,
|
|
4401
|
-
/* @__PURE__ */ (0,
|
|
4402
|
-
/* @__PURE__ */ (0,
|
|
4491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
|
|
4492
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
4493
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: wrapperClasses, children: [
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4403
4495
|
"select",
|
|
4404
4496
|
{
|
|
4405
4497
|
...otherProps,
|
|
@@ -4415,9 +4507,9 @@ var init_Select = __esm({
|
|
|
4415
4507
|
onChange: handleChange
|
|
4416
4508
|
}
|
|
4417
4509
|
),
|
|
4418
|
-
/* @__PURE__ */ (0,
|
|
4510
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { icon: import_icons12.chevronDown }) })
|
|
4419
4511
|
] }),
|
|
4420
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
4512
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
4421
4513
|
] });
|
|
4422
4514
|
};
|
|
4423
4515
|
Select.displayName = "Select";
|
|
@@ -4433,15 +4525,15 @@ var init_Select2 = __esm({
|
|
|
4433
4525
|
});
|
|
4434
4526
|
|
|
4435
4527
|
// src/components/Slider/Slider.tsx
|
|
4436
|
-
var
|
|
4528
|
+
var import_dedupe44, import_react38, import_Slider, import_jsx_runtime55;
|
|
4437
4529
|
var init_Slider = __esm({
|
|
4438
4530
|
"src/components/Slider/Slider.tsx"() {
|
|
4439
4531
|
"use strict";
|
|
4440
4532
|
"use client";
|
|
4441
|
-
|
|
4442
|
-
|
|
4533
|
+
import_dedupe44 = __toESM(require("classnames/dedupe"));
|
|
4534
|
+
import_react38 = require("react");
|
|
4443
4535
|
import_Slider = require("@simplybusiness/mobius/src/components/Slider/Slider.css");
|
|
4444
|
-
|
|
4536
|
+
import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4445
4537
|
}
|
|
4446
4538
|
});
|
|
4447
4539
|
|
|
@@ -4454,19 +4546,19 @@ var init_Slider2 = __esm({
|
|
|
4454
4546
|
});
|
|
4455
4547
|
|
|
4456
4548
|
// src/components/SVG/SVG.tsx
|
|
4457
|
-
var
|
|
4549
|
+
var import_react39, import_dedupe45, import_jsx_runtime56, SVG;
|
|
4458
4550
|
var init_SVG = __esm({
|
|
4459
4551
|
"src/components/SVG/SVG.tsx"() {
|
|
4460
4552
|
"use strict";
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4553
|
+
import_react39 = require("react");
|
|
4554
|
+
import_dedupe45 = __toESM(require("classnames/dedupe"));
|
|
4555
|
+
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4464
4556
|
SVG = ({ ref, ...props }) => {
|
|
4465
4557
|
const { children, className, ...otherProps } = props;
|
|
4466
|
-
const classes = (0,
|
|
4467
|
-
const svgNode =
|
|
4558
|
+
const classes = (0, import_dedupe45.default)("mobius", "mobius-svg", className);
|
|
4559
|
+
const svgNode = import_react39.Children.only(children);
|
|
4468
4560
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
4469
|
-
return /* @__PURE__ */ (0,
|
|
4561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4470
4562
|
"svg",
|
|
4471
4563
|
{
|
|
4472
4564
|
viewBox,
|
|
@@ -4491,16 +4583,16 @@ var init_SVG2 = __esm({
|
|
|
4491
4583
|
});
|
|
4492
4584
|
|
|
4493
4585
|
// src/components/Switch/Switch.tsx
|
|
4494
|
-
var
|
|
4586
|
+
var import_react40, import_dedupe46, import_Switch, import_jsx_runtime57, Switch;
|
|
4495
4587
|
var init_Switch = __esm({
|
|
4496
4588
|
"src/components/Switch/Switch.tsx"() {
|
|
4497
4589
|
"use strict";
|
|
4498
4590
|
"use client";
|
|
4499
|
-
|
|
4500
|
-
|
|
4591
|
+
import_react40 = require("react");
|
|
4592
|
+
import_dedupe46 = __toESM(require("classnames/dedupe"));
|
|
4501
4593
|
init_VisuallyHidden2();
|
|
4502
4594
|
import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
|
|
4503
|
-
|
|
4595
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4504
4596
|
Switch = ({ ref, ...props }) => {
|
|
4505
4597
|
const {
|
|
4506
4598
|
checked = false,
|
|
@@ -4509,11 +4601,11 @@ var init_Switch = __esm({
|
|
|
4509
4601
|
isDisabled = false,
|
|
4510
4602
|
...otherProps
|
|
4511
4603
|
} = props;
|
|
4512
|
-
const [enabled, setEnabled] = (0,
|
|
4513
|
-
(0,
|
|
4604
|
+
const [enabled, setEnabled] = (0, import_react40.useState)(checked);
|
|
4605
|
+
(0, import_react40.useEffect)(() => {
|
|
4514
4606
|
setEnabled(checked);
|
|
4515
4607
|
}, [checked]);
|
|
4516
|
-
const classes = (0,
|
|
4608
|
+
const classes = (0, import_dedupe46.default)(
|
|
4517
4609
|
"mobius",
|
|
4518
4610
|
"mobius-switch",
|
|
4519
4611
|
{
|
|
@@ -4528,9 +4620,9 @@ var init_Switch = __esm({
|
|
|
4528
4620
|
onChange(event);
|
|
4529
4621
|
}
|
|
4530
4622
|
};
|
|
4531
|
-
return /* @__PURE__ */ (0,
|
|
4532
|
-
/* @__PURE__ */ (0,
|
|
4533
|
-
/* @__PURE__ */ (0,
|
|
4623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("label", { ref, className: classes, children: [
|
|
4624
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: enabled ? "On" : "Off" }) }),
|
|
4625
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4534
4626
|
"input",
|
|
4535
4627
|
{
|
|
4536
4628
|
type: "checkbox",
|
|
@@ -4541,7 +4633,7 @@ var init_Switch = __esm({
|
|
|
4541
4633
|
...otherProps
|
|
4542
4634
|
}
|
|
4543
4635
|
),
|
|
4544
|
-
/* @__PURE__ */ (0,
|
|
4636
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "mobius-switch__slider" })
|
|
4545
4637
|
] });
|
|
4546
4638
|
};
|
|
4547
4639
|
Switch.displayName = "Switch";
|
|
@@ -4557,114 +4649,114 @@ var init_Switch2 = __esm({
|
|
|
4557
4649
|
});
|
|
4558
4650
|
|
|
4559
4651
|
// src/components/Table/Table.tsx
|
|
4560
|
-
var
|
|
4652
|
+
var import_dedupe47, import_Table, import_jsx_runtime58, Table;
|
|
4561
4653
|
var init_Table = __esm({
|
|
4562
4654
|
"src/components/Table/Table.tsx"() {
|
|
4563
4655
|
"use strict";
|
|
4564
|
-
|
|
4656
|
+
import_dedupe47 = __toESM(require("classnames/dedupe"));
|
|
4565
4657
|
import_Table = require("@simplybusiness/mobius/src/components/Table/Table.css");
|
|
4566
|
-
|
|
4658
|
+
import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4567
4659
|
Table = ({ ref, ...props }) => {
|
|
4568
|
-
const classes = (0,
|
|
4569
|
-
return /* @__PURE__ */ (0,
|
|
4660
|
+
const classes = (0, import_dedupe47.default)("mobius", "mobius-table", props.className);
|
|
4661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("table", { ref, ...props, className: classes });
|
|
4570
4662
|
};
|
|
4571
4663
|
Table.displayName = "Table";
|
|
4572
4664
|
}
|
|
4573
4665
|
});
|
|
4574
4666
|
|
|
4575
4667
|
// src/components/Table/Head.tsx
|
|
4576
|
-
var
|
|
4668
|
+
var import_dedupe48, import_jsx_runtime59, Head;
|
|
4577
4669
|
var init_Head = __esm({
|
|
4578
4670
|
"src/components/Table/Head.tsx"() {
|
|
4579
4671
|
"use strict";
|
|
4580
|
-
|
|
4581
|
-
|
|
4672
|
+
import_dedupe48 = __toESM(require("classnames/dedupe"));
|
|
4673
|
+
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4582
4674
|
Head = ({ ref, ...props }) => {
|
|
4583
|
-
const classes = (0,
|
|
4584
|
-
return /* @__PURE__ */ (0,
|
|
4675
|
+
const classes = (0, import_dedupe48.default)("mobius", "mobius-table__head", props.className);
|
|
4676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("thead", { ref, ...props, className: classes });
|
|
4585
4677
|
};
|
|
4586
4678
|
Head.displayName = "Table.Head";
|
|
4587
4679
|
}
|
|
4588
4680
|
});
|
|
4589
4681
|
|
|
4590
4682
|
// src/components/Table/Body.tsx
|
|
4591
|
-
var
|
|
4683
|
+
var import_dedupe49, import_jsx_runtime60, Body;
|
|
4592
4684
|
var init_Body = __esm({
|
|
4593
4685
|
"src/components/Table/Body.tsx"() {
|
|
4594
4686
|
"use strict";
|
|
4595
|
-
|
|
4596
|
-
|
|
4687
|
+
import_dedupe49 = __toESM(require("classnames/dedupe"));
|
|
4688
|
+
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4597
4689
|
Body = ({ ref, ...props }) => {
|
|
4598
|
-
const classes = (0,
|
|
4599
|
-
return /* @__PURE__ */ (0,
|
|
4690
|
+
const classes = (0, import_dedupe49.default)("mobius", "mobius-table__body", props.className);
|
|
4691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tbody", { ref, ...props, className: classes });
|
|
4600
4692
|
};
|
|
4601
4693
|
Body.displayName = "Table.Body";
|
|
4602
4694
|
}
|
|
4603
4695
|
});
|
|
4604
4696
|
|
|
4605
4697
|
// src/components/Table/Foot.tsx
|
|
4606
|
-
var
|
|
4698
|
+
var import_dedupe50, import_jsx_runtime61, Foot;
|
|
4607
4699
|
var init_Foot = __esm({
|
|
4608
4700
|
"src/components/Table/Foot.tsx"() {
|
|
4609
4701
|
"use strict";
|
|
4610
|
-
|
|
4611
|
-
|
|
4702
|
+
import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
4703
|
+
import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4612
4704
|
Foot = ({ ref, ...props }) => {
|
|
4613
|
-
const classes = (0,
|
|
4614
|
-
return /* @__PURE__ */ (0,
|
|
4705
|
+
const classes = (0, import_dedupe50.default)("mobius", "mobius-table__foot", props.className);
|
|
4706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("tfoot", { ref, ...props, className: classes });
|
|
4615
4707
|
};
|
|
4616
4708
|
Foot.displayName = "Table.Foot";
|
|
4617
4709
|
}
|
|
4618
4710
|
});
|
|
4619
4711
|
|
|
4620
4712
|
// src/components/Table/Row.tsx
|
|
4621
|
-
var
|
|
4713
|
+
var import_dedupe51, import_jsx_runtime62, Row;
|
|
4622
4714
|
var init_Row = __esm({
|
|
4623
4715
|
"src/components/Table/Row.tsx"() {
|
|
4624
4716
|
"use strict";
|
|
4625
|
-
|
|
4626
|
-
|
|
4717
|
+
import_dedupe51 = __toESM(require("classnames/dedupe"));
|
|
4718
|
+
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4627
4719
|
Row = ({ ref, ...props }) => {
|
|
4628
|
-
const classes = (0,
|
|
4629
|
-
return /* @__PURE__ */ (0,
|
|
4720
|
+
const classes = (0, import_dedupe51.default)("mobius", "mobius-table__row", props.className);
|
|
4721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tr", { ref, ...props, className: classes });
|
|
4630
4722
|
};
|
|
4631
4723
|
Row.displayName = "Table.Row";
|
|
4632
4724
|
}
|
|
4633
4725
|
});
|
|
4634
4726
|
|
|
4635
4727
|
// src/components/Table/HeaderCell.tsx
|
|
4636
|
-
var
|
|
4728
|
+
var import_dedupe52, import_jsx_runtime63, HeaderCell;
|
|
4637
4729
|
var init_HeaderCell = __esm({
|
|
4638
4730
|
"src/components/Table/HeaderCell.tsx"() {
|
|
4639
4731
|
"use strict";
|
|
4640
|
-
|
|
4641
|
-
|
|
4732
|
+
import_dedupe52 = __toESM(require("classnames/dedupe"));
|
|
4733
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4642
4734
|
HeaderCell = ({ ref, ...props }) => {
|
|
4643
|
-
const classes = (0,
|
|
4735
|
+
const classes = (0, import_dedupe52.default)(
|
|
4644
4736
|
"mobius",
|
|
4645
4737
|
"mobius-table__head-cell",
|
|
4646
4738
|
props.className
|
|
4647
4739
|
);
|
|
4648
|
-
return /* @__PURE__ */ (0,
|
|
4740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("th", { ...props, ref, className: classes });
|
|
4649
4741
|
};
|
|
4650
4742
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
4651
4743
|
}
|
|
4652
4744
|
});
|
|
4653
4745
|
|
|
4654
4746
|
// src/components/Table/Cell.tsx
|
|
4655
|
-
var
|
|
4747
|
+
var import_dedupe53, import_jsx_runtime64, Cell;
|
|
4656
4748
|
var init_Cell = __esm({
|
|
4657
4749
|
"src/components/Table/Cell.tsx"() {
|
|
4658
4750
|
"use strict";
|
|
4659
|
-
|
|
4660
|
-
|
|
4751
|
+
import_dedupe53 = __toESM(require("classnames/dedupe"));
|
|
4752
|
+
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4661
4753
|
Cell = ({ ref, ...props }) => {
|
|
4662
|
-
const classes = (0,
|
|
4754
|
+
const classes = (0, import_dedupe53.default)(
|
|
4663
4755
|
"mobius",
|
|
4664
4756
|
"mobius-table__body-cell",
|
|
4665
4757
|
props.className
|
|
4666
4758
|
);
|
|
4667
|
-
return /* @__PURE__ */ (0,
|
|
4759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("td", { ref, ...props, className: classes });
|
|
4668
4760
|
};
|
|
4669
4761
|
Cell.displayName = "Table.Cell";
|
|
4670
4762
|
}
|
|
@@ -4694,37 +4786,6 @@ var init_Table2 = __esm({
|
|
|
4694
4786
|
}
|
|
4695
4787
|
});
|
|
4696
4788
|
|
|
4697
|
-
// src/components/Text/Text.tsx
|
|
4698
|
-
var import_dedupe53, import_Text, import_jsx_runtime63, getElementType, Text;
|
|
4699
|
-
var init_Text = __esm({
|
|
4700
|
-
"src/components/Text/Text.tsx"() {
|
|
4701
|
-
"use strict";
|
|
4702
|
-
import_dedupe53 = __toESM(require("classnames/dedupe"));
|
|
4703
|
-
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
4704
|
-
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4705
|
-
getElementType = (variant, elementType) => {
|
|
4706
|
-
if (variant) {
|
|
4707
|
-
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
4708
|
-
}
|
|
4709
|
-
return elementType || "p";
|
|
4710
|
-
};
|
|
4711
|
-
Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
4712
|
-
const { variant, className, spacing, ...otherProps } = props;
|
|
4713
|
-
const elementType = getElementType(variant, Component);
|
|
4714
|
-
const variantType = variant || elementType;
|
|
4715
|
-
const classes = (0, import_dedupe53.default)(
|
|
4716
|
-
"mobius",
|
|
4717
|
-
"mobius-text",
|
|
4718
|
-
{ [`--is-${variantType}`]: variantType },
|
|
4719
|
-
{ [`--has-line-height-${spacing}`]: spacing },
|
|
4720
|
-
className
|
|
4721
|
-
);
|
|
4722
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Component, { ref, ...otherProps, className: classes });
|
|
4723
|
-
};
|
|
4724
|
-
Text.displayName = "Text";
|
|
4725
|
-
}
|
|
4726
|
-
});
|
|
4727
|
-
|
|
4728
4789
|
// src/components/Text/index.tsx
|
|
4729
4790
|
var init_Text2 = __esm({
|
|
4730
4791
|
"src/components/Text/index.tsx"() {
|
|
@@ -4734,12 +4795,12 @@ var init_Text2 = __esm({
|
|
|
4734
4795
|
});
|
|
4735
4796
|
|
|
4736
4797
|
// src/components/TextAreaInput/TextAreaInput.tsx
|
|
4737
|
-
var import_dedupe54,
|
|
4798
|
+
var import_dedupe54, import_jsx_runtime65, TextAreaInput;
|
|
4738
4799
|
var init_TextAreaInput = __esm({
|
|
4739
4800
|
"src/components/TextAreaInput/TextAreaInput.tsx"() {
|
|
4740
4801
|
"use strict";
|
|
4741
4802
|
import_dedupe54 = __toESM(require("classnames/dedupe"));
|
|
4742
|
-
|
|
4803
|
+
import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4743
4804
|
TextAreaInput = ({ ref, ...props }) => {
|
|
4744
4805
|
const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
|
|
4745
4806
|
const classes = (0, import_dedupe54.default)(
|
|
@@ -4752,7 +4813,7 @@ var init_TextAreaInput = __esm({
|
|
|
4752
4813
|
},
|
|
4753
4814
|
otherProps.className
|
|
4754
4815
|
);
|
|
4755
|
-
return /* @__PURE__ */ (0,
|
|
4816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4756
4817
|
"textarea",
|
|
4757
4818
|
{
|
|
4758
4819
|
ref,
|
|
@@ -4776,7 +4837,7 @@ var init_TextAreaInput2 = __esm({
|
|
|
4776
4837
|
});
|
|
4777
4838
|
|
|
4778
4839
|
// src/components/TextArea/TextArea.tsx
|
|
4779
|
-
var import_dedupe55, import_TextArea,
|
|
4840
|
+
var import_dedupe55, import_TextArea, import_jsx_runtime66, TextArea;
|
|
4780
4841
|
var init_TextArea = __esm({
|
|
4781
4842
|
"src/components/TextArea/TextArea.tsx"() {
|
|
4782
4843
|
"use strict";
|
|
@@ -4788,7 +4849,7 @@ var init_TextArea = __esm({
|
|
|
4788
4849
|
init_Stack2();
|
|
4789
4850
|
init_TextAreaInput2();
|
|
4790
4851
|
import_TextArea = require("@simplybusiness/mobius/src/components/TextArea/TextArea.css");
|
|
4791
|
-
|
|
4852
|
+
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4792
4853
|
TextArea = ({ ref, ...props }) => {
|
|
4793
4854
|
const {
|
|
4794
4855
|
isDisabled,
|
|
@@ -4808,9 +4869,9 @@ var init_TextArea = __esm({
|
|
|
4808
4869
|
},
|
|
4809
4870
|
validationClasses
|
|
4810
4871
|
);
|
|
4811
|
-
return /* @__PURE__ */ (0,
|
|
4812
|
-
label && /* @__PURE__ */ (0,
|
|
4813
|
-
/* @__PURE__ */ (0,
|
|
4872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(Stack, { className: classes, gap: "xs", children: [
|
|
4873
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Label, { ...labelProps, className: labelClasses, children: props.label }),
|
|
4874
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4814
4875
|
TextAreaInput,
|
|
4815
4876
|
{
|
|
4816
4877
|
...otherProps,
|
|
@@ -4821,7 +4882,7 @@ var init_TextArea = __esm({
|
|
|
4821
4882
|
"aria-invalid": errorMessage != null
|
|
4822
4883
|
}
|
|
4823
4884
|
),
|
|
4824
|
-
/* @__PURE__ */ (0,
|
|
4885
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
4825
4886
|
] });
|
|
4826
4887
|
};
|
|
4827
4888
|
TextArea.displayName = "TextArea";
|
|
@@ -4836,53 +4897,6 @@ var init_TextArea2 = __esm({
|
|
|
4836
4897
|
}
|
|
4837
4898
|
});
|
|
4838
4899
|
|
|
4839
|
-
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
4840
|
-
var import_react40, import_jsx_runtime66, isHTML, TextOrHTML;
|
|
4841
|
-
var init_TextOrHTML = __esm({
|
|
4842
|
-
"src/components/TextOrHTML/TextOrHTML.tsx"() {
|
|
4843
|
-
"use strict";
|
|
4844
|
-
import_react40 = require("react");
|
|
4845
|
-
init_Text();
|
|
4846
|
-
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4847
|
-
isHTML = (text) => /^\s*<[a-z]/i.test(text);
|
|
4848
|
-
TextOrHTML = ({
|
|
4849
|
-
ref,
|
|
4850
|
-
text,
|
|
4851
|
-
htmlClassName,
|
|
4852
|
-
htmlElementType,
|
|
4853
|
-
textWrapper = false,
|
|
4854
|
-
autoDetect = false,
|
|
4855
|
-
...textProps
|
|
4856
|
-
}) => {
|
|
4857
|
-
const textIsHTML = autoDetect && isHTML(text);
|
|
4858
|
-
const shouldWrapInText = autoDetect ? textWrapper || !textIsHTML : textWrapper;
|
|
4859
|
-
const resolvedElementType = htmlElementType ?? (textIsHTML ? "div" : "span");
|
|
4860
|
-
const DangerousComponent = resolvedElementType;
|
|
4861
|
-
const dangerousHTML = (0, import_react40.useMemo)(() => ({ __html: text }), [text]);
|
|
4862
|
-
const dangerousElement = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4863
|
-
DangerousComponent,
|
|
4864
|
-
{
|
|
4865
|
-
className: htmlClassName,
|
|
4866
|
-
dangerouslySetInnerHTML: dangerousHTML
|
|
4867
|
-
}
|
|
4868
|
-
);
|
|
4869
|
-
if (shouldWrapInText) {
|
|
4870
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Text, { ref, ...textProps, children: dangerousElement });
|
|
4871
|
-
}
|
|
4872
|
-
return dangerousElement;
|
|
4873
|
-
};
|
|
4874
|
-
TextOrHTML.displayName = "TextOrHTML";
|
|
4875
|
-
}
|
|
4876
|
-
});
|
|
4877
|
-
|
|
4878
|
-
// src/components/TextOrHTML/index.tsx
|
|
4879
|
-
var init_TextOrHTML2 = __esm({
|
|
4880
|
-
"src/components/TextOrHTML/index.tsx"() {
|
|
4881
|
-
"use strict";
|
|
4882
|
-
init_TextOrHTML();
|
|
4883
|
-
}
|
|
4884
|
-
});
|
|
4885
|
-
|
|
4886
4900
|
// src/components/Title/Title.tsx
|
|
4887
4901
|
var import_dedupe56, import_Title, import_jsx_runtime67, Title;
|
|
4888
4902
|
var init_Title = __esm({
|