@trackunit/react-table-base-components 1.6.16 → 1.6.18

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
@@ -2,6 +2,7 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var reactComponents = require('@trackunit/react-components');
5
+ var tailwindMerge = require('tailwind-merge');
5
6
  var reactFormComponents = require('@trackunit/react-form-components');
6
7
  var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
7
8
  var dateAndTimeUtils = require('@trackunit/date-and-time-utils');
@@ -10,13 +11,13 @@ var polyfill = require('@js-temporal/polyfill');
10
11
  var sharedUtils = require('@trackunit/shared-utils');
11
12
 
12
13
  /**
13
- * The ButtonCell is used to render buttons in a table cell
14
+ * The ButtonCell is used to display interactive data in table columns.
14
15
  *
15
16
  * @param {ButtonCellProps} props - The props for the ButtonCell component
16
17
  * @returns {ReactElement} ButtonCell component
17
18
  */
18
- const ButtonCell = ({ dataTestId, children, iconName, iconColor = "primary", variant = "ghost-neutral", ...rest }) => {
19
- return (jsxRuntime.jsx(reactComponents.Button, { prefix: iconName ? jsxRuntime.jsx(reactComponents.Icon, { color: iconColor, name: iconName, size: "small", type: "solid" }) : null, ...rest, dataTestId: `button-cell-${dataTestId}`, variant: variant, children: children }));
19
+ const ButtonCell = ({ children, className, dataTestId, iconColor = "primary", iconName, variant = "ghost-neutral", ...rest }) => {
20
+ return (jsxRuntime.jsx(reactComponents.Button, { prefix: iconName ? jsxRuntime.jsx(reactComponents.Icon, { color: iconColor, name: iconName, size: "small", type: "solid" }) : null, ...rest, className: tailwindMerge.twMerge("px-2 text-sm font-normal text-black hover:text-black", className), dataTestId: `button-cell-${dataTestId}`, variant: variant, children: children }));
20
21
  };
21
22
 
22
23
  const cvaCheckboxCell = cssClassVarianceUtilities.cvaMerge([""]);
@@ -207,14 +208,7 @@ const NoticeCell = ({ ...rest }) => {
207
208
  return jsxRuntime.jsx(reactComponents.Notice, { ...rest });
208
209
  };
209
210
 
210
- const cvaNumberCell = cssClassVarianceUtilities.cvaMerge([
211
- "flex",
212
- "gap-1",
213
- "slashed-zero",
214
- "text-neutral-700",
215
- "text-sm",
216
- "text-ellipsis",
217
- ]);
211
+ const cvaNumberCell = cssClassVarianceUtilities.cvaMerge(["flex", "gap-1", "slashed-zero", "text-sm", "text-ellipsis"]);
218
212
 
219
213
  /**
220
214
  * The `<NumberCell>` component is used for displaying numbers with units in a table cell.
package/index.esm.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Button, Icon, Highlight, Heading, Indicator, ExternalLink, Tooltip, Tag, Notice, IconButton, MoreMenu, MenuList, MenuItem, MenuDivider, Spinner } from '@trackunit/react-components';
3
+ import { twMerge } from 'tailwind-merge';
3
4
  import { Checkbox } from '@trackunit/react-form-components';
4
5
  import { cvaMerge } from '@trackunit/css-class-variance-utilities';
5
6
  import { formatDateUtil, timeSinceAuto, timeSinceInDays } from '@trackunit/date-and-time-utils';
@@ -8,13 +9,13 @@ import { Temporal } from '@js-temporal/polyfill';
8
9
  import { DateTimeFormat } from '@trackunit/shared-utils';
9
10
 
10
11
  /**
11
- * The ButtonCell is used to render buttons in a table cell
12
+ * The ButtonCell is used to display interactive data in table columns.
12
13
  *
13
14
  * @param {ButtonCellProps} props - The props for the ButtonCell component
14
15
  * @returns {ReactElement} ButtonCell component
15
16
  */
16
- const ButtonCell = ({ dataTestId, children, iconName, iconColor = "primary", variant = "ghost-neutral", ...rest }) => {
17
- return (jsx(Button, { prefix: iconName ? jsx(Icon, { color: iconColor, name: iconName, size: "small", type: "solid" }) : null, ...rest, dataTestId: `button-cell-${dataTestId}`, variant: variant, children: children }));
17
+ const ButtonCell = ({ children, className, dataTestId, iconColor = "primary", iconName, variant = "ghost-neutral", ...rest }) => {
18
+ return (jsx(Button, { prefix: iconName ? jsx(Icon, { color: iconColor, name: iconName, size: "small", type: "solid" }) : null, ...rest, className: twMerge("px-2 text-sm font-normal text-black hover:text-black", className), dataTestId: `button-cell-${dataTestId}`, variant: variant, children: children }));
18
19
  };
19
20
 
20
21
  const cvaCheckboxCell = cvaMerge([""]);
@@ -205,14 +206,7 @@ const NoticeCell = ({ ...rest }) => {
205
206
  return jsx(Notice, { ...rest });
206
207
  };
207
208
 
208
- const cvaNumberCell = cvaMerge([
209
- "flex",
210
- "gap-1",
211
- "slashed-zero",
212
- "text-neutral-700",
213
- "text-sm",
214
- "text-ellipsis",
215
- ]);
209
+ const cvaNumberCell = cvaMerge(["flex", "gap-1", "slashed-zero", "text-sm", "text-ellipsis"]);
216
210
 
217
211
  /**
218
212
  * The `<NumberCell>` component is used for displaying numbers with units in a table cell.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-table-base-components",
3
- "version": "1.6.16",
3
+ "version": "1.6.18",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,13 +9,14 @@
9
9
  "dependencies": {
10
10
  "react": "19.0.0",
11
11
  "@js-temporal/polyfill": "^0.4.4",
12
- "@trackunit/react-components": "1.7.15",
13
- "@trackunit/ui-icons": "1.6.11",
14
- "@trackunit/react-form-components": "1.6.16",
15
- "@trackunit/css-class-variance-utilities": "1.6.12",
16
- "@trackunit/date-and-time-utils": "1.6.12",
17
- "@trackunit/shared-utils": "1.8.12",
18
- "@trackunit/react-test-setup": "1.3.12"
12
+ "@trackunit/react-components": "1.7.16",
13
+ "@trackunit/ui-icons": "1.6.12",
14
+ "@trackunit/react-form-components": "1.6.17",
15
+ "@trackunit/css-class-variance-utilities": "1.6.13",
16
+ "@trackunit/date-and-time-utils": "1.6.13",
17
+ "@trackunit/shared-utils": "1.8.13",
18
+ "@trackunit/react-test-setup": "1.3.13",
19
+ "tailwind-merge": "^2.0.0"
19
20
  },
20
21
  "module": "./index.esm.js",
21
22
  "main": "./index.cjs.js",
@@ -7,9 +7,9 @@ export interface ButtonCellProps extends ButtonCommonProps {
7
7
  iconColor?: IconColors;
8
8
  }
9
9
  /**
10
- * The ButtonCell is used to render buttons in a table cell
10
+ * The ButtonCell is used to display interactive data in table columns.
11
11
  *
12
12
  * @param {ButtonCellProps} props - The props for the ButtonCell component
13
13
  * @returns {ReactElement} ButtonCell component
14
14
  */
15
- export declare const ButtonCell: ({ dataTestId, children, iconName, iconColor, variant, ...rest }: ButtonCellProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const ButtonCell: ({ children, className, dataTestId, iconColor, iconName, variant, ...rest }: ButtonCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,3 +5,5 @@ declare const meta: Meta<typeof ButtonCell>;
5
5
  export default meta;
6
6
  export declare const packageName: () => import("react/jsx-runtime").JSX.Element;
7
7
  export declare const Default: Story;
8
+ export declare const CriticalAssetsExample: Story;
9
+ export declare const IncorrectUsageExample: Story;
@@ -6,3 +6,4 @@ declare const meta: Meta<typeof NumberCell>;
6
6
  export default meta;
7
7
  export declare const packageName: () => import("react/jsx-runtime").JSX.Element;
8
8
  export declare const Default: Story;
9
+ export declare const Example: Story;