@trackunit/react-table 2.7.48 → 2.7.49

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/index.cjs.js CHANGED
@@ -154,37 +154,40 @@ const actionDataToMenuItem = (action, dataTestId) => {
154
154
  */
155
155
  const actionDataToActionButton = (action) => (jsxRuntime.jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", "data-testid": action["data-testid"] || action.id, disabled: action.loading || action.disabled, id: action.id, variant: action.disabled ? "ghost" : undefined }, action.id));
156
156
 
157
- const cvaActionSheet = cssClassVarianceUtilities.cvaMerge([
158
- "w-[760px]",
159
- "max-w-[80%]",
160
- "animate-fade-in-fast",
161
- "grid",
162
- "grid-cols-[min-content_1fr]",
163
- "sm:grid-cols-[min-content_min-content_1fr_min-content]",
164
- "sm:grid-rows-1",
165
- "p-2",
166
- "bg-primary-600",
167
- "gap-1",
168
- "rounded-2xl",
169
- "z-top",
170
- "shadow-2xl",
171
- "fixed",
172
- "bottom-24",
173
- "left-1/2",
174
- "-translate-x-1/2",
175
- ]);
176
- const cvaDivider = cssClassVarianceUtilities.cvaMerge(["border-primary-500", "row-start-2", "col-span-4", "sm:hidden", "min-h-px"]);
177
- const cvaActionContainerAndOverflow = cssClassVarianceUtilities.cvaMerge([
178
- "row-start-3",
179
- "col-span-full",
180
- "flex",
181
- "flex-row",
182
- "gap-2",
183
- "overflow-hidden",
184
- "sm:row-start-1",
185
- "sm:col-span-3",
186
- "sm:justify-end",
187
- ], {
157
+ const cvaActionSheet = cssClassVarianceUtilities.cva({
158
+ base: [
159
+ "w-[760px]",
160
+ "max-w-[80%]",
161
+ "animate-fade-in-fast",
162
+ "grid",
163
+ "grid-cols-[min-content_1fr]",
164
+ "sm:grid-cols-[min-content_min-content_1fr_min-content]",
165
+ "sm:grid-rows-1",
166
+ "p-2",
167
+ "bg-primary-600",
168
+ "gap-1",
169
+ "rounded-2xl",
170
+ "z-top",
171
+ "shadow-2xl",
172
+ "fixed",
173
+ "bottom-24",
174
+ "left-1/2",
175
+ "-translate-x-1/2",
176
+ ],
177
+ });
178
+ const cvaDivider = cssClassVarianceUtilities.cva({ base: ["border-primary-500", "row-start-2", "col-span-4", "sm:hidden", "min-h-px"] });
179
+ const cvaActionContainerAndOverflow = cssClassVarianceUtilities.cva({
180
+ base: [
181
+ "row-start-3",
182
+ "col-span-full",
183
+ "flex",
184
+ "flex-row",
185
+ "gap-2",
186
+ "overflow-hidden",
187
+ "sm:row-start-1",
188
+ "sm:col-span-3",
189
+ "sm:justify-end",
190
+ ],
188
191
  variants: {
189
192
  isDropdown: {
190
193
  true: [],
@@ -192,17 +195,18 @@ const cvaActionContainerAndOverflow = cssClassVarianceUtilities.cvaMerge([
192
195
  },
193
196
  },
194
197
  });
195
- const cvaMoreContainer = cssClassVarianceUtilities.cvaMerge([
196
- "row-start-4",
197
- "col-span-full",
198
- "sm:col-span-1",
199
- "flex",
200
- "flex-row",
201
- "justify-between",
202
- "gap-2",
203
- "sm:row-start-1",
204
- "sm:col-span-3",
205
- ], {
198
+ const cvaMoreContainer = cssClassVarianceUtilities.cva({
199
+ base: [
200
+ "row-start-4",
201
+ "col-span-full",
202
+ "sm:col-span-1",
203
+ "flex",
204
+ "flex-row",
205
+ "justify-between",
206
+ "gap-2",
207
+ "sm:row-start-1",
208
+ "sm:col-span-3",
209
+ ],
206
210
  variants: {
207
211
  isDropdown: {
208
212
  true: [],
@@ -644,7 +648,8 @@ const useTablePersistence = (persistenceKey) => {
644
648
  }), [initialState, onTableStateChange]);
645
649
  };
646
650
 
647
- const cvaColumnFilterGrabbable = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "justify-center"], {
651
+ const cvaColumnFilterGrabbable = cssClassVarianceUtilities.cva({
652
+ base: ["flex", "items-center", "justify-center"],
648
653
  variants: {
649
654
  disabled: {
650
655
  true: "cursor-not-allowed text-neutral-400",
@@ -1506,7 +1511,7 @@ const Table = ({ rowHeight = 50, loading = false, hideFooter = false, style, ...
1506
1511
  : null, jsxRuntime.jsx(ColumnActions, { getColumn: props.getColumn, header: header, setSorting: props.setSorting, visibleColumnsCount: visibleColumnsCount })] })] })),
1507
1512
  !header.column.columnDef.meta?.shouldGrow && header.column.getCanResize() ? (jsxRuntime.jsx(reactTableBaseComponents.ResizeHandle, { isResizing: header.column.getIsResizing(), onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler() })) : null));
1508
1513
  }) }, headerGroup.id));
1509
- }) }), hasResults ? (jsxRuntime.jsx(reactTableBaseComponents.Tbody, { className: "relative text-sm font-normal contain-layout", ref: virtualizer.containerRef, children: virtualizer.getVirtualItems().map((virtualRow) => {
1514
+ }) }), hasResults ? (jsxRuntime.jsx(reactTableBaseComponents.Tbody, { className: "contain-layout relative text-sm font-normal", ref: virtualizer.containerRef, children: virtualizer.getVirtualItems().map((virtualRow) => {
1510
1515
  const row = props.getRowModel().rows[virtualRow.index];
1511
1516
  if (!row) {
1512
1517
  return null;
@@ -1577,7 +1582,8 @@ const Table = ({ rowHeight = 50, loading = false, hideFooter = false, style, ...
1577
1582
  total: props.getRowModel().rows.length,
1578
1583
  }) }), props.pagination?.isLoading ? (jsxRuntime.jsx("span", { className: "ml-2", children: jsxRuntime.jsx(reactComponents.Spinner, { size: "small" }) })) : null, props.footerRightActions !== undefined && props.footerRightActions !== null ? (jsxRuntime.jsx("div", { className: "flex flex-1 justify-end", children: props.footerRightActions })) : null] }))] }));
1579
1584
  };
1580
- const cvaTBody = cssClassVarianceUtilities.cvaMerge(["min-h-[40dvh]"], {
1585
+ const cvaTBody = cssClassVarianceUtilities.cva({
1586
+ base: ["min-h-[40dvh]"],
1581
1587
  variants: {
1582
1588
  emptyState: {
1583
1589
  true: "min-h-[400px]",
@@ -1587,7 +1593,8 @@ const cvaTBody = cssClassVarianceUtilities.cvaMerge(["min-h-[40dvh]"], {
1587
1593
  emptyState: false,
1588
1594
  },
1589
1595
  });
1590
- const cvaColumnHeaderContainer = cssClassVarianceUtilities.cvaMerge(["flex", "min-w-0", "w-full", "items-center", "self-center"], {
1596
+ const cvaColumnHeaderContainer = cssClassVarianceUtilities.cva({
1597
+ base: ["flex", "min-w-0", "w-full", "items-center", "self-center"],
1591
1598
  variants: {
1592
1599
  sortable: {
1593
1600
  true: "cursor-pointer select-none",
@@ -1597,7 +1604,8 @@ const cvaColumnHeaderContainer = cssClassVarianceUtilities.cvaMerge(["flex", "mi
1597
1604
  sortable: false,
1598
1605
  },
1599
1606
  });
1600
- const cvaTh = cssClassVarianceUtilities.cvaMerge(["flex", "relative"], {
1607
+ const cvaTh = cssClassVarianceUtilities.cva({
1608
+ base: ["flex", "relative"],
1601
1609
  variants: {
1602
1610
  pinned: {
1603
1611
  left: "sticky left-0 z-[3] bg-neutral-100",
@@ -1625,7 +1633,8 @@ const cvaTh = cssClassVarianceUtilities.cvaMerge(["flex", "relative"], {
1625
1633
  },
1626
1634
  });
1627
1635
  const sharedPinnedStyles = "sticky z-[1] group-has-[:checked]:bg-primary-50 group-hover:has-[:checked]:bg-primary-50 group-focus-within:has-[:checked]:bg-primary-50 bg-white group-hover:bg-neutral-100";
1628
- const cvaTd = cssClassVarianceUtilities.cvaMerge(["relative"], {
1636
+ const cvaTd = cssClassVarianceUtilities.cva({
1637
+ base: ["relative"],
1629
1638
  variants: {
1630
1639
  pinned: {
1631
1640
  left: `${sharedPinnedStyles} left-0`,
package/index.esm.js CHANGED
@@ -4,7 +4,7 @@ import { Icon, MenuItem, Button, Tooltip, useOverflowItems, MoreMenu, MenuConten
4
4
  import { Link } from '@tanstack/react-router';
5
5
  import { objectValues, VISIBLE_ONLY_COLUMN_VISIBILITY_KEY, objectKeys, nonNullable, objectEntries } from '@trackunit/shared-utils';
6
6
  import { useMemo, Children, cloneElement, useCallback, useState, useEffect, useRef, createElement } from 'react';
7
- import { cvaMerge } from '@trackunit/css-class-variance-utilities';
7
+ import { cva } from '@trackunit/css-class-variance-utilities';
8
8
  import { useCurrentUser } from '@trackunit/react-core-hooks';
9
9
  import { z } from 'zod';
10
10
  import { cvaLabel, ToggleSwitch, Search, RadioGroup, RadioItem, Checkbox } from '@trackunit/react-form-components';
@@ -153,37 +153,40 @@ const actionDataToMenuItem = (action, dataTestId) => {
153
153
  */
154
154
  const actionDataToActionButton = (action) => (jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", "data-testid": action["data-testid"] || action.id, disabled: action.loading || action.disabled, id: action.id, variant: action.disabled ? "ghost" : undefined }, action.id));
155
155
 
156
- const cvaActionSheet = cvaMerge([
157
- "w-[760px]",
158
- "max-w-[80%]",
159
- "animate-fade-in-fast",
160
- "grid",
161
- "grid-cols-[min-content_1fr]",
162
- "sm:grid-cols-[min-content_min-content_1fr_min-content]",
163
- "sm:grid-rows-1",
164
- "p-2",
165
- "bg-primary-600",
166
- "gap-1",
167
- "rounded-2xl",
168
- "z-top",
169
- "shadow-2xl",
170
- "fixed",
171
- "bottom-24",
172
- "left-1/2",
173
- "-translate-x-1/2",
174
- ]);
175
- const cvaDivider = cvaMerge(["border-primary-500", "row-start-2", "col-span-4", "sm:hidden", "min-h-px"]);
176
- const cvaActionContainerAndOverflow = cvaMerge([
177
- "row-start-3",
178
- "col-span-full",
179
- "flex",
180
- "flex-row",
181
- "gap-2",
182
- "overflow-hidden",
183
- "sm:row-start-1",
184
- "sm:col-span-3",
185
- "sm:justify-end",
186
- ], {
156
+ const cvaActionSheet = cva({
157
+ base: [
158
+ "w-[760px]",
159
+ "max-w-[80%]",
160
+ "animate-fade-in-fast",
161
+ "grid",
162
+ "grid-cols-[min-content_1fr]",
163
+ "sm:grid-cols-[min-content_min-content_1fr_min-content]",
164
+ "sm:grid-rows-1",
165
+ "p-2",
166
+ "bg-primary-600",
167
+ "gap-1",
168
+ "rounded-2xl",
169
+ "z-top",
170
+ "shadow-2xl",
171
+ "fixed",
172
+ "bottom-24",
173
+ "left-1/2",
174
+ "-translate-x-1/2",
175
+ ],
176
+ });
177
+ const cvaDivider = cva({ base: ["border-primary-500", "row-start-2", "col-span-4", "sm:hidden", "min-h-px"] });
178
+ const cvaActionContainerAndOverflow = cva({
179
+ base: [
180
+ "row-start-3",
181
+ "col-span-full",
182
+ "flex",
183
+ "flex-row",
184
+ "gap-2",
185
+ "overflow-hidden",
186
+ "sm:row-start-1",
187
+ "sm:col-span-3",
188
+ "sm:justify-end",
189
+ ],
187
190
  variants: {
188
191
  isDropdown: {
189
192
  true: [],
@@ -191,17 +194,18 @@ const cvaActionContainerAndOverflow = cvaMerge([
191
194
  },
192
195
  },
193
196
  });
194
- const cvaMoreContainer = cvaMerge([
195
- "row-start-4",
196
- "col-span-full",
197
- "sm:col-span-1",
198
- "flex",
199
- "flex-row",
200
- "justify-between",
201
- "gap-2",
202
- "sm:row-start-1",
203
- "sm:col-span-3",
204
- ], {
197
+ const cvaMoreContainer = cva({
198
+ base: [
199
+ "row-start-4",
200
+ "col-span-full",
201
+ "sm:col-span-1",
202
+ "flex",
203
+ "flex-row",
204
+ "justify-between",
205
+ "gap-2",
206
+ "sm:row-start-1",
207
+ "sm:col-span-3",
208
+ ],
205
209
  variants: {
206
210
  isDropdown: {
207
211
  true: [],
@@ -643,7 +647,8 @@ const useTablePersistence = (persistenceKey) => {
643
647
  }), [initialState, onTableStateChange]);
644
648
  };
645
649
 
646
- const cvaColumnFilterGrabbable = cvaMerge(["flex", "items-center", "justify-center"], {
650
+ const cvaColumnFilterGrabbable = cva({
651
+ base: ["flex", "items-center", "justify-center"],
647
652
  variants: {
648
653
  disabled: {
649
654
  true: "cursor-not-allowed text-neutral-400",
@@ -1505,7 +1510,7 @@ const Table = ({ rowHeight = 50, loading = false, hideFooter = false, style, ...
1505
1510
  : null, jsx(ColumnActions, { getColumn: props.getColumn, header: header, setSorting: props.setSorting, visibleColumnsCount: visibleColumnsCount })] })] })),
1506
1511
  !header.column.columnDef.meta?.shouldGrow && header.column.getCanResize() ? (jsx(ResizeHandle, { isResizing: header.column.getIsResizing(), onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler() })) : null));
1507
1512
  }) }, headerGroup.id));
1508
- }) }), hasResults ? (jsx(Tbody, { className: "relative text-sm font-normal contain-layout", ref: virtualizer.containerRef, children: virtualizer.getVirtualItems().map((virtualRow) => {
1513
+ }) }), hasResults ? (jsx(Tbody, { className: "contain-layout relative text-sm font-normal", ref: virtualizer.containerRef, children: virtualizer.getVirtualItems().map((virtualRow) => {
1509
1514
  const row = props.getRowModel().rows[virtualRow.index];
1510
1515
  if (!row) {
1511
1516
  return null;
@@ -1576,7 +1581,8 @@ const Table = ({ rowHeight = 50, loading = false, hideFooter = false, style, ...
1576
1581
  total: props.getRowModel().rows.length,
1577
1582
  }) }), props.pagination?.isLoading ? (jsx("span", { className: "ml-2", children: jsx(Spinner, { size: "small" }) })) : null, props.footerRightActions !== undefined && props.footerRightActions !== null ? (jsx("div", { className: "flex flex-1 justify-end", children: props.footerRightActions })) : null] }))] }));
1578
1583
  };
1579
- const cvaTBody = cvaMerge(["min-h-[40dvh]"], {
1584
+ const cvaTBody = cva({
1585
+ base: ["min-h-[40dvh]"],
1580
1586
  variants: {
1581
1587
  emptyState: {
1582
1588
  true: "min-h-[400px]",
@@ -1586,7 +1592,8 @@ const cvaTBody = cvaMerge(["min-h-[40dvh]"], {
1586
1592
  emptyState: false,
1587
1593
  },
1588
1594
  });
1589
- const cvaColumnHeaderContainer = cvaMerge(["flex", "min-w-0", "w-full", "items-center", "self-center"], {
1595
+ const cvaColumnHeaderContainer = cva({
1596
+ base: ["flex", "min-w-0", "w-full", "items-center", "self-center"],
1590
1597
  variants: {
1591
1598
  sortable: {
1592
1599
  true: "cursor-pointer select-none",
@@ -1596,7 +1603,8 @@ const cvaColumnHeaderContainer = cvaMerge(["flex", "min-w-0", "w-full", "items-c
1596
1603
  sortable: false,
1597
1604
  },
1598
1605
  });
1599
- const cvaTh = cvaMerge(["flex", "relative"], {
1606
+ const cvaTh = cva({
1607
+ base: ["flex", "relative"],
1600
1608
  variants: {
1601
1609
  pinned: {
1602
1610
  left: "sticky left-0 z-[3] bg-neutral-100",
@@ -1624,7 +1632,8 @@ const cvaTh = cvaMerge(["flex", "relative"], {
1624
1632
  },
1625
1633
  });
1626
1634
  const sharedPinnedStyles = "sticky z-[1] group-has-[:checked]:bg-primary-50 group-hover:has-[:checked]:bg-primary-50 group-focus-within:has-[:checked]:bg-primary-50 bg-white group-hover:bg-neutral-100";
1627
- const cvaTd = cvaMerge(["relative"], {
1635
+ const cvaTd = cva({
1636
+ base: ["relative"],
1628
1637
  variants: {
1629
1638
  pinned: {
1630
1639
  left: `${sharedPinnedStyles} left-0`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-table",
3
- "version": "2.7.48",
3
+ "version": "2.7.49",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -11,15 +11,15 @@
11
11
  "react-dnd": "16.0.1",
12
12
  "react-dnd-html5-backend": "16.0.1",
13
13
  "tailwind-merge": "^2.0.0",
14
- "@trackunit/react-components": "2.13.0",
15
- "@trackunit/react-core-hooks": "1.21.41",
16
- "@trackunit/shared-utils": "1.16.32",
17
- "@trackunit/css-class-variance-utilities": "1.14.29",
18
- "@trackunit/ui-icons": "1.14.28",
19
- "@trackunit/react-table-base-components": "2.6.48",
20
- "@trackunit/react-form-components": "2.6.48",
21
- "@trackunit/i18n-library-translation": "2.4.41",
22
- "@trackunit/iris-app-runtime-core-api": "1.17.41",
14
+ "@trackunit/react-components": "2.13.1",
15
+ "@trackunit/react-core-hooks": "1.21.42",
16
+ "@trackunit/shared-utils": "1.16.33",
17
+ "@trackunit/css-class-variance-utilities": "2.0.0",
18
+ "@trackunit/ui-icons": "1.14.29",
19
+ "@trackunit/react-table-base-components": "2.6.49",
20
+ "@trackunit/react-form-components": "2.6.49",
21
+ "@trackunit/i18n-library-translation": "2.4.42",
22
+ "@trackunit/iris-app-runtime-core-api": "1.17.42",
23
23
  "zod": "^3.25.76"
24
24
  },
25
25
  "peerDependencies": {
@@ -1,8 +1,56 @@
1
- export declare const cvaActionSheet: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
2
- export declare const cvaDivider: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
3
- export declare const cvaActionContainerAndOverflow: (props?: ({
4
- isDropdown?: boolean | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- export declare const cvaMoreContainer: (props?: ({
7
- isDropdown?: boolean | null | undefined;
8
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1
+ export declare const cvaActionSheet: import("cva").CVAComponent<Omit<{
2
+ base: string[];
3
+ }, "defaultVariants"> & {
4
+ variants: unknown;
5
+ defaultVariants: Omit<{}, never>;
6
+ }, unknown>;
7
+ export declare const cvaDivider: import("cva").CVAComponent<Omit<{
8
+ base: string[];
9
+ }, "defaultVariants"> & {
10
+ variants: unknown;
11
+ defaultVariants: Omit<{}, never>;
12
+ }, unknown>;
13
+ export declare const cvaActionContainerAndOverflow: import("cva").CVAComponent<Omit<{
14
+ base: string[];
15
+ variants: {
16
+ isDropdown: {
17
+ true: never[];
18
+ false: string[];
19
+ };
20
+ };
21
+ }, "defaultVariants"> & {
22
+ variants: {
23
+ isDropdown: {
24
+ true: never[];
25
+ false: string[];
26
+ };
27
+ };
28
+ defaultVariants: Omit<{}, never>;
29
+ }, {
30
+ isDropdown: {
31
+ true: never[];
32
+ false: string[];
33
+ };
34
+ }>;
35
+ export declare const cvaMoreContainer: import("cva").CVAComponent<Omit<{
36
+ base: string[];
37
+ variants: {
38
+ isDropdown: {
39
+ true: never[];
40
+ false: string[];
41
+ };
42
+ };
43
+ }, "defaultVariants"> & {
44
+ variants: {
45
+ isDropdown: {
46
+ true: never[];
47
+ false: string[];
48
+ };
49
+ };
50
+ defaultVariants: Omit<{}, never>;
51
+ }, {
52
+ isDropdown: {
53
+ true: never[];
54
+ false: string[];
55
+ };
56
+ }>;
@@ -1,3 +1,22 @@
1
- export declare const cvaColumnFilterGrabbable: (props?: ({
2
- disabled?: boolean | null | undefined;
3
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1
+ export declare const cvaColumnFilterGrabbable: import("cva").CVAComponent<Omit<{
2
+ base: string[];
3
+ variants: {
4
+ disabled: {
5
+ true: string;
6
+ false: string;
7
+ };
8
+ };
9
+ }, "defaultVariants"> & {
10
+ variants: {
11
+ disabled: {
12
+ true: string;
13
+ false: string;
14
+ };
15
+ };
16
+ defaultVariants: Omit<{}, never>;
17
+ }, {
18
+ disabled: {
19
+ true: string;
20
+ false: string;
21
+ };
22
+ }>;