@eqtylab/equality 5.1.0 → 5.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/dist/index.d.cts CHANGED
@@ -121,7 +121,7 @@ declare const AlertDialogTitle: React$1.ForwardRefExoticComponent<Omit<AlertDial
121
121
  declare const AlertDialogDescription: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
122
122
  /**
123
123
  * **Props**
124
- * - `variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"primary"`)
124
+ * - `variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"primary"`)
125
125
  * - `size?: "sm" | "md" | "lg"` (default `"sm"`)
126
126
  * - `prefix?: React.ReactNode`
127
127
  * - `suffix?: React.ReactNode`
@@ -132,7 +132,7 @@ declare const AlertDialogDescription: React$1.ForwardRefExoticComponent<Omit<Ale
132
132
  * [Alert Dialog documentation](https://equality.eqtylab.io/components/alert-dialog)
133
133
  */
134
134
  declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<Omit<AlertDialogPrimitive.AlertDialogActionProps & React$1.RefAttributes<HTMLButtonElement>, "ref">, "prefix"> & VariantProps<(props?: ({
135
- variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
135
+ variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
136
136
  size?: "sm" | "md" | "lg" | null | undefined;
137
137
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
138
138
  prefix?: React$1.ReactNode;
@@ -140,7 +140,7 @@ declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<Omit<Ale
140
140
  } & React$1.RefAttributes<HTMLButtonElement>>;
141
141
  /**
142
142
  * **Props**
143
- * - `variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"tertiary"`)
143
+ * - `variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"tertiary"`)
144
144
  * - `size?: "sm" | "md" | "lg"` (default `"sm"`)
145
145
  * - `prefix?: React.ReactNode`
146
146
  * - `suffix?: React.ReactNode`
@@ -151,7 +151,7 @@ declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<Omit<Ale
151
151
  * [Alert Dialog documentation](https://equality.eqtylab.io/components/alert-dialog)
152
152
  */
153
153
  declare const AlertDialogCancel: React$1.ForwardRefExoticComponent<Omit<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React$1.RefAttributes<HTMLButtonElement>, "ref">, "prefix"> & VariantProps<(props?: ({
154
- variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
154
+ variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
155
155
  size?: "sm" | "md" | "lg" | null | undefined;
156
156
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
157
157
  prefix?: React$1.ReactNode;
@@ -159,7 +159,7 @@ declare const AlertDialogCancel: React$1.ForwardRefExoticComponent<Omit<Omit<Ale
159
159
  } & React$1.RefAttributes<HTMLButtonElement>>;
160
160
 
161
161
  declare const alertVariants: (props?: ({
162
- variant?: "primary" | "danger" | "warning" | "neutral" | "success" | null | undefined;
162
+ variant?: "primary" | "danger" | "success" | "warning" | "neutral" | null | undefined;
163
163
  } & class_variance_authority_types.ClassProp) | undefined) => string;
164
164
  interface AlertProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
165
165
  title: string;
@@ -239,7 +239,7 @@ declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitiv
239
239
  declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
240
240
 
241
241
  declare const badgeVariants: (props?: ({
242
- variant?: "primary" | "danger" | "warning" | "secondary" | "neutral" | "success" | null | undefined;
242
+ variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "neutral" | null | undefined;
243
243
  size?: "sm" | "md" | null | undefined;
244
244
  } & class_variance_authority_types.ClassProp) | undefined) => string;
245
245
  type BadgeDisplayMode = 'both' | 'text-only' | 'icon-only';
@@ -276,7 +276,7 @@ declare function Badge({ className, variant, size, closeable, handleClosable, cl
276
276
 
277
277
  declare const bannerVariants: (props?: ({
278
278
  /** The status the strip's colour reports */
279
- variant?: "primary" | "danger" | "warning" | "neutral" | "success" | null | undefined;
279
+ variant?: "primary" | "danger" | "success" | "warning" | "neutral" | null | undefined;
280
280
  /** The edge that draws the rule. `top` for a banner at the foot of a page header */
281
281
  border?: "top" | "bottom" | null | undefined;
282
282
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -452,7 +452,7 @@ declare const BgGradient: ({ theme, placement, }: {
452
452
  }) => react_jsx_runtime.JSX.Element;
453
453
 
454
454
  declare const buttonVariants: (props?: ({
455
- variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
455
+ variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
456
456
  size?: "sm" | "md" | "lg" | null | undefined;
457
457
  } & class_variance_authority_types.ClassProp) | undefined) => string;
458
458
  type ButtonBaseProps = Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'>;
@@ -473,7 +473,7 @@ type ButtonProps = VariantProps<typeof buttonVariants> & ((ButtonBaseProps & {
473
473
  }));
474
474
  /**
475
475
  * **Props**
476
- * - `variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"primary"`)
476
+ * - `variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"primary"`)
477
477
  * - `size?: "sm" | "md" | "lg"` (default `"md"`)
478
478
  * - `asChild?: boolean` (default `false`)
479
479
  * - `href?: string`
@@ -896,7 +896,7 @@ interface DateRangePickerProps {
896
896
  declare const DateRangePicker: ({ dateRange, onSelect, className }: DateRangePickerProps) => react_jsx_runtime.JSX.Element;
897
897
 
898
898
  declare const displayFieldVariants: (props?: ({
899
- variant?: "neutral" | "success" | "neutralCheck" | "failure" | null | undefined;
899
+ variant?: "success" | "neutral" | "neutralCheck" | "failure" | null | undefined;
900
900
  } & class_variance_authority_types.ClassProp) | undefined) => string;
901
901
  interface DisplayFieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'slot'>, VariantProps<typeof displayFieldVariants> {
902
902
  variant?: 'neutral' | 'success' | 'neutralCheck' | 'failure';
@@ -2760,7 +2760,7 @@ declare const ToastViewport: React$1.ForwardRefExoticComponent<Omit<ToastPrimiti
2760
2760
  * [Toast documentation](https://equality.eqtylab.io/components/toast)
2761
2761
  */
2762
2762
  declare const ToastContainer: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React$1.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
2763
- variant?: "danger" | "warning" | "default" | "success" | null | undefined;
2763
+ variant?: "danger" | "success" | "warning" | "default" | null | undefined;
2764
2764
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLLIElement>>;
2765
2765
  /**
2766
2766
  * **Props**
package/dist/index.d.ts CHANGED
@@ -121,7 +121,7 @@ declare const AlertDialogTitle: React$1.ForwardRefExoticComponent<Omit<AlertDial
121
121
  declare const AlertDialogDescription: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
122
122
  /**
123
123
  * **Props**
124
- * - `variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"primary"`)
124
+ * - `variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"primary"`)
125
125
  * - `size?: "sm" | "md" | "lg"` (default `"sm"`)
126
126
  * - `prefix?: React.ReactNode`
127
127
  * - `suffix?: React.ReactNode`
@@ -132,7 +132,7 @@ declare const AlertDialogDescription: React$1.ForwardRefExoticComponent<Omit<Ale
132
132
  * [Alert Dialog documentation](https://equality.eqtylab.io/components/alert-dialog)
133
133
  */
134
134
  declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<Omit<AlertDialogPrimitive.AlertDialogActionProps & React$1.RefAttributes<HTMLButtonElement>, "ref">, "prefix"> & VariantProps<(props?: ({
135
- variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
135
+ variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
136
136
  size?: "sm" | "md" | "lg" | null | undefined;
137
137
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
138
138
  prefix?: React$1.ReactNode;
@@ -140,7 +140,7 @@ declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<Omit<Ale
140
140
  } & React$1.RefAttributes<HTMLButtonElement>>;
141
141
  /**
142
142
  * **Props**
143
- * - `variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"tertiary"`)
143
+ * - `variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"tertiary"`)
144
144
  * - `size?: "sm" | "md" | "lg"` (default `"sm"`)
145
145
  * - `prefix?: React.ReactNode`
146
146
  * - `suffix?: React.ReactNode`
@@ -151,7 +151,7 @@ declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<Omit<Ale
151
151
  * [Alert Dialog documentation](https://equality.eqtylab.io/components/alert-dialog)
152
152
  */
153
153
  declare const AlertDialogCancel: React$1.ForwardRefExoticComponent<Omit<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React$1.RefAttributes<HTMLButtonElement>, "ref">, "prefix"> & VariantProps<(props?: ({
154
- variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
154
+ variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
155
155
  size?: "sm" | "md" | "lg" | null | undefined;
156
156
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
157
157
  prefix?: React$1.ReactNode;
@@ -159,7 +159,7 @@ declare const AlertDialogCancel: React$1.ForwardRefExoticComponent<Omit<Omit<Ale
159
159
  } & React$1.RefAttributes<HTMLButtonElement>>;
160
160
 
161
161
  declare const alertVariants: (props?: ({
162
- variant?: "primary" | "danger" | "warning" | "neutral" | "success" | null | undefined;
162
+ variant?: "primary" | "danger" | "success" | "warning" | "neutral" | null | undefined;
163
163
  } & class_variance_authority_types.ClassProp) | undefined) => string;
164
164
  interface AlertProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
165
165
  title: string;
@@ -239,7 +239,7 @@ declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitiv
239
239
  declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
240
240
 
241
241
  declare const badgeVariants: (props?: ({
242
- variant?: "primary" | "danger" | "warning" | "secondary" | "neutral" | "success" | null | undefined;
242
+ variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "neutral" | null | undefined;
243
243
  size?: "sm" | "md" | null | undefined;
244
244
  } & class_variance_authority_types.ClassProp) | undefined) => string;
245
245
  type BadgeDisplayMode = 'both' | 'text-only' | 'icon-only';
@@ -276,7 +276,7 @@ declare function Badge({ className, variant, size, closeable, handleClosable, cl
276
276
 
277
277
  declare const bannerVariants: (props?: ({
278
278
  /** The status the strip's colour reports */
279
- variant?: "primary" | "danger" | "warning" | "neutral" | "success" | null | undefined;
279
+ variant?: "primary" | "danger" | "success" | "warning" | "neutral" | null | undefined;
280
280
  /** The edge that draws the rule. `top` for a banner at the foot of a page header */
281
281
  border?: "top" | "bottom" | null | undefined;
282
282
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -452,7 +452,7 @@ declare const BgGradient: ({ theme, placement, }: {
452
452
  }) => react_jsx_runtime.JSX.Element;
453
453
 
454
454
  declare const buttonVariants: (props?: ({
455
- variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
455
+ variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation" | null | undefined;
456
456
  size?: "sm" | "md" | "lg" | null | undefined;
457
457
  } & class_variance_authority_types.ClassProp) | undefined) => string;
458
458
  type ButtonBaseProps = Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'>;
@@ -473,7 +473,7 @@ type ButtonProps = VariantProps<typeof buttonVariants> & ((ButtonBaseProps & {
473
473
  }));
474
474
  /**
475
475
  * **Props**
476
- * - `variant?: "primary" | "danger" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"primary"`)
476
+ * - `variant?: "primary" | "danger" | "success" | "warning" | "secondary" | "tertiary" | "link" | "navigation"` (default `"primary"`)
477
477
  * - `size?: "sm" | "md" | "lg"` (default `"md"`)
478
478
  * - `asChild?: boolean` (default `false`)
479
479
  * - `href?: string`
@@ -896,7 +896,7 @@ interface DateRangePickerProps {
896
896
  declare const DateRangePicker: ({ dateRange, onSelect, className }: DateRangePickerProps) => react_jsx_runtime.JSX.Element;
897
897
 
898
898
  declare const displayFieldVariants: (props?: ({
899
- variant?: "neutral" | "success" | "neutralCheck" | "failure" | null | undefined;
899
+ variant?: "success" | "neutral" | "neutralCheck" | "failure" | null | undefined;
900
900
  } & class_variance_authority_types.ClassProp) | undefined) => string;
901
901
  interface DisplayFieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'slot'>, VariantProps<typeof displayFieldVariants> {
902
902
  variant?: 'neutral' | 'success' | 'neutralCheck' | 'failure';
@@ -2760,7 +2760,7 @@ declare const ToastViewport: React$1.ForwardRefExoticComponent<Omit<ToastPrimiti
2760
2760
  * [Toast documentation](https://equality.eqtylab.io/components/toast)
2761
2761
  */
2762
2762
  declare const ToastContainer: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React$1.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
2763
- variant?: "danger" | "warning" | "default" | "success" | null | undefined;
2763
+ variant?: "danger" | "success" | "warning" | "default" | null | undefined;
2764
2764
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLLIElement>>;
2765
2765
  /**
2766
2766
  * **Props**
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';
@@ -111,6 +111,7 @@ var buttonVariants = cva(styles["button"], {
111
111
  variant: {
112
112
  primary: [styles["button--filled"], styles["button--primary"]],
113
113
  danger: [styles["button--filled"], styles["button--danger"]],
114
+ success: [styles["button--filled"], styles["button--success"]],
114
115
  warning: [styles["button--filled"], styles["button--warning"]],
115
116
  secondary: [styles["button--filled"], styles["button--secondary"]],
116
117
  tertiary: styles["button--tertiary"],
@@ -3464,11 +3465,12 @@ var NavSwitcherSelect = React16.forwardRef(
3464
3465
  const keepOpen = React16.useRef(false);
3465
3466
  const [announcement, setAnnouncement] = React16.useState("");
3466
3467
  const [listState, setListState] = React16.useState({ error, retrying });
3468
+ const errorMessage = options.length > 0 ? `Some ${collection} couldn't be loaded.` : `Couldn't load ${collection}.`;
3467
3469
  if (listState.error !== error || listState.retrying !== retrying) {
3468
3470
  setListState({ error, retrying });
3469
3471
  if (error || listState.error) {
3470
3472
  setAnnouncement(
3471
- error ? retrying ? "Retrying..." : `Couldn't load ${collection}.` : options.length > 0 ? `Loaded ${collection}.` : `No ${collection} found.`
3473
+ error ? retrying ? "Retrying..." : errorMessage : options.length > 0 ? `Loaded ${collection}.` : `No ${collection} found.`
3472
3474
  );
3473
3475
  }
3474
3476
  }
@@ -3551,7 +3553,7 @@ var NavSwitcherSelect = React16.forwardRef(
3551
3553
  SelectItem,
3552
3554
  {
3553
3555
  value: retryValue,
3554
- textValue: `Couldn't load ${collection}. ${retrying ? "Retrying" : "Retry"}`,
3556
+ textValue: `${errorMessage} ${retrying ? "Retrying" : "Retry"}`,
3555
3557
  persistent: true,
3556
3558
  "aria-disabled": retrying || void 0,
3557
3559
  className: styles41["nav-switcher-retry"],
@@ -3564,9 +3566,7 @@ var NavSwitcherSelect = React16.forwardRef(
3564
3566
  "aria-hidden": "true"
3565
3567
  }
3566
3568
  ),
3567
- "Couldn't load ",
3568
- collection,
3569
- "."
3569
+ errorMessage
3570
3570
  ] }),
3571
3571
  retrying ? /* @__PURE__ */ jsxs("span", { className: styles41["nav-switcher-error-message"], children: [
3572
3572
  /* @__PURE__ */ jsx(Spinner, { size: "xs", variant: "neutral" }),