@trackunit/react-table 1.3.258 → 1.3.260

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
@@ -171,9 +171,10 @@ const ActionButton = ({ action, id, ...rest }) => {
171
171
  // eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
172
172
  jsxRuntime.jsx(reactComponents.Button, { asChild: true, id: id, loading: action.loading, prefix: jsxRuntime.jsx(ActionIcon, { action: action }), ...rest, children: jsxRuntime.jsx(reactRouter.Link, { to: action.url, children: action.label }) }));
173
173
  }
174
- return (jsxRuntime.jsx(reactComponents.Button, { id: id, loading: action.loading, onClick: e => action.method(e),
174
+ const content = (jsxRuntime.jsx(reactComponents.Button, { id: id, loading: action.loading, onClick: e => action.method(e),
175
175
  // eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
176
176
  prefix: jsxRuntime.jsx(ActionIcon, { action: action }), ...rest, children: action.label }));
177
+ return action.tip ? jsxRuntime.jsx(reactComponents.Tooltip, { label: action.tip, children: content }) : content;
177
178
  };
178
179
  /**
179
180
  * Converts an action model to a MenuItem component.
@@ -209,7 +210,7 @@ const actionDataToMenuItem = (action, dataTestId) => {
209
210
  * @param {string} [dataTestId] - Optional data test ID.
210
211
  * @returns {ReactElement} - The ActionButton component for the given action.
211
212
  */
212
- const actionDataToActionButton = (action) => (jsxRuntime.jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", dataTestId: action.dataTestId || action.id, disabled: action.loading, id: action.id }, action.id));
213
+ const actionDataToActionButton = (action) => (jsxRuntime.jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", dataTestId: action.dataTestId || action.id, disabled: action.loading || action.disabled, id: action.id, variant: action.disabled ? "ghost" : undefined }, action.id));
213
214
  /**
214
215
  * Renders the icon for an action button.
215
216
  * Should not be used outside the ActionSheet component.
@@ -1322,7 +1323,7 @@ const useTableSelection = ({ data, idKey, defaultSelectedIds, enableRowSelection
1322
1323
  return null;
1323
1324
  }
1324
1325
  const isRowSelectionDisabled = !table.options.enableRowSelection || !data.length;
1325
- return (jsxRuntime.jsx(reactFormComponents.Checkbox, { className: "ml-2.5",
1326
+ return (jsxRuntime.jsx(reactFormComponents.Checkbox, { className: "flex justify-center",
1326
1327
  checked: table.getIsAllRowsSelected(),
1327
1328
  indeterminate: table.getIsSomeRowsSelected(),
1328
1329
  onChange: table.getToggleAllRowsSelectedHandler(),
@@ -1346,7 +1347,7 @@ const useTableSelection = ({ data, idKey, defaultSelectedIds, enableRowSelection
1346
1347
  enableResizing: false,
1347
1348
  enableHiding: false,
1348
1349
  enablePinning: false,
1349
- size: 70,
1350
+ size: 48,
1350
1351
  meta: {
1351
1352
  alignment: "center",
1352
1353
  columnFilterLabel: t("table.selection.label"),
package/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
3
- import { MenuItem, Icon, Button, useOverflowItems, MoreMenu, MenuList, Spacer, cvaInteractableItem, Text, Tooltip, Popover, PopoverTrigger, PopoverContent, IconButton, Card, Spinner, EmptyState } from '@trackunit/react-components';
3
+ import { MenuItem, Icon, Button, Tooltip, useOverflowItems, MoreMenu, MenuList, Spacer, cvaInteractableItem, Text, Popover, PopoverTrigger, PopoverContent, IconButton, Card, Spinner, EmptyState } from '@trackunit/react-components';
4
4
  import { objectValues, nonNullable, objectKeys, objectEntries } from '@trackunit/shared-utils';
5
5
  import { useMemo, Children, cloneElement, useRef, useState, useEffect, useCallback, createElement } from 'react';
6
6
  import { cvaMerge } from '@trackunit/css-class-variance-utilities';
@@ -170,9 +170,10 @@ const ActionButton = ({ action, id, ...rest }) => {
170
170
  // eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
171
171
  jsx(Button, { asChild: true, id: id, loading: action.loading, prefix: jsx(ActionIcon, { action: action }), ...rest, children: jsx(Link, { to: action.url, children: action.label }) }));
172
172
  }
173
- return (jsx(Button, { id: id, loading: action.loading, onClick: e => action.method(e),
173
+ const content = (jsx(Button, { id: id, loading: action.loading, onClick: e => action.method(e),
174
174
  // eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
175
175
  prefix: jsx(ActionIcon, { action: action }), ...rest, children: action.label }));
176
+ return action.tip ? jsx(Tooltip, { label: action.tip, children: content }) : content;
176
177
  };
177
178
  /**
178
179
  * Converts an action model to a MenuItem component.
@@ -208,7 +209,7 @@ const actionDataToMenuItem = (action, dataTestId) => {
208
209
  * @param {string} [dataTestId] - Optional data test ID.
209
210
  * @returns {ReactElement} - The ActionButton component for the given action.
210
211
  */
211
- const actionDataToActionButton = (action) => (jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", dataTestId: action.dataTestId || action.id, disabled: action.loading, id: action.id }, action.id));
212
+ const actionDataToActionButton = (action) => (jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", dataTestId: action.dataTestId || action.id, disabled: action.loading || action.disabled, id: action.id, variant: action.disabled ? "ghost" : undefined }, action.id));
212
213
  /**
213
214
  * Renders the icon for an action button.
214
215
  * Should not be used outside the ActionSheet component.
@@ -1321,7 +1322,7 @@ const useTableSelection = ({ data, idKey, defaultSelectedIds, enableRowSelection
1321
1322
  return null;
1322
1323
  }
1323
1324
  const isRowSelectionDisabled = !table.options.enableRowSelection || !data.length;
1324
- return (jsx(Checkbox, { className: "ml-2.5",
1325
+ return (jsx(Checkbox, { className: "flex justify-center",
1325
1326
  checked: table.getIsAllRowsSelected(),
1326
1327
  indeterminate: table.getIsSomeRowsSelected(),
1327
1328
  onChange: table.getToggleAllRowsSelectedHandler(),
@@ -1345,7 +1346,7 @@ const useTableSelection = ({ data, idKey, defaultSelectedIds, enableRowSelection
1345
1346
  enableResizing: false,
1346
1347
  enableHiding: false,
1347
1348
  enablePinning: false,
1348
- size: 70,
1349
+ size: 48,
1349
1350
  meta: {
1350
1351
  alignment: "center",
1351
1352
  columnFilterLabel: t("table.selection.label"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-table",
3
- "version": "1.3.258",
3
+ "version": "1.3.260",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -15,16 +15,16 @@
15
15
  "jest-fetch-mock": "^3.0.3",
16
16
  "@tanstack/react-router": "1.114.29",
17
17
  "tailwind-merge": "^2.0.0",
18
- "@trackunit/react-components": "1.4.202",
19
- "@trackunit/shared-utils": "1.5.165",
20
- "@trackunit/css-class-variance-utilities": "1.3.165",
21
- "@trackunit/ui-icons": "1.3.166",
22
- "@trackunit/react-table-base-components": "1.3.226",
23
- "@trackunit/react-table-pagination": "1.3.165",
24
- "@trackunit/react-form-components": "1.3.228",
25
- "@trackunit/i18n-library-translation": "1.3.189",
26
- "@trackunit/react-core-contexts-api": "1.4.173",
27
- "@trackunit/react-test-setup": "1.0.55"
18
+ "@trackunit/react-components": "1.4.204",
19
+ "@trackunit/shared-utils": "1.5.166",
20
+ "@trackunit/css-class-variance-utilities": "1.3.166",
21
+ "@trackunit/ui-icons": "1.3.167",
22
+ "@trackunit/react-table-base-components": "1.3.228",
23
+ "@trackunit/react-table-pagination": "1.3.166",
24
+ "@trackunit/react-form-components": "1.3.230",
25
+ "@trackunit/i18n-library-translation": "1.3.190",
26
+ "@trackunit/react-core-contexts-api": "1.4.174",
27
+ "@trackunit/react-test-setup": "1.0.56"
28
28
  },
29
29
  "module": "./index.esm.js",
30
30
  "main": "./index.cjs.js",
@@ -22,5 +22,7 @@ export interface CommonAction extends IconExposedProp {
22
22
  forwardedRef?: React.RefObject<HTMLSpanElement>;
23
23
  style?: Record<string, string>;
24
24
  loading?: boolean;
25
+ disabled?: boolean;
26
+ tip?: string;
25
27
  }
26
28
  export {};