@trackunit/react-date-and-time-components 2.1.1 → 2.1.3

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
@@ -926,11 +926,7 @@ const Timeline = ({ className, style, "data-testid": dataTestId, children, dateH
926
926
  }, 50); // Small delay to ensure DOM has updated
927
927
  });
928
928
  }, [isLoadingMore, middleChildren.length, visibleCount]);
929
- const timestampWidth = childProps.timestampFormat === "date" || childProps.timestampFormat === "date-time"
930
- ? "medium"
931
- : hourCycle === "h12" || hourCycle === "h11"
932
- ? "large"
933
- : "small";
929
+ const timestampWidth = hourCycle === "h12" || hourCycle === "h11" ? "large" : "medium";
934
930
  // Reset visible count when toggling open/closed
935
931
  react.useEffect(() => {
936
932
  if (isOpen) {
@@ -996,13 +992,13 @@ const TimelineElement = ({ date, children, className, style, "data-testid": data
996
992
  setIsHovered(false);
997
993
  }
998
994
  };
999
- return (jsxRuntime.jsxs("div", { className: cvaTimelineElement({ className, selected, hoverBehavior }), "data-date": date, "data-testid": dataTestId, onClick: onClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: style, children: [renderDate(formattedDate, locale, timestampFormat), jsxRuntime.jsxs("div", { className: cvaDotWrapper(), children: [renderDot(customDot, isHovered, selected), jsxRuntime.jsx("div", { className: cvaLine({ lineStyle }) })] }), jsxRuntime.jsxs("div", { className: "pb-2 pt-2", children: [renderHeader(header, dataTestId), renderChildren(children), renderActionButton(actionButton)] })] }));
995
+ return (jsxRuntime.jsxs("div", { className: cvaTimelineElement({ className, selected, hoverBehavior }), "data-date": date, "data-testid": dataTestId, onClick: onClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: style, children: [renderDate(formattedDate, locale), jsxRuntime.jsxs("div", { className: cvaDotWrapper(), children: [renderDot(customDot, isHovered, selected), jsxRuntime.jsx("div", { className: cvaLine({ lineStyle }) })] }), jsxRuntime.jsxs("div", { className: "pb-2 pt-2", children: [renderHeader(header, dataTestId), renderChildren(children), renderActionButton(actionButton)] })] }));
1000
996
  };
1001
- const renderDate = (formattedDate, locale, timestampFormat) => {
997
+ const renderDate = (formattedDate, locale) => {
1002
998
  if (!formattedDate) {
1003
999
  return null;
1004
1000
  }
1005
- return jsxRuntime.jsx("div", { className: "items-center pt-2", children: timelineElementTime(formattedDate, locale, timestampFormat) });
1001
+ return jsxRuntime.jsx("div", { className: "items-center pt-2", children: timelineElementTime(formattedDate, locale) });
1006
1002
  };
1007
1003
  const renderDot = (customDot, isHovered, selected) => {
1008
1004
  return customDot?.name
@@ -1030,9 +1026,9 @@ const renderActionButton = (actionButton) => {
1030
1026
  }
1031
1027
  return (jsxRuntime.jsx("div", { className: "pt-2", children: jsxRuntime.jsx(reactComponents.Button, { prefix: jsxRuntime.jsx(reactComponents.Icon, { name: actionButton.iconName, size: "small" }), size: "small", variant: "secondary", children: actionButton.label }) }));
1032
1028
  };
1033
- const timelineElementTime = (formattedDate, locale, timestampFormat) => {
1029
+ const timelineElementTime = (formattedDate, locale) => {
1034
1030
  const hourCycle = dateAndTimeUtils.getHourCycle(locale);
1035
- const width = timestampFormat === "time" ? (hourCycle === "h12" || hourCycle === "h11" ? "large" : "small") : "medium";
1031
+ const width = hourCycle === "h12" || hourCycle === "h11" ? "large" : "medium";
1036
1032
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [formattedDate.date ? (jsxRuntime.jsx(reactComponents.Text, { align: "right", className: cvaTimelineElementTime({
1037
1033
  width,
1038
1034
  }), size: "small", subtle: true, children: formattedDate.date })) : null, formattedDate.time ? (jsxRuntime.jsx(reactComponents.Text, { align: "right", className: cvaTimelineElementTime({
package/index.esm.js CHANGED
@@ -924,11 +924,7 @@ const Timeline = ({ className, style, "data-testid": dataTestId, children, dateH
924
924
  }, 50); // Small delay to ensure DOM has updated
925
925
  });
926
926
  }, [isLoadingMore, middleChildren.length, visibleCount]);
927
- const timestampWidth = childProps.timestampFormat === "date" || childProps.timestampFormat === "date-time"
928
- ? "medium"
929
- : hourCycle === "h12" || hourCycle === "h11"
930
- ? "large"
931
- : "small";
927
+ const timestampWidth = hourCycle === "h12" || hourCycle === "h11" ? "large" : "medium";
932
928
  // Reset visible count when toggling open/closed
933
929
  useEffect(() => {
934
930
  if (isOpen) {
@@ -994,13 +990,13 @@ const TimelineElement = ({ date, children, className, style, "data-testid": data
994
990
  setIsHovered(false);
995
991
  }
996
992
  };
997
- return (jsxs("div", { className: cvaTimelineElement({ className, selected, hoverBehavior }), "data-date": date, "data-testid": dataTestId, onClick: onClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: style, children: [renderDate(formattedDate, locale, timestampFormat), jsxs("div", { className: cvaDotWrapper(), children: [renderDot(customDot, isHovered, selected), jsx("div", { className: cvaLine({ lineStyle }) })] }), jsxs("div", { className: "pb-2 pt-2", children: [renderHeader(header, dataTestId), renderChildren(children), renderActionButton(actionButton)] })] }));
993
+ return (jsxs("div", { className: cvaTimelineElement({ className, selected, hoverBehavior }), "data-date": date, "data-testid": dataTestId, onClick: onClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: style, children: [renderDate(formattedDate, locale), jsxs("div", { className: cvaDotWrapper(), children: [renderDot(customDot, isHovered, selected), jsx("div", { className: cvaLine({ lineStyle }) })] }), jsxs("div", { className: "pb-2 pt-2", children: [renderHeader(header, dataTestId), renderChildren(children), renderActionButton(actionButton)] })] }));
998
994
  };
999
- const renderDate = (formattedDate, locale, timestampFormat) => {
995
+ const renderDate = (formattedDate, locale) => {
1000
996
  if (!formattedDate) {
1001
997
  return null;
1002
998
  }
1003
- return jsx("div", { className: "items-center pt-2", children: timelineElementTime(formattedDate, locale, timestampFormat) });
999
+ return jsx("div", { className: "items-center pt-2", children: timelineElementTime(formattedDate, locale) });
1004
1000
  };
1005
1001
  const renderDot = (customDot, isHovered, selected) => {
1006
1002
  return customDot?.name
@@ -1028,9 +1024,9 @@ const renderActionButton = (actionButton) => {
1028
1024
  }
1029
1025
  return (jsx("div", { className: "pt-2", children: jsx(Button, { prefix: jsx(Icon, { name: actionButton.iconName, size: "small" }), size: "small", variant: "secondary", children: actionButton.label }) }));
1030
1026
  };
1031
- const timelineElementTime = (formattedDate, locale, timestampFormat) => {
1027
+ const timelineElementTime = (formattedDate, locale) => {
1032
1028
  const hourCycle = getHourCycle(locale);
1033
- const width = timestampFormat === "time" ? (hourCycle === "h12" || hourCycle === "h11" ? "large" : "small") : "medium";
1029
+ const width = hourCycle === "h12" || hourCycle === "h11" ? "large" : "medium";
1034
1030
  return (jsxs(Fragment, { children: [formattedDate.date ? (jsx(Text, { align: "right", className: cvaTimelineElementTime({
1035
1031
  width,
1036
1032
  }), size: "small", subtle: true, children: formattedDate.date })) : null, formattedDate.time ? (jsx(Text, { align: "right", className: cvaTimelineElementTime({
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@trackunit/react-date-and-time-components",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=24.x"
8
8
  },
9
9
  "dependencies": {
10
- "@trackunit/react-components": "2.1.0",
11
- "@trackunit/date-and-time-utils": "1.13.12",
12
- "@trackunit/react-date-and-time-hooks": "2.1.1",
13
- "@trackunit/css-class-variance-utilities": "1.13.11",
14
- "@trackunit/ui-icons": "1.13.11",
15
- "@trackunit/shared-utils": "1.15.11",
16
- "@trackunit/i18n-library-translation": "2.0.2",
17
- "@trackunit/react-form-components": "2.1.1",
10
+ "@trackunit/react-components": "2.1.1",
11
+ "@trackunit/date-and-time-utils": "1.13.13",
12
+ "@trackunit/react-date-and-time-hooks": "2.1.2",
13
+ "@trackunit/css-class-variance-utilities": "1.13.12",
14
+ "@trackunit/ui-icons": "1.13.12",
15
+ "@trackunit/shared-utils": "1.15.12",
16
+ "@trackunit/i18n-library-translation": "2.0.3",
17
+ "@trackunit/react-form-components": "2.1.2",
18
18
  "string-ts": "^2.0.0",
19
19
  "tailwind-merge": "^2.0.0",
20
20
  "react-calendar": "^6.0.0"