@wistia/ui 0.11.3 → 0.11.4
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/dist/index.cjs +32 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +32 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.11.
|
|
3
|
+
* @license @wistia/ui v0.11.4
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -10797,28 +10797,46 @@ var StyledErrorList = styled41.ul`
|
|
|
10797
10797
|
gap: var(--wui-space-01);
|
|
10798
10798
|
`;
|
|
10799
10799
|
var ErrorMessages = ({ errors, id }) => {
|
|
10800
|
-
const
|
|
10801
|
-
|
|
10800
|
+
const isErrorArray = isArray3(errors);
|
|
10801
|
+
const isMultipleErrors = isErrorArray && errors.length > 1;
|
|
10802
|
+
if (!isErrorArray) {
|
|
10803
|
+
return /* @__PURE__ */ jsx235(
|
|
10804
|
+
Text,
|
|
10805
|
+
{
|
|
10806
|
+
colorScheme: "error",
|
|
10807
|
+
id,
|
|
10808
|
+
prominence: "secondary",
|
|
10809
|
+
variant: "label4",
|
|
10810
|
+
children: errors
|
|
10811
|
+
},
|
|
10812
|
+
id
|
|
10813
|
+
);
|
|
10814
|
+
}
|
|
10815
|
+
if (!isMultipleErrors) {
|
|
10816
|
+
return /* @__PURE__ */ jsx235(
|
|
10817
|
+
Text,
|
|
10818
|
+
{
|
|
10819
|
+
colorScheme: "error",
|
|
10820
|
+
id,
|
|
10821
|
+
prominence: "secondary",
|
|
10822
|
+
variant: "label4",
|
|
10823
|
+
children: errors[0]
|
|
10824
|
+
},
|
|
10825
|
+
id
|
|
10826
|
+
);
|
|
10827
|
+
}
|
|
10828
|
+
return /* @__PURE__ */ jsx235(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ jsx235(
|
|
10802
10829
|
Text,
|
|
10803
10830
|
{
|
|
10804
10831
|
colorScheme: "error",
|
|
10805
10832
|
id: `${id}-${index}`,
|
|
10833
|
+
prominence: "secondary",
|
|
10806
10834
|
renderAs: "li",
|
|
10807
10835
|
variant: "label4",
|
|
10808
10836
|
children: error
|
|
10809
10837
|
},
|
|
10810
10838
|
`${id}-${index}`
|
|
10811
|
-
)) })
|
|
10812
|
-
Text,
|
|
10813
|
-
{
|
|
10814
|
-
colorScheme: "error",
|
|
10815
|
-
id,
|
|
10816
|
-
prominence: "secondary",
|
|
10817
|
-
variant: "label4",
|
|
10818
|
-
children: errors
|
|
10819
|
-
},
|
|
10820
|
-
id
|
|
10821
|
-
);
|
|
10839
|
+
)) });
|
|
10822
10840
|
};
|
|
10823
10841
|
var FormField = ({
|
|
10824
10842
|
children,
|