@trackunit/react-table-base-components 0.0.17 → 0.0.19
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@trackunit/css-class-variance-utilities": "0.0.14",
|
|
11
|
-
"@trackunit/
|
|
12
|
-
"@trackunit/react-
|
|
11
|
+
"@trackunit/date-and-time-utils": "0.0.1",
|
|
12
|
+
"@trackunit/react-components": "0.1.161",
|
|
13
|
+
"@trackunit/react-form-components": "0.0.147",
|
|
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;
|