@transferwise/components 0.0.0-experimental-5931a60 → 0.0.0-experimental-a44fd6f
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/build/index.js
CHANGED
|
@@ -4896,13 +4896,20 @@ function InlineAlert({
|
|
|
4896
4896
|
return null;
|
|
4897
4897
|
}
|
|
4898
4898
|
};
|
|
4899
|
-
const hasTextChildren =
|
|
4899
|
+
const hasTextChildren = content => {
|
|
4900
4900
|
let label = '';
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4901
|
+
const fillLabel = childrenNodes => {
|
|
4902
|
+
React__namespace.default.Children.map(childrenNodes, child => {
|
|
4903
|
+
if (typeof child === 'string') {
|
|
4904
|
+
label += child;
|
|
4905
|
+
}
|
|
4906
|
+
if (typeof child === 'object' && /*#__PURE__*/React__namespace.default.isValidElement(child)) {
|
|
4907
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
4908
|
+
fillLabel(child?.props?.children);
|
|
4909
|
+
}
|
|
4910
|
+
});
|
|
4911
|
+
};
|
|
4912
|
+
fillLabel(content);
|
|
4906
4913
|
return !!label.length;
|
|
4907
4914
|
};
|
|
4908
4915
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|