@eqtylab/equality 4.0.0 → 4.1.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
 
@@ -827,14 +840,17 @@ interface TabsProps {
827
840
  icon?: React.ReactElement | string;
828
841
  suffix?: React.ReactNode;
829
842
  content: React.ReactNode;
830
- triggerProps?: Omit<ComponentPropsWithoutRef<typeof TabsTrigger>, 'value'>;
843
+ triggerProps?: Omit<ComponentPropsWithoutRef<typeof TabsTrigger>, 'value'> & {
844
+ [key: `data-${string}`]: string | number | boolean | undefined;
845
+ };
831
846
  }[];
832
847
  className?: string;
833
848
  tabsListBackground?: 'transparent' | 'filled';
834
849
  defaultValue?: string;
835
850
  onValueChange?: (value: string) => void;
851
+ staticRender?: boolean;
836
852
  }
837
- declare const Tabs: ({ id, items, className, tabsListBackground, defaultValue, onValueChange, }: TabsProps) => react_jsx_runtime.JSX.Element;
853
+ declare const Tabs: ({ id, items, className, tabsListBackground, defaultValue, onValueChange, staticRender, }: TabsProps) => react_jsx_runtime.JSX.Element;
838
854
 
839
855
  declare const Textarea: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React$1.RefAttributes<HTMLTextAreaElement>>;
840
856
 
@@ -938,7 +954,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
938
954
 
939
955
  declare const iconVariants: (props?: ({
940
956
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
941
- background?: "circle" | "square" | "transparent" | null | undefined;
957
+ background?: "square" | "circle" | "transparent" | null | undefined;
942
958
  } & class_variance_authority_types.ClassProp) | undefined) => string;
943
959
  declare const iconElevationVariants: (props?: ({
944
960
  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
 
@@ -827,14 +840,17 @@ interface TabsProps {
827
840
  icon?: React.ReactElement | string;
828
841
  suffix?: React.ReactNode;
829
842
  content: React.ReactNode;
830
- triggerProps?: Omit<ComponentPropsWithoutRef<typeof TabsTrigger>, 'value'>;
843
+ triggerProps?: Omit<ComponentPropsWithoutRef<typeof TabsTrigger>, 'value'> & {
844
+ [key: `data-${string}`]: string | number | boolean | undefined;
845
+ };
831
846
  }[];
832
847
  className?: string;
833
848
  tabsListBackground?: 'transparent' | 'filled';
834
849
  defaultValue?: string;
835
850
  onValueChange?: (value: string) => void;
851
+ staticRender?: boolean;
836
852
  }
837
- declare const Tabs: ({ id, items, className, tabsListBackground, defaultValue, onValueChange, }: TabsProps) => react_jsx_runtime.JSX.Element;
853
+ declare const Tabs: ({ id, items, className, tabsListBackground, defaultValue, onValueChange, staticRender, }: TabsProps) => react_jsx_runtime.JSX.Element;
838
854
 
839
855
  declare const Textarea: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React$1.RefAttributes<HTMLTextAreaElement>>;
840
856
 
@@ -938,7 +954,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
938
954
 
939
955
  declare const iconVariants: (props?: ({
940
956
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
941
- background?: "circle" | "square" | "transparent" | null | undefined;
957
+ background?: "square" | "circle" | "transparent" | null | undefined;
942
958
  } & class_variance_authority_types.ClassProp) | undefined) => string;
943
959
  declare const iconElevationVariants: (props?: ({
944
960
  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
  );
@@ -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
  {
@@ -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
  );