@eqtylab/equality 5.1.0 → 5.1.1

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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React16 from 'react';
2
- import { forwardRef, useEffect, useLayoutEffect, useState, useRef, useMemo, useCallback, createElement, useSyncExternalStore } from 'react';
2
+ import { forwardRef, useState, useRef, useEffect, useLayoutEffect, useMemo, useCallback, createElement, useSyncExternalStore } from 'react';
3
3
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
4
4
  import styles2 from './alert-dialog.module.module.css.module.css';
5
5
  import { Slot, Slottable } from '@radix-ui/react-slot';
@@ -3464,11 +3464,12 @@ var NavSwitcherSelect = React16.forwardRef(
3464
3464
  const keepOpen = React16.useRef(false);
3465
3465
  const [announcement, setAnnouncement] = React16.useState("");
3466
3466
  const [listState, setListState] = React16.useState({ error, retrying });
3467
+ const errorMessage = options.length > 0 ? `Some ${collection} couldn't be loaded.` : `Couldn't load ${collection}.`;
3467
3468
  if (listState.error !== error || listState.retrying !== retrying) {
3468
3469
  setListState({ error, retrying });
3469
3470
  if (error || listState.error) {
3470
3471
  setAnnouncement(
3471
- error ? retrying ? "Retrying..." : `Couldn't load ${collection}.` : options.length > 0 ? `Loaded ${collection}.` : `No ${collection} found.`
3472
+ error ? retrying ? "Retrying..." : errorMessage : options.length > 0 ? `Loaded ${collection}.` : `No ${collection} found.`
3472
3473
  );
3473
3474
  }
3474
3475
  }
@@ -3551,7 +3552,7 @@ var NavSwitcherSelect = React16.forwardRef(
3551
3552
  SelectItem,
3552
3553
  {
3553
3554
  value: retryValue,
3554
- textValue: `Couldn't load ${collection}. ${retrying ? "Retrying" : "Retry"}`,
3555
+ textValue: `${errorMessage} ${retrying ? "Retrying" : "Retry"}`,
3555
3556
  persistent: true,
3556
3557
  "aria-disabled": retrying || void 0,
3557
3558
  className: styles41["nav-switcher-retry"],
@@ -3564,9 +3565,7 @@ var NavSwitcherSelect = React16.forwardRef(
3564
3565
  "aria-hidden": "true"
3565
3566
  }
3566
3567
  ),
3567
- "Couldn't load ",
3568
- collection,
3569
- "."
3568
+ errorMessage
3570
3569
  ] }),
3571
3570
  retrying ? /* @__PURE__ */ jsxs("span", { className: styles41["nav-switcher-error-message"], children: [
3572
3571
  /* @__PURE__ */ jsx(Spinner, { size: "xs", variant: "neutral" }),