@eqtylab/equality 1.4.1 → 1.5.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
@@ -51,14 +51,14 @@ declare const AlertDialogFooter: {
51
51
  declare const AlertDialogTitle: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
52
52
  declare const AlertDialogDescription: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
53
53
  declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<Omit<AlertDialogPrimitive.AlertDialogActionProps & React$1.RefAttributes<HTMLButtonElement>, "ref">, "prefix"> & VariantProps<(props?: ({
54
- variant?: "link" | "danger" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
54
+ variant?: "danger" | "link" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
55
55
  size?: "sm" | "md" | "lg" | null | undefined;
56
56
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
57
57
  prefix?: React$1.ReactNode;
58
58
  suffix?: React$1.ReactNode;
59
59
  } & React$1.RefAttributes<HTMLButtonElement>>;
60
60
  declare const AlertDialogCancel: React$1.ForwardRefExoticComponent<Omit<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React$1.RefAttributes<HTMLButtonElement>, "ref">, "prefix"> & VariantProps<(props?: ({
61
- variant?: "link" | "danger" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
61
+ variant?: "danger" | "link" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
62
62
  size?: "sm" | "md" | "lg" | null | undefined;
63
63
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
64
64
  prefix?: React$1.ReactNode;
@@ -166,7 +166,7 @@ declare const BgGradient: ({ theme, placement, }: {
166
166
  }) => react_jsx_runtime.JSX.Element;
167
167
 
168
168
  declare const buttonVariants: (props?: ({
169
- variant?: "link" | "danger" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
169
+ variant?: "danger" | "link" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
170
170
  size?: "sm" | "md" | "lg" | null | undefined;
171
171
  } & class_variance_authority_types.ClassProp) | undefined) => string;
172
172
  type ButtonBaseProps = Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'>;
@@ -665,13 +665,23 @@ declare function SortButton<T extends string>({ field, children, icon, sortField
665
665
 
666
666
  declare const TableContainer: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableElement> & VariantProps<(props?: ({
667
667
  elevation?: string | number | null | undefined;
668
- } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLTableElement>>;
669
- declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
668
+ } & class_variance_authority_types.ClassProp) | undefined) => string> & {
669
+ tableLayout?: "auto" | "fixed";
670
+ } & React$1.RefAttributes<HTMLTableElement>>;
671
+ declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & {
672
+ sticky?: boolean;
673
+ } & React$1.RefAttributes<HTMLTableSectionElement>>;
670
674
  declare const TableBody: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
671
675
  declare const TableFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
672
- declare const TableRow: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableRowElement> & React$1.RefAttributes<HTMLTableRowElement>>;
673
- declare const TableHead: React$1.ForwardRefExoticComponent<React$1.ThHTMLAttributes<HTMLTableCellElement> & React$1.RefAttributes<HTMLTableCellElement>>;
674
- declare const TableCell: React$1.ForwardRefExoticComponent<React$1.TdHTMLAttributes<HTMLTableCellElement> & React$1.RefAttributes<HTMLTableCellElement>>;
676
+ declare const TableRow: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableRowElement> & {
677
+ clickable?: boolean;
678
+ } & React$1.RefAttributes<HTMLTableRowElement>>;
679
+ declare const TableHead: React$1.ForwardRefExoticComponent<React$1.ThHTMLAttributes<HTMLTableCellElement> & {
680
+ truncate?: boolean;
681
+ } & React$1.RefAttributes<HTMLTableCellElement>>;
682
+ declare const TableCell: React$1.ForwardRefExoticComponent<React$1.TdHTMLAttributes<HTMLTableCellElement> & {
683
+ truncate?: boolean;
684
+ } & React$1.RefAttributes<HTMLTableCellElement>>;
675
685
  declare const TableCaption: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableCaptionElement> & React$1.RefAttributes<HTMLTableCaptionElement>>;
676
686
 
677
687
  type TableColumn = {
@@ -696,11 +706,12 @@ interface TableProps extends VariantProps<typeof tableElevationVariants> {
696
706
  className?: string;
697
707
  border?: boolean;
698
708
  emptyState?: React$1.ReactNode;
709
+ tableLayout?: 'auto' | 'fixed';
699
710
  }
700
711
  declare const tableElevationVariants: (props?: ({
701
712
  elevation?: string | number | null | undefined;
702
713
  } & class_variance_authority_types.ClassProp) | undefined) => string;
703
- declare const Table: ({ columns, rows, className, border, elevation, emptyState, }: TableProps) => react_jsx_runtime.JSX.Element;
714
+ declare const Table: ({ columns, rows, className, border, elevation, emptyState, tableLayout, }: TableProps) => react_jsx_runtime.JSX.Element;
704
715
 
705
716
  declare const TabsContainer: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
706
717
  declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
package/dist/index.d.ts CHANGED
@@ -51,14 +51,14 @@ declare const AlertDialogFooter: {
51
51
  declare const AlertDialogTitle: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
52
52
  declare const AlertDialogDescription: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
53
53
  declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<Omit<AlertDialogPrimitive.AlertDialogActionProps & React$1.RefAttributes<HTMLButtonElement>, "ref">, "prefix"> & VariantProps<(props?: ({
54
- variant?: "link" | "danger" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
54
+ variant?: "danger" | "link" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
55
55
  size?: "sm" | "md" | "lg" | null | undefined;
56
56
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
57
57
  prefix?: React$1.ReactNode;
58
58
  suffix?: React$1.ReactNode;
59
59
  } & React$1.RefAttributes<HTMLButtonElement>>;
60
60
  declare const AlertDialogCancel: React$1.ForwardRefExoticComponent<Omit<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React$1.RefAttributes<HTMLButtonElement>, "ref">, "prefix"> & VariantProps<(props?: ({
61
- variant?: "link" | "danger" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
61
+ variant?: "danger" | "link" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
62
62
  size?: "sm" | "md" | "lg" | null | undefined;
63
63
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
64
64
  prefix?: React$1.ReactNode;
@@ -166,7 +166,7 @@ declare const BgGradient: ({ theme, placement, }: {
166
166
  }) => react_jsx_runtime.JSX.Element;
167
167
 
168
168
  declare const buttonVariants: (props?: ({
169
- variant?: "link" | "danger" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
169
+ variant?: "danger" | "link" | "navigation" | "primary" | "secondary" | "tertiary" | null | undefined;
170
170
  size?: "sm" | "md" | "lg" | null | undefined;
171
171
  } & class_variance_authority_types.ClassProp) | undefined) => string;
172
172
  type ButtonBaseProps = Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'>;
@@ -665,13 +665,23 @@ declare function SortButton<T extends string>({ field, children, icon, sortField
665
665
 
666
666
  declare const TableContainer: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableElement> & VariantProps<(props?: ({
667
667
  elevation?: string | number | null | undefined;
668
- } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLTableElement>>;
669
- declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
668
+ } & class_variance_authority_types.ClassProp) | undefined) => string> & {
669
+ tableLayout?: "auto" | "fixed";
670
+ } & React$1.RefAttributes<HTMLTableElement>>;
671
+ declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & {
672
+ sticky?: boolean;
673
+ } & React$1.RefAttributes<HTMLTableSectionElement>>;
670
674
  declare const TableBody: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
671
675
  declare const TableFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
672
- declare const TableRow: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableRowElement> & React$1.RefAttributes<HTMLTableRowElement>>;
673
- declare const TableHead: React$1.ForwardRefExoticComponent<React$1.ThHTMLAttributes<HTMLTableCellElement> & React$1.RefAttributes<HTMLTableCellElement>>;
674
- declare const TableCell: React$1.ForwardRefExoticComponent<React$1.TdHTMLAttributes<HTMLTableCellElement> & React$1.RefAttributes<HTMLTableCellElement>>;
676
+ declare const TableRow: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableRowElement> & {
677
+ clickable?: boolean;
678
+ } & React$1.RefAttributes<HTMLTableRowElement>>;
679
+ declare const TableHead: React$1.ForwardRefExoticComponent<React$1.ThHTMLAttributes<HTMLTableCellElement> & {
680
+ truncate?: boolean;
681
+ } & React$1.RefAttributes<HTMLTableCellElement>>;
682
+ declare const TableCell: React$1.ForwardRefExoticComponent<React$1.TdHTMLAttributes<HTMLTableCellElement> & {
683
+ truncate?: boolean;
684
+ } & React$1.RefAttributes<HTMLTableCellElement>>;
675
685
  declare const TableCaption: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableCaptionElement> & React$1.RefAttributes<HTMLTableCaptionElement>>;
676
686
 
677
687
  type TableColumn = {
@@ -696,11 +706,12 @@ interface TableProps extends VariantProps<typeof tableElevationVariants> {
696
706
  className?: string;
697
707
  border?: boolean;
698
708
  emptyState?: React$1.ReactNode;
709
+ tableLayout?: 'auto' | 'fixed';
699
710
  }
700
711
  declare const tableElevationVariants: (props?: ({
701
712
  elevation?: string | number | null | undefined;
702
713
  } & class_variance_authority_types.ClassProp) | undefined) => string;
703
- declare const Table: ({ columns, rows, className, border, elevation, emptyState, }: TableProps) => react_jsx_runtime.JSX.Element;
714
+ declare const Table: ({ columns, rows, className, border, elevation, emptyState, tableLayout, }: TableProps) => react_jsx_runtime.JSX.Element;
704
715
 
705
716
  declare const TabsContainer: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
706
717
  declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
package/dist/index.js CHANGED
@@ -2702,21 +2702,62 @@ function SortButton({
2702
2702
  ] });
2703
2703
  }
2704
2704
  var tableElevationVariants = generateElevationVariants(styles50, "table", ELEVATION.RAISED);
2705
- var TableContainer = React15.forwardRef(({ className, elevation = ELEVATION.RAISED, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn(styles50["table"], tableElevationVariants({ elevation }), className), children: /* @__PURE__ */ jsx("table", { ref, className: styles50["table-inner"], ...props }) }));
2705
+ var TableContainer = React15.forwardRef(({ className, style, elevation = ELEVATION.RAISED, tableLayout, ...props }, ref) => /* @__PURE__ */ jsx(
2706
+ "div",
2707
+ {
2708
+ className: cn(styles50["table"], tableElevationVariants({ elevation }), className),
2709
+ style,
2710
+ children: /* @__PURE__ */ jsx(
2711
+ "table",
2712
+ {
2713
+ ref,
2714
+ className: styles50["table-inner"],
2715
+ style: tableLayout ? { tableLayout } : void 0,
2716
+ ...props
2717
+ }
2718
+ )
2719
+ }
2720
+ ));
2706
2721
  TableContainer.displayName = "Table";
2707
- var TableHeader = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn(styles50["table-header"], className), ...props }));
2722
+ var TableHeader = React15.forwardRef(({ className, sticky, ...props }, ref) => /* @__PURE__ */ jsx(
2723
+ "thead",
2724
+ {
2725
+ ref,
2726
+ className: cn(styles50["table-header"], sticky && styles50["table-header--sticky"], className),
2727
+ ...props
2728
+ }
2729
+ ));
2708
2730
  TableHeader.displayName = "TableHeader";
2709
2731
  var TableBody = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn(styles50["table-body"], className), ...props }));
2710
2732
  TableBody.displayName = "TableBody";
2711
2733
  var TableFooter = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tfoot", { ref, className: cn(styles50["table-footer"], className), ...props }));
2712
2734
  TableFooter.displayName = "TableFooter";
2713
- var TableRow = React15.forwardRef(
2714
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", { ref, className: cn(styles50["table-row"], className), ...props })
2715
- );
2735
+ var TableRow = React15.forwardRef(({ className, clickable, ...props }, ref) => /* @__PURE__ */ jsx(
2736
+ "tr",
2737
+ {
2738
+ ref,
2739
+ className: cn(styles50["table-row"], clickable && styles50["table-row--clickable"], className),
2740
+ ...props
2741
+ }
2742
+ ));
2716
2743
  TableRow.displayName = "TableRow";
2717
- var TableHead = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("th", { ref, className: cn(styles50["table-head"], className), ...props }));
2744
+ var TableHead = React15.forwardRef(({ className, truncate, ...props }, ref) => /* @__PURE__ */ jsx(
2745
+ "th",
2746
+ {
2747
+ ref,
2748
+ className: cn(styles50["table-head"], truncate && styles50["table-head--truncate"], className),
2749
+ ...props
2750
+ }
2751
+ ));
2718
2752
  TableHead.displayName = "TableHead";
2719
- var TableCell = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("td", { ref, className: cn(styles50["table-cell"], className), ...props }));
2753
+ var TableCell = React15.forwardRef(({ className, truncate, ...props }, ref) => /* @__PURE__ */ jsx(
2754
+ "td",
2755
+ {
2756
+ ref,
2757
+ className: cn(styles50["table-cell"], truncate && styles50["table-cell--truncate"], className),
2758
+ ...props
2759
+ }
2760
+ ));
2720
2761
  TableCell.displayName = "TableCell";
2721
2762
  var TableCaption = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className: cn(styles50["table-caption"], className), ...props }));
2722
2763
  TableCaption.displayName = "TableCaption";
@@ -2727,7 +2768,8 @@ var Table = ({
2727
2768
  className,
2728
2769
  border = false,
2729
2770
  elevation = ELEVATION.BASE,
2730
- emptyState
2771
+ emptyState,
2772
+ tableLayout
2731
2773
  }) => {
2732
2774
  const isEmpty = rows.length === 0;
2733
2775
  return /* @__PURE__ */ jsx(
@@ -2739,12 +2781,13 @@ var Table = ({
2739
2781
  tableElevationVariants2({ elevation }),
2740
2782
  className
2741
2783
  ),
2742
- children: /* @__PURE__ */ jsxs(TableContainer, { elevation, children: [
2784
+ children: /* @__PURE__ */ jsxs(TableContainer, { elevation, tableLayout, children: [
2743
2785
  /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsx(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsx(TableHead, { className: column.className, children: column.content }, column.key)) }) }),
2744
2786
  isEmpty && emptyState ? /* @__PURE__ */ jsx(TableBody, { children: /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: columns.length, className: styles51["table-empty-state"], children: emptyState }) }) }) : /* @__PURE__ */ jsx(TableBody, { children: rows.map((row) => /* @__PURE__ */ jsx(
2745
2787
  TableRow,
2746
2788
  {
2747
- className: cn(row.className, row.onClick && styles51["table-row-clickable"]),
2789
+ className: row.className,
2790
+ clickable: !!row.onClick,
2748
2791
  onClick: row.onClick,
2749
2792
  children: row.cells.map((cell) => /* @__PURE__ */ jsx(TableCell, { className: cell.className, children: cell.content }, cell.key))
2750
2793
  },