@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 CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.11.3
3
+ * @license @wistia/ui v0.11.4
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -10923,28 +10923,46 @@ var StyledErrorList = import_styled_components58.default.ul`
10923
10923
  gap: var(--wui-space-01);
10924
10924
  `;
10925
10925
  var ErrorMessages = ({ errors, id }) => {
10926
- const isMultipleErrors = (0, import_type_guards37.isArray)(errors);
10927
- return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
10926
+ const isErrorArray = (0, import_type_guards37.isArray)(errors);
10927
+ const isMultipleErrors = isErrorArray && errors.length > 1;
10928
+ if (!isErrorArray) {
10929
+ return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
10930
+ Text,
10931
+ {
10932
+ colorScheme: "error",
10933
+ id,
10934
+ prominence: "secondary",
10935
+ variant: "label4",
10936
+ children: errors
10937
+ },
10938
+ id
10939
+ );
10940
+ }
10941
+ if (!isMultipleErrors) {
10942
+ return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
10943
+ Text,
10944
+ {
10945
+ colorScheme: "error",
10946
+ id,
10947
+ prominence: "secondary",
10948
+ variant: "label4",
10949
+ children: errors[0]
10950
+ },
10951
+ id
10952
+ );
10953
+ }
10954
+ return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
10928
10955
  Text,
10929
10956
  {
10930
10957
  colorScheme: "error",
10931
10958
  id: `${id}-${index}`,
10959
+ prominence: "secondary",
10932
10960
  renderAs: "li",
10933
10961
  variant: "label4",
10934
10962
  children: error
10935
10963
  },
10936
10964
  `${id}-${index}`
10937
- )) }) : /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
10938
- Text,
10939
- {
10940
- colorScheme: "error",
10941
- id,
10942
- prominence: "secondary",
10943
- variant: "label4",
10944
- children: errors
10945
- },
10946
- id
10947
- );
10965
+ )) });
10948
10966
  };
10949
10967
  var FormField = ({
10950
10968
  children,