@trackunit/react-table-base-components 0.0.15 → 0.0.17-alpha-4c4c5ce62d.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/package.json +5 -4
- package/src/components/DateTimeCell/DateTimeCell.d.ts +42 -0
- package/src/components/DateTimeCell/DateTimeCell.stories.d.ts +8 -0
- package/src/components/DateTimeCell/DateTimeCell.variants.d.ts +3 -0
- package/src/components/TextCell/TextCell.d.ts +12 -0
- package/src/components/TextCell/TextCell.stories.d.ts +8 -0
- package/src/components/TextCell/TextCell.variants.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17-alpha-4c4c5ce62d.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@trackunit/css-class-variance-utilities": "0.0.
|
|
11
|
-
"@trackunit/
|
|
12
|
-
"@trackunit/react-
|
|
10
|
+
"@trackunit/css-class-variance-utilities": "0.0.15-alpha-4c4c5ce62d.0",
|
|
11
|
+
"@trackunit/date-and-time-utils": "0.0.1-alpha-4c4c5ce62d.0",
|
|
12
|
+
"@trackunit/react-components": "0.1.160-alpha-4c4c5ce62d.0",
|
|
13
|
+
"@trackunit/react-form-components": "0.0.146-alpha-4c4c5ce62d.0",
|
|
13
14
|
"react": "18.2.0"
|
|
14
15
|
},
|
|
15
16
|
"module": "./index.esm.js",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TemporalFormat } from "@trackunit/date-and-time-utils";
|
|
2
|
+
import { CommonProps } from "@trackunit/react-components";
|
|
3
|
+
export interface DateTimeCellProps extends CommonProps {
|
|
4
|
+
/**
|
|
5
|
+
* The date to render.
|
|
6
|
+
* If not provided, the component will not render.
|
|
7
|
+
*/
|
|
8
|
+
date?: Date;
|
|
9
|
+
/**
|
|
10
|
+
* If true, the component will render the time since the date.
|
|
11
|
+
* This is rendered on a separate line.
|
|
12
|
+
*
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
withTimeSince?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The format to use for the date.
|
|
18
|
+
* If not provided, the component will use the default format.
|
|
19
|
+
* See the formatDateUtil function for more information.
|
|
20
|
+
*/
|
|
21
|
+
format?: TemporalFormat;
|
|
22
|
+
/**
|
|
23
|
+
* The time zone to use for the date.
|
|
24
|
+
* See the formatDateUtil function for more information.
|
|
25
|
+
*/
|
|
26
|
+
timeZone?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The locale to use for the date.
|
|
29
|
+
* See the formatDateUtil function for more information.
|
|
30
|
+
*/
|
|
31
|
+
locale?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* DateTimeCell is used for render a date and or time in a table cell.
|
|
35
|
+
*
|
|
36
|
+
* @param {DateTimeCellProps} props - The props for the DateTimeCell component
|
|
37
|
+
* @returns {JSX.Element} DateTimeCell component
|
|
38
|
+
*/
|
|
39
|
+
export declare const DateTimeCell: ({ format, timeZone, locale, date, withTimeSince, className, dataTestId, }: DateTimeCellProps) => JSX.Element | null;
|
|
40
|
+
export interface TimeSinceProps extends Pick<DateTimeCellProps, "date" | "timeZone" | "locale"> {
|
|
41
|
+
date: Date;
|
|
42
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { DateTimeCell } from "./DateTimeCell";
|
|
3
|
+
import "./DateTimeCell.variants";
|
|
4
|
+
type Story = StoryObj<typeof DateTimeCell>;
|
|
5
|
+
declare const meta: Meta<typeof DateTimeCell>;
|
|
6
|
+
export default meta;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const Variants: () => JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const cvaDateTimeCell: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const cvaDateTime: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const cvaDateTimeSince: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
+
export interface TextCellProps extends CommonProps {
|
|
3
|
+
content?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The `<TextCell>` component is used for displaying text in a table cell.
|
|
7
|
+
* The text is not editable and will be truncated if the cell is too narrow.
|
|
8
|
+
*
|
|
9
|
+
* @param {TextCellProps} props - The props for the TextCell component
|
|
10
|
+
* @returns {JSX.Element} TextCell component
|
|
11
|
+
*/
|
|
12
|
+
export declare const TextCell: ({ content, className, dataTestId }: TextCellProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { TextCell } from "./TextCell";
|
|
3
|
+
import "./TextCell.variants";
|
|
4
|
+
type Story = StoryObj<typeof TextCell>;
|
|
5
|
+
declare const meta: Meta<typeof TextCell>;
|
|
6
|
+
export default meta;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const Example: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cvaTextCell: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|