@eqtylab/equality 4.0.0 → 4.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
@@ -34,6 +34,19 @@ interface AlertProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProp
34
34
  title: string;
35
35
  description?: string | React$1.ReactNode;
36
36
  icon?: React$1.ReactElement | string | null;
37
+ /**
38
+ * Body content, as an alternative to `description`. Rendered in a `div` rather
39
+ * than a `p`, so block-level content (paragraphs, lists, code blocks) is valid.
40
+ * Use this instead of `description` when the body is more than a sentence.
41
+ */
42
+ children?: React$1.ReactNode;
43
+ /**
44
+ * Element to render. Defaults to `div` with `role="alert"`, which is an
45
+ * assertive live region -- correct for a message that appears in response to
46
+ * something the user did, wrong for static page content. Use `aside` for a
47
+ * standing callout; it drops the live region unless you set `role` yourself.
48
+ */
49
+ as?: 'div' | 'aside' | 'section';
37
50
  }
38
51
  declare const Alert: React$1.ForwardRefExoticComponent<AlertProps & React$1.RefAttributes<HTMLDivElement>>;
39
52
 
@@ -662,7 +675,14 @@ declare const RadioDropdown: ({ label, options, selectedValue, onSelect, classNa
662
675
  declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
663
676
  declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
664
677
 
678
+ /**
679
+ * @deprecated Use a native scrollable element instead — set an overflow and a height on your own
680
+ * container and leave the browser's scrollbar unstyled.
681
+ */
665
682
  declare const ScrollArea: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
683
+ /**
684
+ * @deprecated Part of the deprecated `ScrollArea`. Use a native scrollable element instead.
685
+ */
666
686
  declare const ScrollBar: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
667
687
 
668
688
  interface SearchBarProps {
@@ -827,14 +847,17 @@ interface TabsProps {
827
847
  icon?: React.ReactElement | string;
828
848
  suffix?: React.ReactNode;
829
849
  content: React.ReactNode;
830
- triggerProps?: Omit<ComponentPropsWithoutRef<typeof TabsTrigger>, 'value'>;
850
+ triggerProps?: Omit<ComponentPropsWithoutRef<typeof TabsTrigger>, 'value'> & {
851
+ [key: `data-${string}`]: string | number | boolean | undefined;
852
+ };
831
853
  }[];
832
854
  className?: string;
833
855
  tabsListBackground?: 'transparent' | 'filled';
834
856
  defaultValue?: string;
835
857
  onValueChange?: (value: string) => void;
858
+ staticRender?: boolean;
836
859
  }
837
- declare const Tabs: ({ id, items, className, tabsListBackground, defaultValue, onValueChange, }: TabsProps) => react_jsx_runtime.JSX.Element;
860
+ declare const Tabs: ({ id, items, className, tabsListBackground, defaultValue, onValueChange, staticRender, }: TabsProps) => react_jsx_runtime.JSX.Element;
838
861
 
839
862
  declare const Textarea: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React$1.RefAttributes<HTMLTextAreaElement>>;
840
863
 
@@ -938,7 +961,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
938
961
 
939
962
  declare const iconVariants: (props?: ({
940
963
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
941
- background?: "circle" | "square" | "transparent" | null | undefined;
964
+ background?: "square" | "circle" | "transparent" | null | undefined;
942
965
  } & class_variance_authority_types.ClassProp) | undefined) => string;
943
966
  declare const iconElevationVariants: (props?: ({
944
967
  elevation?: string | number | null | undefined;
package/dist/index.d.ts CHANGED
@@ -34,6 +34,19 @@ interface AlertProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProp
34
34
  title: string;
35
35
  description?: string | React$1.ReactNode;
36
36
  icon?: React$1.ReactElement | string | null;
37
+ /**
38
+ * Body content, as an alternative to `description`. Rendered in a `div` rather
39
+ * than a `p`, so block-level content (paragraphs, lists, code blocks) is valid.
40
+ * Use this instead of `description` when the body is more than a sentence.
41
+ */
42
+ children?: React$1.ReactNode;
43
+ /**
44
+ * Element to render. Defaults to `div` with `role="alert"`, which is an
45
+ * assertive live region -- correct for a message that appears in response to
46
+ * something the user did, wrong for static page content. Use `aside` for a
47
+ * standing callout; it drops the live region unless you set `role` yourself.
48
+ */
49
+ as?: 'div' | 'aside' | 'section';
37
50
  }
38
51
  declare const Alert: React$1.ForwardRefExoticComponent<AlertProps & React$1.RefAttributes<HTMLDivElement>>;
39
52
 
@@ -662,7 +675,14 @@ declare const RadioDropdown: ({ label, options, selectedValue, onSelect, classNa
662
675
  declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
663
676
  declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
664
677
 
678
+ /**
679
+ * @deprecated Use a native scrollable element instead — set an overflow and a height on your own
680
+ * container and leave the browser's scrollbar unstyled.
681
+ */
665
682
  declare const ScrollArea: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
683
+ /**
684
+ * @deprecated Part of the deprecated `ScrollArea`. Use a native scrollable element instead.
685
+ */
666
686
  declare const ScrollBar: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
667
687
 
668
688
  interface SearchBarProps {
@@ -827,14 +847,17 @@ interface TabsProps {
827
847
  icon?: React.ReactElement | string;
828
848
  suffix?: React.ReactNode;
829
849
  content: React.ReactNode;
830
- triggerProps?: Omit<ComponentPropsWithoutRef<typeof TabsTrigger>, 'value'>;
850
+ triggerProps?: Omit<ComponentPropsWithoutRef<typeof TabsTrigger>, 'value'> & {
851
+ [key: `data-${string}`]: string | number | boolean | undefined;
852
+ };
831
853
  }[];
832
854
  className?: string;
833
855
  tabsListBackground?: 'transparent' | 'filled';
834
856
  defaultValue?: string;
835
857
  onValueChange?: (value: string) => void;
858
+ staticRender?: boolean;
836
859
  }
837
- declare const Tabs: ({ id, items, className, tabsListBackground, defaultValue, onValueChange, }: TabsProps) => react_jsx_runtime.JSX.Element;
860
+ declare const Tabs: ({ id, items, className, tabsListBackground, defaultValue, onValueChange, staticRender, }: TabsProps) => react_jsx_runtime.JSX.Element;
838
861
 
839
862
  declare const Textarea: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React$1.RefAttributes<HTMLTextAreaElement>>;
840
863
 
@@ -938,7 +961,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
938
961
 
939
962
  declare const iconVariants: (props?: ({
940
963
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
941
- background?: "circle" | "square" | "transparent" | null | undefined;
964
+ background?: "square" | "circle" | "transparent" | null | undefined;
942
965
  } & class_variance_authority_types.ClassProp) | undefined) => string;
943
966
  declare const iconElevationVariants: (props?: ({
944
967
  elevation?: string | number | null | undefined;
package/dist/index.js CHANGED
@@ -215,13 +215,14 @@ var defaultVariantIcons = {
215
215
  danger: "TriangleAlert"
216
216
  };
217
217
  var Alert = React15.forwardRef(
218
- ({ className, variant, title, description, icon, ...props }, ref) => {
218
+ ({ className, variant, title, description, icon, children, as: Component = "div", ...props }, ref) => {
219
219
  const effectiveIcon = icon === void 0 ? variant ? defaultVariantIcons[variant] : void 0 : icon;
220
+ const role = Component === "div" ? "alert" : void 0;
220
221
  return /* @__PURE__ */ jsxs(
221
- "div",
222
+ Component,
222
223
  {
223
224
  ref,
224
- role: "alert",
225
+ role,
225
226
  className: cn(
226
227
  alertVariants({ variant }),
227
228
  effectiveIcon ? styles2["alert--with-icon"] : "",
@@ -239,7 +240,8 @@ var Alert = React15.forwardRef(
239
240
  }
240
241
  ) : null,
241
242
  /* @__PURE__ */ jsx("h4", { className: styles2["alert-title"], children: title }),
242
- description ? /* @__PURE__ */ jsx("p", { className: styles2["alert-description"], children: description }) : null
243
+ description ? /* @__PURE__ */ jsx("p", { className: styles2["alert-description"], children: description }) : null,
244
+ children ? /* @__PURE__ */ jsx("div", { className: styles2["alert-body"], children }) : null
243
245
  ]
244
246
  }
245
247
  );
@@ -1257,7 +1259,7 @@ var DialogDescription = React15.forwardRef(({ className, ...props }, ref) => /*
1257
1259
  }
1258
1260
  ));
1259
1261
  DialogDescription.displayName = DialogPrimitive.Description.displayName;
1260
- var DialogContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles16["dialog-body"], "styled-vertical-scrollbar", className), ...props });
1262
+ var DialogContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles16["dialog-body"], className), ...props });
1261
1263
  DialogContent.displayName = "DialogContent";
1262
1264
  function Command({ className, ...props }) {
1263
1265
  return /* @__PURE__ */ jsx(Command$1, { "data-slot": "command", className: cn(styles17.command, className), ...props });
@@ -1888,7 +1890,7 @@ var DropdownMenuSubTrigger = React15.forwardRef(({ className, inset, children, .
1888
1890
  ...props,
1889
1891
  children: [
1890
1892
  children,
1891
- /* @__PURE__ */ jsx(ChevronRightIcon2, { className: "ml-auto" })
1893
+ /* @__PURE__ */ jsx(ChevronRightIcon2, { className: styles22["dropdown-menu-subtrigger-chevron"] })
1892
1894
  ]
1893
1895
  }
1894
1896
  );
@@ -1966,7 +1968,7 @@ var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, onKey
1966
1968
  },
1967
1969
  ...props,
1968
1970
  children: [
1969
- ctx?.enabled ? /* @__PURE__ */ jsx("div", { className: "sr-only", role: "status", "aria-live": "polite", children: searching && resultCount > 0 ? `${resultCount} result${resultCount === 1 ? "" : "s"} available` : null }) : null,
1971
+ ctx?.enabled ? /* @__PURE__ */ jsx("div", { className: styles22["dropdown-menu-sr-status"], role: "status", "aria-live": "polite", children: searching && resultCount > 0 ? `${resultCount} result${resultCount === 1 ? "" : "s"} available` : null }) : null,
1970
1972
  children
1971
1973
  ]
1972
1974
  }
@@ -2014,7 +2016,7 @@ var DropdownMenuSearch = React15.forwardRef(
2014
2016
  }, [alwaysVisible, visible, reveal]);
2015
2017
  if (!alwaysVisible && !visible) return null;
2016
2018
  return /* @__PURE__ */ jsxs("div", { className: styles22["dropdown-menu-search"], children: [
2017
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "flex shrink-0", children: icon ?? /* @__PURE__ */ jsx(SearchIcon2, { className: styles22["icon-size"] }) }),
2019
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: styles22["dropdown-menu-item-icon"], children: icon ?? /* @__PURE__ */ jsx(SearchIcon2, { className: styles22["icon-size"] }) }),
2018
2020
  /* @__PURE__ */ jsx(
2019
2021
  "input",
2020
2022
  {
@@ -3379,7 +3381,7 @@ var SheetDescription = React15.forwardRef(({ className, ...props }, ref) => /* @
3379
3381
  }
3380
3382
  ));
3381
3383
  SheetDescription.displayName = DialogPrimitive.Description.displayName;
3382
- var SheetContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles48["sheet-body"], "styled-vertical-scrollbar", className), ...props });
3384
+ var SheetContent = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles48["sheet-body"], className), ...props });
3383
3385
  SheetContent.displayName = "SheetContent";
3384
3386
  function Skeleton({ className, ...props }) {
3385
3387
  return /* @__PURE__ */ jsx("div", { className: cn(styles49["skeleton"], className), ...props });
@@ -3548,7 +3550,7 @@ var TableRow = React15.forwardRef(
3548
3550
  onClick: onClick ? handleClick : void 0,
3549
3551
  ...props,
3550
3552
  children: [
3551
- href && /* @__PURE__ */ jsx("a", { href, className: styles53["table-row-link"], "data-table-row-link": true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: hrefLabel }) }),
3553
+ href && /* @__PURE__ */ jsx("a", { href, className: styles53["table-row-link"], "data-table-row-link": true, children: /* @__PURE__ */ jsx("span", { className: styles53["table-row-link-label"], children: hrefLabel }) }),
3552
3554
  children
3553
3555
  ]
3554
3556
  }
@@ -3575,7 +3577,8 @@ var Tabs = ({
3575
3577
  className,
3576
3578
  tabsListBackground = "transparent",
3577
3579
  defaultValue,
3578
- onValueChange
3580
+ onValueChange,
3581
+ staticRender = false
3579
3582
  }) => {
3580
3583
  const [activeTab, setActiveTab] = useState(defaultValue ?? items[0].value);
3581
3584
  const isFilled = tabsListBackground === "filled";
@@ -3589,15 +3592,19 @@ var Tabs = ({
3589
3592
  }
3590
3593
  return null;
3591
3594
  };
3595
+ const indicatorClass = cn(
3596
+ styles55["active-tab-indicator"],
3597
+ isFilled ? styles55["active-tab-indicator--filled"] : styles55["active-tab-indicator--transparent"]
3598
+ );
3592
3599
  const renderActiveStyle = (isActive) => {
3600
+ if (staticRender) {
3601
+ return /* @__PURE__ */ jsx("span", { className: cn(indicatorClass, styles55["active-tab-indicator--static"]) });
3602
+ }
3593
3603
  if (isActive) {
3594
3604
  return /* @__PURE__ */ jsx(
3595
3605
  motion.span,
3596
3606
  {
3597
- className: cn(
3598
- styles55["active-tab-indicator"],
3599
- isFilled ? styles55["active-tab-indicator--filled"] : styles55["active-tab-indicator--transparent"]
3600
- ),
3607
+ className: indicatorClass,
3601
3608
  initial: false,
3602
3609
  layoutId: `${id}-active-tab-indicator`
3603
3610
  }
@@ -3641,7 +3648,16 @@ var Tabs = ({
3641
3648
  })
3642
3649
  }
3643
3650
  ),
3644
- items.map(({ value, content }) => /* @__PURE__ */ jsx(TabsContent, { value, className: styles55["content"], children: content }, value))
3651
+ items.map(({ value, content }) => /* @__PURE__ */ jsx(
3652
+ TabsContent,
3653
+ {
3654
+ value,
3655
+ className: styles55["content"],
3656
+ forceMount: staticRender || void 0,
3657
+ children: content
3658
+ },
3659
+ value
3660
+ ))
3645
3661
  ]
3646
3662
  }
3647
3663
  );