@trackunit/react-components 0.1.107 → 0.1.108
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 +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
- package/src/components/Timeline/Timeline.d.ts +2 -1
package/index.cjs
CHANGED
|
@@ -1957,9 +1957,9 @@ const Timeline = ({ className, dataTestId, children }) => {
|
|
|
1957
1957
|
* @param {TimeLineElementProps} props the props
|
|
1958
1958
|
* @returns {JSX.Element} component
|
|
1959
1959
|
*/
|
|
1960
|
-
const TimelineElement = ({ date, showTime, children, className, dataTestId = "timeline-date", dot = jsxRuntime.jsx(Indicator, { className: tailwindStyledComponents.tws `mt-[-1px]`, color: "neutral", icon: jsxRuntime.jsx(Icon, { name: "CalendarIcon", size: "large" }) }), header = defaultHeader(date, showTime), onClick, }) => {
|
|
1960
|
+
const TimelineElement = ({ date, showTime, children, className, dataTestId = "timeline-date", headerClassName, dot = jsxRuntime.jsx(Indicator, { className: tailwindStyledComponents.tws `mt-[-1px]`, color: "neutral", icon: jsxRuntime.jsx(Icon, { name: "CalendarIcon", size: "large" }) }), header = defaultHeader(date, showTime), onClick, }) => {
|
|
1961
1961
|
var _a;
|
|
1962
|
-
return (jsxRuntime.jsxs("li", Object.assign({ className: `${tailwindStyledComponents.tws `tu-timeline-element`}${(_a = " " + className) !== null && _a !== void 0 ? _a : ""} `, "data-date":
|
|
1962
|
+
return (jsxRuntime.jsxs("li", Object.assign({ className: `${tailwindStyledComponents.tws `tu-timeline-element`}${(_a = " " + className) !== null && _a !== void 0 ? _a : ""} `, "data-date": date, "data-testid": dataTestId && dataTestId, onClick: () => onClick && onClick() }, { children: [jsxRuntime.jsx("div", Object.assign({ className: tailwindStyledComponents.tws `tu-timeline-element__dot` }, { children: dot })), jsxRuntime.jsx("div", Object.assign({ className: headerClassName }, { children: header })), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", { children: children }) })] })));
|
|
1963
1963
|
};
|
|
1964
1964
|
function defaultHeader(date, showTime) {
|
|
1965
1965
|
return `${dateFns.format(date, showTime ? "MMM d, yyyy H:mm" : "MMM d, yyyy")} (${dateFns.formatDistance(date, new Date(), {
|
package/index.js
CHANGED
|
@@ -1930,9 +1930,9 @@ const Timeline = ({ className, dataTestId, children }) => {
|
|
|
1930
1930
|
* @param {TimeLineElementProps} props the props
|
|
1931
1931
|
* @returns {JSX.Element} component
|
|
1932
1932
|
*/
|
|
1933
|
-
const TimelineElement = ({ date, showTime, children, className, dataTestId = "timeline-date", dot = jsx(Indicator, { className: tws `mt-[-1px]`, color: "neutral", icon: jsx(Icon, { name: "CalendarIcon", size: "large" }) }), header = defaultHeader(date, showTime), onClick, }) => {
|
|
1933
|
+
const TimelineElement = ({ date, showTime, children, className, dataTestId = "timeline-date", headerClassName, dot = jsx(Indicator, { className: tws `mt-[-1px]`, color: "neutral", icon: jsx(Icon, { name: "CalendarIcon", size: "large" }) }), header = defaultHeader(date, showTime), onClick, }) => {
|
|
1934
1934
|
var _a;
|
|
1935
|
-
return (jsxs("li", Object.assign({ className: `${tws `tu-timeline-element`}${(_a = " " + className) !== null && _a !== void 0 ? _a : ""} `, "data-date":
|
|
1935
|
+
return (jsxs("li", Object.assign({ className: `${tws `tu-timeline-element`}${(_a = " " + className) !== null && _a !== void 0 ? _a : ""} `, "data-date": date, "data-testid": dataTestId && dataTestId, onClick: () => onClick && onClick() }, { children: [jsx("div", Object.assign({ className: tws `tu-timeline-element__dot` }, { children: dot })), jsx("div", Object.assign({ className: headerClassName }, { children: header })), jsx("div", {}), jsx("div", { children: jsx("div", { children: children }) })] })));
|
|
1936
1936
|
};
|
|
1937
1937
|
function defaultHeader(date, showTime) {
|
|
1938
1938
|
return `${format(date, showTime ? "MMM d, yyyy H:mm" : "MMM d, yyyy")} (${formatDistance(date, new Date(), {
|
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ interface TimeLineElementProps extends CommonProps {
|
|
|
20
20
|
children: React.ReactNode;
|
|
21
21
|
dot?: React.ReactNode;
|
|
22
22
|
onClick?: () => void;
|
|
23
|
+
headerClassName?: string;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* TimelineElement - entry on a timeline - rendered with an icon on the timeline
|
|
@@ -28,5 +29,5 @@ interface TimeLineElementProps extends CommonProps {
|
|
|
28
29
|
* @param {TimeLineElementProps} props the props
|
|
29
30
|
* @returns {JSX.Element} component
|
|
30
31
|
*/
|
|
31
|
-
export declare const TimelineElement: ({ date, showTime, children, className, dataTestId, dot, header, onClick, }: TimeLineElementProps) => JSX.Element;
|
|
32
|
+
export declare const TimelineElement: ({ date, showTime, children, className, dataTestId, headerClassName, dot, header, onClick, }: TimeLineElementProps) => JSX.Element;
|
|
32
33
|
export {};
|