@trackunit/react-date-and-time-components 1.16.22 → 1.16.25
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 +11 -11
- package/index.esm.js +11 -11
- package/package.json +9 -9
- package/src/DayPicker/DayPicker.d.ts +3 -3
- package/src/DayPicker/DayRangePicker.d.ts +3 -3
- package/src/Timeline/Timeline.d.ts +3 -3
- package/src/dateTime/DateTime.d.ts +3 -3
- package/src/dateTime/DateTimeHumanized.d.ts +3 -2
package/index.cjs.js
CHANGED
|
@@ -106,7 +106,7 @@ const MS_PER_HOUR = 60 * 60 * 1000;
|
|
|
106
106
|
* @param props.timezone TimeZone
|
|
107
107
|
* @param props.subtle boolean
|
|
108
108
|
*/
|
|
109
|
-
const DateTime = ({ value, format, className, fromNow = false, withTitle = false, titleFormat, timezone, "data-testid": dataTestId, subtle = false, }) => {
|
|
109
|
+
const DateTime = ({ value, format, className, fromNow = false, withTitle = false, titleFormat, timezone, "data-testid": dataTestId, subtle = false, ref, }) => {
|
|
110
110
|
const { t } = useTranslation();
|
|
111
111
|
const locale = reactDateAndTimeHooks.useLocale();
|
|
112
112
|
const nowDate = react.useMemo(() => new Date(), []);
|
|
@@ -123,7 +123,7 @@ const DateTime = ({ value, format, className, fromNow = false, withTitle = false
|
|
|
123
123
|
const dateValue = react.useMemo(() => {
|
|
124
124
|
return fromNow ? getTimeSince(date, nowDate) : newDateTime;
|
|
125
125
|
}, [date, fromNow, getTimeSince, newDateTime, nowDate]);
|
|
126
|
-
return (jsxRuntime.jsx("time", { className: className || subtle ? tailwindMerge.twMerge(subtle ? "text-neutral-600" : undefined, className) : undefined, "data-testid": dataTestId, dateTime: newDateTime, title: titleDateTime, children: dateValue }));
|
|
126
|
+
return (jsxRuntime.jsx("time", { className: className || subtle ? tailwindMerge.twMerge(subtle ? "text-neutral-600" : undefined, className) : undefined, "data-testid": dataTestId, dateTime: newDateTime, ref: ref, title: titleDateTime, children: dateValue }));
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
/**
|
|
@@ -132,9 +132,9 @@ const DateTime = ({ value, format, className, fromNow = false, withTitle = false
|
|
|
132
132
|
* @param { RelativeDateTimeProps } props - The properties for the DateTimeHumanized component.
|
|
133
133
|
* @param props.value Date | string | number | null | undefined
|
|
134
134
|
*/
|
|
135
|
-
const DateTimeHumanized = ({ value }) => {
|
|
135
|
+
const DateTimeHumanized = ({ value, ref }) => {
|
|
136
136
|
const tooltipFormat = sharedUtils.DateTimeFormat.DATE_LONG_TIME;
|
|
137
|
-
return (jsxRuntime.jsx(reactComponents.Tooltip, {
|
|
137
|
+
return (jsxRuntime.jsx(reactComponents.Tooltip, { label: jsxRuntime.jsx(DateTime, { format: tooltipFormat, value: value }), children: jsxRuntime.jsx(DateTime, { className: "underline decoration-neutral-300 decoration-dotted", fromNow: true, ref: ref, value: value }) }));
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
const temporalArithmeticTypeMapping = {
|
|
@@ -184,10 +184,10 @@ const useCalculateDateRange = () => {
|
|
|
184
184
|
* @param {DayPickerProps} props - The props for the DayPicker component
|
|
185
185
|
* @returns {ReactElement} DayPicker component
|
|
186
186
|
*/
|
|
187
|
-
const DayPicker = ({ onDaySelect, disabledDays, selectedDay, language, className, "data-testid": dataTestId, }) => {
|
|
187
|
+
const DayPicker = ({ onDaySelect, disabledDays, selectedDay, language, className, "data-testid": dataTestId, ref, }) => {
|
|
188
188
|
const { subtract } = reactDateAndTimeHooks.useDateAndTime();
|
|
189
189
|
const calculateDateRange = useCalculateDateRange();
|
|
190
|
-
return (jsxRuntime.jsx("div", { "data-testid": dataTestId, children: jsxRuntime.jsx(Calendar, { activeStartDate: selectedDay ?? undefined, allowPartialRange: true, className: tailwindMerge.twMerge("custom-day-picker", "range-picker", className, "p-0"), locale: language, onChange: value => {
|
|
190
|
+
return (jsxRuntime.jsx("div", { "data-testid": dataTestId, ref: ref, children: jsxRuntime.jsx(Calendar, { activeStartDate: selectedDay ?? undefined, allowPartialRange: true, className: tailwindMerge.twMerge("custom-day-picker", "range-picker", className, "p-0"), locale: language, onChange: value => {
|
|
191
191
|
if (value) {
|
|
192
192
|
onDaySelect?.(value);
|
|
193
193
|
}
|
|
@@ -227,7 +227,7 @@ const DayPicker = ({ onDaySelect, disabledDays, selectedDay, language, className
|
|
|
227
227
|
* @param {DayRangePickerProps} props - The props for the DayRangePicker component
|
|
228
228
|
* @returns {ReactElement} DayRangePicker component
|
|
229
229
|
*/
|
|
230
|
-
const DayRangePicker = ({ onRangeSelect, selectedDays, disabledDays, "data-testid": dataTestId, language, className, classNameCalendar, timezone, cancelButtonLabel, onClose, }) => {
|
|
230
|
+
const DayRangePicker = ({ onRangeSelect, selectedDays, disabledDays, "data-testid": dataTestId, language, className, classNameCalendar, timezone, cancelButtonLabel, onClose, ref, }) => {
|
|
231
231
|
const [newRange, setNewRange] = react.useState(selectedDays ?? { start: undefined, end: undefined });
|
|
232
232
|
const [t] = useTranslation();
|
|
233
233
|
const { subtract } = reactDateAndTimeHooks.useDateAndTime();
|
|
@@ -269,7 +269,7 @@ const DayRangePicker = ({ onRangeSelect, selectedDays, disabledDays, "data-testi
|
|
|
269
269
|
onClose();
|
|
270
270
|
}
|
|
271
271
|
}, [onRangeSelect, newRange, onClose]);
|
|
272
|
-
return (jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex", "w-min", "flex-col", "overflow-hidden", "rounded-md", "border", "border-neutral-300", "bg-white", className), "data-testid": dataTestId, children: [jsxRuntime.jsx(Calendar, { allowPartialRange: true, className: tailwindMerge.twMerge("custom-day-picker", "range-picker", classNameCalendar), locale: language, onChange: value => {
|
|
272
|
+
return (jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex", "w-min", "flex-col", "overflow-hidden", "rounded-md", "border", "border-neutral-300", "bg-white", className), "data-testid": dataTestId, ref: ref, children: [jsxRuntime.jsx(Calendar, { allowPartialRange: true, className: tailwindMerge.twMerge("custom-day-picker", "range-picker", classNameCalendar), locale: language, onChange: value => {
|
|
273
273
|
if (Array.isArray(value) && value[0] && value[1]) {
|
|
274
274
|
handleOnRangeSelect({ start: value[0], end: value[1] });
|
|
275
275
|
}
|
|
@@ -776,7 +776,7 @@ const ITEMS_PER_PAGE = 20;
|
|
|
776
776
|
* @param {TimelineProps} props - The props for the Timeline component
|
|
777
777
|
* @returns {ReactElement} Timeline component
|
|
778
778
|
*/
|
|
779
|
-
const Timeline = ({ className, "data-testid": dataTestId, children, dateHeader, customHeader, toggleButton, }) => {
|
|
779
|
+
const Timeline = ({ className, "data-testid": dataTestId, children, dateHeader, customHeader, toggleButton, ref: refProp, }) => {
|
|
780
780
|
const ref = react.useRef(null);
|
|
781
781
|
const [isOpen, setIsOpen] = react.useState(false);
|
|
782
782
|
const [visibleCount, setVisibleCount] = react.useState(ITEMS_PER_PAGE);
|
|
@@ -825,7 +825,7 @@ const Timeline = ({ className, "data-testid": dataTestId, children, dateHeader,
|
|
|
825
825
|
}, [isOpen]);
|
|
826
826
|
const renderToggleButton = () => (jsxRuntime.jsxs("div", { className: cvaTimelineElement(), children: [childProps.date ? (jsxRuntime.jsx("div", { className: cvaTimelineElementTime({
|
|
827
827
|
width: hourCycle === "h12" || hourCycle === "h11" ? "large" : "small",
|
|
828
|
-
}) })) : null, jsxRuntime.jsx("div", { className: cvaDotWrapper(), children: jsxRuntime.jsx("div", { className: cvaLine({ lineStyle: childProps.lineStyle }) }) }), jsxRuntime.jsxs("div", { className: "
|
|
828
|
+
}) })) : null, jsxRuntime.jsx("div", { className: cvaDotWrapper(), children: jsxRuntime.jsx("div", { className: cvaLine({ lineStyle: childProps.lineStyle }) }) }), jsxRuntime.jsxs("div", { className: "min-h-8 flex cursor-pointer items-center text-sm text-neutral-500 hover:text-neutral-600", "data-testid": "timeline-toggle-btn", onClick: () => {
|
|
829
829
|
if (toggleButton?.onClick) {
|
|
830
830
|
toggleButton.onClick();
|
|
831
831
|
}
|
|
@@ -841,7 +841,7 @@ const Timeline = ({ className, "data-testid": dataTestId, children, dateHeader,
|
|
|
841
841
|
const { date, dateRange, showTime } = dateHeader;
|
|
842
842
|
return (jsxRuntime.jsx("div", { className: "pb-4", "data-testid": "timeline-date-header", children: date ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(reactComponents.Text, { size: "medium", type: "span", weight: "thick", children: formatDate(date, { selectFormat: !showTime ? "dateOnly" : undefined }) }), jsxRuntime.jsx(reactComponents.Text, { className: "text-neutral-500", size: "medium", type: "span", weight: "thick", children: ` (${dateAndTimeUtils.timeSinceAuto(date, new Date(), undefined, locale)})` })] })) : (jsxRuntime.jsx(reactComponents.Text, { className: "pr-1", size: "medium", type: "span", weight: "thick", children: formatRange(dateRange, { dateStyle: !showTime ? "medium" : undefined }) })) }));
|
|
843
843
|
}, [dateHeader, formatDate, formatRange, customHeader, locale]);
|
|
844
|
-
return (jsxRuntime.jsxs("div", { className: className, "data-testid": dataTestId, children: [renderDateHeader(), customHeader ? jsxRuntime.jsx("div", { className: "text-sm font-semibold", children: customHeader }) : null, toggleButton && middleChildren.length > 0 ? (jsxRuntime.jsxs("div", { children: [firstChild, middleChildren.length > 0 ? renderToggleButton() : null, jsxRuntime.jsxs("div", { "aria-hidden": !isOpen, className: "overflow-hidden overflow-y-auto transition-all duration-300", ref: ref, children: [jsxRuntime.jsx("div", {}), visibleMiddleChildren, isOpen && visibleCount < middleChildren.length ? (jsxRuntime.jsx("div", { className: "flex justify-center py-2", onClick: e => {
|
|
844
|
+
return (jsxRuntime.jsxs("div", { className: className, "data-testid": dataTestId, ref: refProp, children: [renderDateHeader(), customHeader ? jsxRuntime.jsx("div", { className: "text-sm font-semibold", children: customHeader }) : null, toggleButton && middleChildren.length > 0 ? (jsxRuntime.jsxs("div", { children: [firstChild, middleChildren.length > 0 ? renderToggleButton() : null, jsxRuntime.jsxs("div", { "aria-hidden": !isOpen, className: "overflow-hidden overflow-y-auto transition-all duration-300", ref: ref, children: [jsxRuntime.jsx("div", {}), visibleMiddleChildren, isOpen && visibleCount < middleChildren.length ? (jsxRuntime.jsx("div", { className: "flex justify-center py-2", onClick: e => {
|
|
845
845
|
e.stopPropagation(); // Prevent parent handlers from firing
|
|
846
846
|
loadMoreItems();
|
|
847
847
|
}, children: jsxRuntime.jsx(reactComponents.Text, { className: "cursor-pointer text-neutral-500 hover:text-neutral-600", "data-testid": "load-more-text", size: "small", type: "span", children: t("timeline.loadMore") }) })) : null, jsxRuntime.jsx("div", {})] }), lastChild] })) : (jsxRuntime.jsx("div", { children: children }))] }));
|
package/index.esm.js
CHANGED
|
@@ -104,7 +104,7 @@ const MS_PER_HOUR = 60 * 60 * 1000;
|
|
|
104
104
|
* @param props.timezone TimeZone
|
|
105
105
|
* @param props.subtle boolean
|
|
106
106
|
*/
|
|
107
|
-
const DateTime = ({ value, format, className, fromNow = false, withTitle = false, titleFormat, timezone, "data-testid": dataTestId, subtle = false, }) => {
|
|
107
|
+
const DateTime = ({ value, format, className, fromNow = false, withTitle = false, titleFormat, timezone, "data-testid": dataTestId, subtle = false, ref, }) => {
|
|
108
108
|
const { t } = useTranslation();
|
|
109
109
|
const locale = useLocale();
|
|
110
110
|
const nowDate = useMemo(() => new Date(), []);
|
|
@@ -121,7 +121,7 @@ const DateTime = ({ value, format, className, fromNow = false, withTitle = false
|
|
|
121
121
|
const dateValue = useMemo(() => {
|
|
122
122
|
return fromNow ? getTimeSince(date, nowDate) : newDateTime;
|
|
123
123
|
}, [date, fromNow, getTimeSince, newDateTime, nowDate]);
|
|
124
|
-
return (jsx("time", { className: className || subtle ? twMerge(subtle ? "text-neutral-600" : undefined, className) : undefined, "data-testid": dataTestId, dateTime: newDateTime, title: titleDateTime, children: dateValue }));
|
|
124
|
+
return (jsx("time", { className: className || subtle ? twMerge(subtle ? "text-neutral-600" : undefined, className) : undefined, "data-testid": dataTestId, dateTime: newDateTime, ref: ref, title: titleDateTime, children: dateValue }));
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
/**
|
|
@@ -130,9 +130,9 @@ const DateTime = ({ value, format, className, fromNow = false, withTitle = false
|
|
|
130
130
|
* @param { RelativeDateTimeProps } props - The properties for the DateTimeHumanized component.
|
|
131
131
|
* @param props.value Date | string | number | null | undefined
|
|
132
132
|
*/
|
|
133
|
-
const DateTimeHumanized = ({ value }) => {
|
|
133
|
+
const DateTimeHumanized = ({ value, ref }) => {
|
|
134
134
|
const tooltipFormat = DateTimeFormat.DATE_LONG_TIME;
|
|
135
|
-
return (jsx(Tooltip, {
|
|
135
|
+
return (jsx(Tooltip, { label: jsx(DateTime, { format: tooltipFormat, value: value }), children: jsx(DateTime, { className: "underline decoration-neutral-300 decoration-dotted", fromNow: true, ref: ref, value: value }) }));
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
const temporalArithmeticTypeMapping = {
|
|
@@ -182,10 +182,10 @@ const useCalculateDateRange = () => {
|
|
|
182
182
|
* @param {DayPickerProps} props - The props for the DayPicker component
|
|
183
183
|
* @returns {ReactElement} DayPicker component
|
|
184
184
|
*/
|
|
185
|
-
const DayPicker = ({ onDaySelect, disabledDays, selectedDay, language, className, "data-testid": dataTestId, }) => {
|
|
185
|
+
const DayPicker = ({ onDaySelect, disabledDays, selectedDay, language, className, "data-testid": dataTestId, ref, }) => {
|
|
186
186
|
const { subtract } = useDateAndTime();
|
|
187
187
|
const calculateDateRange = useCalculateDateRange();
|
|
188
|
-
return (jsx("div", { "data-testid": dataTestId, children: jsx(Calendar, { activeStartDate: selectedDay ?? undefined, allowPartialRange: true, className: twMerge("custom-day-picker", "range-picker", className, "p-0"), locale: language, onChange: value => {
|
|
188
|
+
return (jsx("div", { "data-testid": dataTestId, ref: ref, children: jsx(Calendar, { activeStartDate: selectedDay ?? undefined, allowPartialRange: true, className: twMerge("custom-day-picker", "range-picker", className, "p-0"), locale: language, onChange: value => {
|
|
189
189
|
if (value) {
|
|
190
190
|
onDaySelect?.(value);
|
|
191
191
|
}
|
|
@@ -225,7 +225,7 @@ const DayPicker = ({ onDaySelect, disabledDays, selectedDay, language, className
|
|
|
225
225
|
* @param {DayRangePickerProps} props - The props for the DayRangePicker component
|
|
226
226
|
* @returns {ReactElement} DayRangePicker component
|
|
227
227
|
*/
|
|
228
|
-
const DayRangePicker = ({ onRangeSelect, selectedDays, disabledDays, "data-testid": dataTestId, language, className, classNameCalendar, timezone, cancelButtonLabel, onClose, }) => {
|
|
228
|
+
const DayRangePicker = ({ onRangeSelect, selectedDays, disabledDays, "data-testid": dataTestId, language, className, classNameCalendar, timezone, cancelButtonLabel, onClose, ref, }) => {
|
|
229
229
|
const [newRange, setNewRange] = useState(selectedDays ?? { start: undefined, end: undefined });
|
|
230
230
|
const [t] = useTranslation();
|
|
231
231
|
const { subtract } = useDateAndTime();
|
|
@@ -267,7 +267,7 @@ const DayRangePicker = ({ onRangeSelect, selectedDays, disabledDays, "data-testi
|
|
|
267
267
|
onClose();
|
|
268
268
|
}
|
|
269
269
|
}, [onRangeSelect, newRange, onClose]);
|
|
270
|
-
return (jsxs("div", { className: twMerge("flex", "w-min", "flex-col", "overflow-hidden", "rounded-md", "border", "border-neutral-300", "bg-white", className), "data-testid": dataTestId, children: [jsx(Calendar, { allowPartialRange: true, className: twMerge("custom-day-picker", "range-picker", classNameCalendar), locale: language, onChange: value => {
|
|
270
|
+
return (jsxs("div", { className: twMerge("flex", "w-min", "flex-col", "overflow-hidden", "rounded-md", "border", "border-neutral-300", "bg-white", className), "data-testid": dataTestId, ref: ref, children: [jsx(Calendar, { allowPartialRange: true, className: twMerge("custom-day-picker", "range-picker", classNameCalendar), locale: language, onChange: value => {
|
|
271
271
|
if (Array.isArray(value) && value[0] && value[1]) {
|
|
272
272
|
handleOnRangeSelect({ start: value[0], end: value[1] });
|
|
273
273
|
}
|
|
@@ -774,7 +774,7 @@ const ITEMS_PER_PAGE = 20;
|
|
|
774
774
|
* @param {TimelineProps} props - The props for the Timeline component
|
|
775
775
|
* @returns {ReactElement} Timeline component
|
|
776
776
|
*/
|
|
777
|
-
const Timeline = ({ className, "data-testid": dataTestId, children, dateHeader, customHeader, toggleButton, }) => {
|
|
777
|
+
const Timeline = ({ className, "data-testid": dataTestId, children, dateHeader, customHeader, toggleButton, ref: refProp, }) => {
|
|
778
778
|
const ref = useRef(null);
|
|
779
779
|
const [isOpen, setIsOpen] = useState(false);
|
|
780
780
|
const [visibleCount, setVisibleCount] = useState(ITEMS_PER_PAGE);
|
|
@@ -823,7 +823,7 @@ const Timeline = ({ className, "data-testid": dataTestId, children, dateHeader,
|
|
|
823
823
|
}, [isOpen]);
|
|
824
824
|
const renderToggleButton = () => (jsxs("div", { className: cvaTimelineElement(), children: [childProps.date ? (jsx("div", { className: cvaTimelineElementTime({
|
|
825
825
|
width: hourCycle === "h12" || hourCycle === "h11" ? "large" : "small",
|
|
826
|
-
}) })) : null, jsx("div", { className: cvaDotWrapper(), children: jsx("div", { className: cvaLine({ lineStyle: childProps.lineStyle }) }) }), jsxs("div", { className: "
|
|
826
|
+
}) })) : null, jsx("div", { className: cvaDotWrapper(), children: jsx("div", { className: cvaLine({ lineStyle: childProps.lineStyle }) }) }), jsxs("div", { className: "min-h-8 flex cursor-pointer items-center text-sm text-neutral-500 hover:text-neutral-600", "data-testid": "timeline-toggle-btn", onClick: () => {
|
|
827
827
|
if (toggleButton?.onClick) {
|
|
828
828
|
toggleButton.onClick();
|
|
829
829
|
}
|
|
@@ -839,7 +839,7 @@ const Timeline = ({ className, "data-testid": dataTestId, children, dateHeader,
|
|
|
839
839
|
const { date, dateRange, showTime } = dateHeader;
|
|
840
840
|
return (jsx("div", { className: "pb-4", "data-testid": "timeline-date-header", children: date ? (jsxs(Fragment, { children: [jsx(Text, { size: "medium", type: "span", weight: "thick", children: formatDate(date, { selectFormat: !showTime ? "dateOnly" : undefined }) }), jsx(Text, { className: "text-neutral-500", size: "medium", type: "span", weight: "thick", children: ` (${timeSinceAuto(date, new Date(), undefined, locale)})` })] })) : (jsx(Text, { className: "pr-1", size: "medium", type: "span", weight: "thick", children: formatRange(dateRange, { dateStyle: !showTime ? "medium" : undefined }) })) }));
|
|
841
841
|
}, [dateHeader, formatDate, formatRange, customHeader, locale]);
|
|
842
|
-
return (jsxs("div", { className: className, "data-testid": dataTestId, children: [renderDateHeader(), customHeader ? jsx("div", { className: "text-sm font-semibold", children: customHeader }) : null, toggleButton && middleChildren.length > 0 ? (jsxs("div", { children: [firstChild, middleChildren.length > 0 ? renderToggleButton() : null, jsxs("div", { "aria-hidden": !isOpen, className: "overflow-hidden overflow-y-auto transition-all duration-300", ref: ref, children: [jsx("div", {}), visibleMiddleChildren, isOpen && visibleCount < middleChildren.length ? (jsx("div", { className: "flex justify-center py-2", onClick: e => {
|
|
842
|
+
return (jsxs("div", { className: className, "data-testid": dataTestId, ref: refProp, children: [renderDateHeader(), customHeader ? jsx("div", { className: "text-sm font-semibold", children: customHeader }) : null, toggleButton && middleChildren.length > 0 ? (jsxs("div", { children: [firstChild, middleChildren.length > 0 ? renderToggleButton() : null, jsxs("div", { "aria-hidden": !isOpen, className: "overflow-hidden overflow-y-auto transition-all duration-300", ref: ref, children: [jsx("div", {}), visibleMiddleChildren, isOpen && visibleCount < middleChildren.length ? (jsx("div", { className: "flex justify-center py-2", onClick: e => {
|
|
843
843
|
e.stopPropagation(); // Prevent parent handlers from firing
|
|
844
844
|
loadMoreItems();
|
|
845
845
|
}, children: jsx(Text, { className: "cursor-pointer text-neutral-500 hover:text-neutral-600", "data-testid": "load-more-text", size: "small", type: "span", children: t("timeline.loadMore") }) })) : null, jsx("div", {})] }), lastChild] })) : (jsx("div", { children: children }))] }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-date-and-time-components",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.25",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
|
-
"@trackunit/react-components": "1.17.
|
|
12
|
-
"@trackunit/date-and-time-utils": "1.11.
|
|
13
|
-
"@trackunit/react-date-and-time-hooks": "1.13.
|
|
14
|
-
"@trackunit/css-class-variance-utilities": "1.11.
|
|
15
|
-
"@trackunit/ui-icons": "1.11.
|
|
16
|
-
"@trackunit/shared-utils": "1.13.
|
|
17
|
-
"@trackunit/i18n-library-translation": "1.12.
|
|
18
|
-
"@trackunit/react-form-components": "1.14.
|
|
11
|
+
"@trackunit/react-components": "1.17.20",
|
|
12
|
+
"@trackunit/date-and-time-utils": "1.11.44",
|
|
13
|
+
"@trackunit/react-date-and-time-hooks": "1.13.25",
|
|
14
|
+
"@trackunit/css-class-variance-utilities": "1.11.43",
|
|
15
|
+
"@trackunit/ui-icons": "1.11.42",
|
|
16
|
+
"@trackunit/shared-utils": "1.13.43",
|
|
17
|
+
"@trackunit/i18n-library-translation": "1.12.27",
|
|
18
|
+
"@trackunit/react-form-components": "1.14.22",
|
|
19
19
|
"string-ts": "^2.0.0",
|
|
20
20
|
"tailwind-merge": "^2.0.0",
|
|
21
21
|
"react-calendar": "^6.0.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { ReactElement } from "react";
|
|
3
3
|
export type FurtherBackThanDays = {
|
|
4
4
|
/**
|
|
@@ -10,7 +10,7 @@ export type DisabledDaysMatcher = ((date: Date) => boolean) | {
|
|
|
10
10
|
before?: Date;
|
|
11
11
|
after?: Date;
|
|
12
12
|
} | Array<Date> | FurtherBackThanDays;
|
|
13
|
-
export interface DayPickerProps extends CommonProps {
|
|
13
|
+
export interface DayPickerProps extends CommonProps, Refable<HTMLDivElement> {
|
|
14
14
|
/**
|
|
15
15
|
* A callback function for when a date is selected
|
|
16
16
|
*/
|
|
@@ -34,4 +34,4 @@ export interface DayPickerProps extends CommonProps {
|
|
|
34
34
|
* @param {DayPickerProps} props - The props for the DayPicker component
|
|
35
35
|
* @returns {ReactElement} DayPicker component
|
|
36
36
|
*/
|
|
37
|
-
export declare const DayPicker: ({ onDaySelect, disabledDays, selectedDay, language, className, "data-testid": dataTestId, }: DayPickerProps) => ReactElement;
|
|
37
|
+
export declare const DayPicker: ({ onDaySelect, disabledDays, selectedDay, language, className, "data-testid": dataTestId, ref, }: DayPickerProps) => ReactElement;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { DateRange } from "@trackunit/date-and-time-utils";
|
|
3
3
|
import { ReactElement } from "react";
|
|
4
4
|
import { TimeZone } from "../index";
|
|
5
5
|
import { DisabledDaysMatcher } from "./DayPicker";
|
|
6
|
-
export interface DayRangePickerProps extends CommonProps {
|
|
6
|
+
export interface DayRangePickerProps extends CommonProps, Refable<HTMLDivElement> {
|
|
7
7
|
/**
|
|
8
8
|
* A callback function for when a range is selected
|
|
9
9
|
*/
|
|
@@ -43,4 +43,4 @@ export interface DayRangePickerProps extends CommonProps {
|
|
|
43
43
|
* @param {DayRangePickerProps} props - The props for the DayRangePicker component
|
|
44
44
|
* @returns {ReactElement} DayRangePicker component
|
|
45
45
|
*/
|
|
46
|
-
export declare const DayRangePicker: ({ onRangeSelect, selectedDays, disabledDays, "data-testid": dataTestId, language, className, classNameCalendar, timezone, cancelButtonLabel, onClose, }: DayRangePickerProps) => ReactElement;
|
|
46
|
+
export declare const DayRangePicker: ({ onRangeSelect, selectedDays, disabledDays, "data-testid": dataTestId, language, className, classNameCalendar, timezone, cancelButtonLabel, onClose, ref, }: DayRangePickerProps) => ReactElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateRange } from "@trackunit/date-and-time-utils";
|
|
2
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
|
-
export interface TimelineProps extends CommonProps {
|
|
4
|
+
export interface TimelineProps extends CommonProps, Refable<HTMLDivElement> {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
toggleButton?: {
|
|
7
7
|
expandedLabel: string;
|
|
@@ -25,4 +25,4 @@ export interface TimelineProps extends CommonProps {
|
|
|
25
25
|
* @param {TimelineProps} props - The props for the Timeline component
|
|
26
26
|
* @returns {ReactElement} Timeline component
|
|
27
27
|
*/
|
|
28
|
-
export declare const Timeline: ({ className, "data-testid": dataTestId, children, dateHeader, customHeader, toggleButton, }: TimelineProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const Timeline: ({ className, "data-testid": dataTestId, children, dateHeader, customHeader, toggleButton, ref: refProp, }: TimelineProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TemporalFormat } from "@trackunit/date-and-time-utils";
|
|
2
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
3
3
|
import { TimeZone } from "../index";
|
|
4
|
-
export interface DateTimeProps extends CommonProps {
|
|
4
|
+
export interface DateTimeProps extends CommonProps, Refable<HTMLTimeElement> {
|
|
5
5
|
value: Date | string | number | null | undefined;
|
|
6
6
|
format?: TemporalFormat;
|
|
7
7
|
fromNow?: boolean;
|
|
@@ -24,4 +24,4 @@ export declare const MS_PER_HOUR: number;
|
|
|
24
24
|
* @param props.timezone TimeZone
|
|
25
25
|
* @param props.subtle boolean
|
|
26
26
|
*/
|
|
27
|
-
export declare const DateTime: ({ value, format, className, fromNow, withTitle, titleFormat, timezone, "data-testid": dataTestId, subtle, }: DateTimeProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const DateTime: ({ value, format, className, fromNow, withTitle, titleFormat, timezone, "data-testid": dataTestId, subtle, ref, }: DateTimeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { Refable } from "@trackunit/react-components";
|
|
2
|
+
export interface RelativeDateTimeProps extends Refable<HTMLTimeElement> {
|
|
2
3
|
value: Date | string | number | null | undefined;
|
|
3
4
|
}
|
|
4
5
|
/**
|
|
@@ -7,4 +8,4 @@ export interface RelativeDateTimeProps {
|
|
|
7
8
|
* @param { RelativeDateTimeProps } props - The properties for the DateTimeHumanized component.
|
|
8
9
|
* @param props.value Date | string | number | null | undefined
|
|
9
10
|
*/
|
|
10
|
-
export declare const DateTimeHumanized: ({ value }: RelativeDateTimeProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const DateTimeHumanized: ({ value, ref }: RelativeDateTimeProps) => import("react/jsx-runtime").JSX.Element;
|