@trackunit/react-table-base-components 0.0.19 → 0.0.20
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/package.json +2 -1
- package/src/components/ImageCell/ImageCell.d.ts +21 -0
- package/src/components/ImageCell/ImageCell.stories.d.ts +5 -0
- package/src/components/IndicatorCell/IndicatorCell.d.ts +36 -0
- package/src/components/IndicatorCell/IndicatorCell.stories.d.ts +6 -0
- package/src/components/NumberCell/NumberCell.d.ts +16 -0
- package/src/components/NumberCell/NumberCell.stories.d.ts +7 -0
- package/src/components/NumberCell/NumberCell.variants.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"@trackunit/date-and-time-utils": "0.0.1",
|
|
12
12
|
"@trackunit/react-components": "0.1.161",
|
|
13
13
|
"@trackunit/react-form-components": "0.0.147",
|
|
14
|
+
"@trackunit/ui-design-tokens": "0.0.77",
|
|
14
15
|
"react": "18.2.0"
|
|
15
16
|
},
|
|
16
17
|
"module": "./index.esm.js",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
+
export interface ImageCellProps extends CommonProps {
|
|
3
|
+
imageUrl: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
dataTestId?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The `<ImageCell>` component is used for displaying images in a table cell.
|
|
11
|
+
*
|
|
12
|
+
* @param {object} props - The props for the Image component.
|
|
13
|
+
* @param {string} props.imageUrl - The URL of the image to be displayed.
|
|
14
|
+
* @param {string} [props.alt=""] - The alternative text for the image.
|
|
15
|
+
* @param {number} [props.width=100] - The width of the image in pixels.
|
|
16
|
+
* @param {number} [props.height=100] - The height of the image in pixels.
|
|
17
|
+
* @param {string} [props.dataTestId] - An optional data-testid for testing purposes.
|
|
18
|
+
* @param {...any} [rest] - Additional props that can be applied to the underlying <img> element.
|
|
19
|
+
* @returns {JSX.Element} The Image component.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ImageCell: ({ imageUrl, alt, width, height, dataTestId, ...rest }: ImageCellProps) => JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IndicatorProps } from "@trackunit/react-components";
|
|
3
|
+
import { ThemeColors } from "@trackunit/ui-design-tokens";
|
|
4
|
+
export interface IndicatorCellProps extends IndicatorProps, React.HTMLAttributes<HTMLTableSectionElement> {
|
|
5
|
+
/**
|
|
6
|
+
* The icon to be rendered inside the indicator component
|
|
7
|
+
*/
|
|
8
|
+
icon: JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* A color token used to style the icon and the icon background
|
|
11
|
+
*/
|
|
12
|
+
color?: ThemeColors;
|
|
13
|
+
/**
|
|
14
|
+
* A text label to be displayed next to the indicator
|
|
15
|
+
*/
|
|
16
|
+
label?: string;
|
|
17
|
+
/**
|
|
18
|
+
* A boolean parameter to display or hide icon background, default value is true
|
|
19
|
+
*/
|
|
20
|
+
withBackground?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* A boolean parameter to display or hide label and instead show as html title on hover, default value is true
|
|
23
|
+
*/
|
|
24
|
+
withLabel?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A boolean parameter to make the indicator ping thus drawing more attention, default value is false
|
|
27
|
+
*/
|
|
28
|
+
ping?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The IndicatorCell is used for render an indicator in a table cell
|
|
32
|
+
*
|
|
33
|
+
* @param {IndicatorCellProps} props - The props for the LinkCell component
|
|
34
|
+
* @returns {JSX.Element} LinkCell component
|
|
35
|
+
*/
|
|
36
|
+
export declare const IndicatorCell: ({ ...rest }: IndicatorCellProps) => JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
+
export interface NumberCellProps extends CommonProps {
|
|
3
|
+
value: string | number;
|
|
4
|
+
unit?: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The `<NumberCell>` component is used for displaying numbers with units in a table cell.
|
|
8
|
+
*
|
|
9
|
+
* @param props - The props for the NumberCell component.
|
|
10
|
+
* @param {string} [props.value] - The numeric value to be displayed.
|
|
11
|
+
* @param {string} [props.unit] - The optional unit to be displayed alongside the value.
|
|
12
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the component.
|
|
13
|
+
* @param {string} [props.dataTestId] - The data-testid attribute for testing purposes.
|
|
14
|
+
* @returns {JSX.Element} A React JSX element representing the NumberCell component.
|
|
15
|
+
*/
|
|
16
|
+
export declare const NumberCell: ({ value, unit, className, dataTestId }: NumberCellProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { NumberCell } from "./NumberCell";
|
|
3
|
+
import "./NumberCell.variants";
|
|
4
|
+
type Story = StoryObj<typeof NumberCell>;
|
|
5
|
+
declare const meta: Meta<typeof NumberCell>;
|
|
6
|
+
export default meta;
|
|
7
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cvaNumberCell: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|