@helpwave/hightide 0.8.1 → 0.8.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/dist/index.mjs CHANGED
@@ -14327,7 +14327,7 @@ var TableBody = React5.memo(function TableBodyVisual() {
14327
14327
 
14328
14328
  // src/components/layout/table/TableHeader.tsx
14329
14329
  import { flexRender as flexRender2 } from "@tanstack/react-table";
14330
- import clsx26 from "clsx";
14330
+ import clsx25 from "clsx";
14331
14331
 
14332
14332
  // src/components/layout/table/TableSortButton.tsx
14333
14333
  import { ChevronDown as ChevronDown3, ChevronsUpDown, ChevronUp as ChevronUp2 } from "lucide-react";
@@ -14385,179 +14385,6 @@ import { useEffect as useEffect32, useId as useId15, useMemo as useMemo26, useRe
14385
14385
  // src/components/user-interaction/input/DateTimeInput.tsx
14386
14386
  import { forwardRef as forwardRef17, useCallback as useCallback25, useEffect as useEffect31, useId as useId13, useImperativeHandle as useImperativeHandle11, useMemo as useMemo24, useRef as useRef29, useState as useState28 } from "react";
14387
14387
  import { CalendarIcon } from "lucide-react";
14388
- import clsx25 from "clsx";
14389
-
14390
- // src/utils/date.ts
14391
- var monthsList = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
14392
- var weekDayList = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
14393
- var formatDate = (date) => {
14394
- const year = date.getFullYear().toString().padStart(4, "0");
14395
- const month = (date.getMonth() + 1).toString().padStart(2, "0");
14396
- const day = date.getDate().toString().padStart(2, "0");
14397
- return `${year}-${month}-${day}`;
14398
- };
14399
- var formatDateTime = (date) => {
14400
- const dateString = formatDate(date);
14401
- const hours = date.getHours().toString().padStart(2, "0");
14402
- const minutes = date.getMinutes().toString().padStart(2, "0");
14403
- return `${dateString}T${hours}:${minutes}`;
14404
- };
14405
- var changeDuration = (date, duration, isAdding) => {
14406
- const {
14407
- years = 0,
14408
- months = 0,
14409
- days = 0,
14410
- hours = 0,
14411
- minutes = 0,
14412
- seconds = 0,
14413
- milliseconds = 0
14414
- } = duration;
14415
- if (years < 0) {
14416
- console.error(`Range error years must be greater than 0: received ${years}`);
14417
- return new Date(date);
14418
- }
14419
- if (months < 0 || months > 11) {
14420
- console.error(`Range error month must be 0 <= month <= 11: received ${months}`);
14421
- return new Date(date);
14422
- }
14423
- if (days < 0) {
14424
- console.error(`Range error days must be greater than 0: received ${days}`);
14425
- return new Date(date);
14426
- }
14427
- if (hours < 0 || hours > 23) {
14428
- console.error(`Range error hours must be 0 <= hours <= 23: received ${hours}`);
14429
- return new Date(date);
14430
- }
14431
- if (minutes < 0 || minutes > 59) {
14432
- console.error(`Range error minutes must be 0 <= minutes <= 59: received ${minutes}`);
14433
- return new Date(date);
14434
- }
14435
- if (seconds < 0 || seconds > 59) {
14436
- console.error(`Range error seconds must be 0 <= seconds <= 59: received ${seconds}`);
14437
- return new Date(date);
14438
- }
14439
- if (milliseconds < 0) {
14440
- console.error(`Range error seconds must be greater than 0: received ${milliseconds}`);
14441
- return new Date(date);
14442
- }
14443
- const multiplier = isAdding ? 1 : -1;
14444
- const newDate = new Date(date);
14445
- newDate.setFullYear(newDate.getFullYear() + multiplier * years);
14446
- newDate.setMonth(newDate.getMonth() + multiplier * months);
14447
- newDate.setDate(newDate.getDate() + multiplier * days);
14448
- newDate.setHours(newDate.getHours() + multiplier * hours);
14449
- newDate.setMinutes(newDate.getMinutes() + multiplier * minutes);
14450
- newDate.setSeconds(newDate.getSeconds() + multiplier * seconds);
14451
- newDate.setMilliseconds(newDate.getMilliseconds() + multiplier * milliseconds);
14452
- return newDate;
14453
- };
14454
- var addDuration = (date, duration) => {
14455
- return changeDuration(date, duration, true);
14456
- };
14457
- var subtractDuration = (date, duration) => {
14458
- return changeDuration(date, duration, false);
14459
- };
14460
- var getBetweenDuration = (startDate, endDate) => {
14461
- const durationInMilliseconds = endDate.getTime() - startDate.getTime();
14462
- const millisecondsInSecond = 1e3;
14463
- const millisecondsInMinute = 60 * millisecondsInSecond;
14464
- const millisecondsInHour = 60 * millisecondsInMinute;
14465
- const millisecondsInDay = 24 * millisecondsInHour;
14466
- const millisecondsInMonth = 30 * millisecondsInDay;
14467
- const years = Math.floor(durationInMilliseconds / (365.25 * millisecondsInDay));
14468
- const months = Math.floor(durationInMilliseconds / millisecondsInMonth);
14469
- const days = Math.floor(durationInMilliseconds / millisecondsInDay);
14470
- const hours = Math.floor(durationInMilliseconds % millisecondsInDay / millisecondsInHour);
14471
- const seconds = Math.floor(durationInMilliseconds % millisecondsInHour / millisecondsInSecond);
14472
- const milliseconds = durationInMilliseconds % millisecondsInSecond;
14473
- return {
14474
- years,
14475
- months,
14476
- days,
14477
- hours,
14478
- seconds,
14479
- milliseconds
14480
- };
14481
- };
14482
- var isInTimeSpan = (value, startDate, endDate) => {
14483
- if (startDate && endDate) {
14484
- console.assert(startDate <= endDate);
14485
- return startDate <= value && value <= endDate;
14486
- } else if (startDate) {
14487
- return startDate <= value;
14488
- } else if (endDate) {
14489
- return endDate >= value;
14490
- } else {
14491
- return true;
14492
- }
14493
- };
14494
- var equalDate = (date1, date2) => {
14495
- return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
14496
- };
14497
- var getWeeksForCalenderMonth = (date, weekStart, weeks = 6) => {
14498
- const month = date.getMonth();
14499
- const year = date.getFullYear();
14500
- const dayList = [];
14501
- let currentDate = new Date(year, month, 1);
14502
- const weekStartIndex = weekDayList.indexOf(weekStart);
14503
- while (currentDate.getDay() !== weekStartIndex) {
14504
- currentDate = subtractDuration(currentDate, { days: 1 });
14505
- }
14506
- while (dayList.length < 7 * weeks) {
14507
- const date2 = new Date(currentDate);
14508
- date2.setHours(date2.getHours(), date2.getMinutes());
14509
- dayList.push(date2);
14510
- currentDate = addDuration(currentDate, { days: 1 });
14511
- }
14512
- return equalSizeGroups(dayList, 7);
14513
- };
14514
- var formatGerman = (date, showTime) => {
14515
- const d = new Intl.DateTimeFormat("de-DE", {
14516
- day: "2-digit",
14517
- month: "2-digit",
14518
- year: "numeric"
14519
- }).format(date);
14520
- if (!showTime) return d;
14521
- const t = new Intl.DateTimeFormat("de-DE", {
14522
- hour: "2-digit",
14523
- minute: "2-digit"
14524
- }).format(date);
14525
- return `${d} um ${t} Uhr`;
14526
- };
14527
- var formatAbsolute = (date, locale, showTime) => {
14528
- if (locale === "de-DE") {
14529
- return formatGerman(date, showTime);
14530
- }
14531
- const options = {
14532
- year: "numeric",
14533
- month: "numeric",
14534
- day: "numeric"
14535
- };
14536
- if (showTime) {
14537
- options.hour = "numeric";
14538
- options.minute = "numeric";
14539
- }
14540
- return new Intl.DateTimeFormat(locale, options).format(date);
14541
- };
14542
- var formatRelative = (date, locale, showTime) => {
14543
- const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
14544
- const now = /* @__PURE__ */ new Date();
14545
- const diffInSeconds = (date.getTime() - now.getTime()) / 1e3;
14546
- if (Math.abs(diffInSeconds) < 60) return rtf.format(Math.round(diffInSeconds), "second");
14547
- if (Math.abs(diffInSeconds) < 3600) return rtf.format(Math.round(diffInSeconds / 60), "minute");
14548
- if (Math.abs(diffInSeconds) < 86400) return rtf.format(Math.round(diffInSeconds / 3600), "hour");
14549
- if (Math.abs(diffInSeconds) < 604800) return rtf.format(Math.round(diffInSeconds / 86400), "day");
14550
- return formatAbsolute(date, locale, showTime);
14551
- };
14552
- var DateUtils = {
14553
- monthsList,
14554
- weekDayList,
14555
- equalDate,
14556
- formatAbsolute,
14557
- formatRelative
14558
- };
14559
-
14560
- // src/components/user-interaction/date/DateTimePicker.tsx
14561
14388
  import clsx24 from "clsx";
14562
14389
 
14563
14390
  // src/components/user-interaction/date/TimePicker.tsx
@@ -14675,6 +14502,173 @@ var TimePicker = ({
14675
14502
  // src/components/user-interaction/date/DatePicker.tsx
14676
14503
  import { useState as useState27 } from "react";
14677
14504
  import { ArrowDown, ArrowUp, Calendar, ChevronDown as ChevronDown4 } from "lucide-react";
14505
+
14506
+ // src/utils/date.ts
14507
+ var timesInSeconds = {
14508
+ second: 1,
14509
+ minute: 60,
14510
+ hour: 3600,
14511
+ day: 86400,
14512
+ week: 604800,
14513
+ monthImprecise: 2629800,
14514
+ // 30.4375 days
14515
+ yearImprecise: 31557600
14516
+ // 365.25 days
14517
+ };
14518
+ var monthsList = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
14519
+ var weekDayList = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
14520
+ var changeDuration = (date, duration, isAdding) => {
14521
+ const {
14522
+ years = 0,
14523
+ months = 0,
14524
+ days = 0,
14525
+ hours = 0,
14526
+ minutes = 0,
14527
+ seconds = 0,
14528
+ milliseconds = 0
14529
+ } = duration;
14530
+ if (years < 0) {
14531
+ console.error(`Range error years must be greater than 0: received ${years}`);
14532
+ return new Date(date);
14533
+ }
14534
+ if (months < 0 || months > 11) {
14535
+ console.error(`Range error month must be 0 <= month <= 11: received ${months}`);
14536
+ return new Date(date);
14537
+ }
14538
+ if (days < 0) {
14539
+ console.error(`Range error days must be greater than 0: received ${days}`);
14540
+ return new Date(date);
14541
+ }
14542
+ if (hours < 0 || hours > 23) {
14543
+ console.error(`Range error hours must be 0 <= hours <= 23: received ${hours}`);
14544
+ return new Date(date);
14545
+ }
14546
+ if (minutes < 0 || minutes > 59) {
14547
+ console.error(`Range error minutes must be 0 <= minutes <= 59: received ${minutes}`);
14548
+ return new Date(date);
14549
+ }
14550
+ if (seconds < 0 || seconds > 59) {
14551
+ console.error(`Range error seconds must be 0 <= seconds <= 59: received ${seconds}`);
14552
+ return new Date(date);
14553
+ }
14554
+ if (milliseconds < 0) {
14555
+ console.error(`Range error seconds must be greater than 0: received ${milliseconds}`);
14556
+ return new Date(date);
14557
+ }
14558
+ const multiplier = isAdding ? 1 : -1;
14559
+ const newDate = new Date(date);
14560
+ newDate.setFullYear(newDate.getFullYear() + multiplier * years);
14561
+ newDate.setMonth(newDate.getMonth() + multiplier * months);
14562
+ newDate.setDate(newDate.getDate() + multiplier * days);
14563
+ newDate.setHours(newDate.getHours() + multiplier * hours);
14564
+ newDate.setMinutes(newDate.getMinutes() + multiplier * minutes);
14565
+ newDate.setSeconds(newDate.getSeconds() + multiplier * seconds);
14566
+ newDate.setMilliseconds(newDate.getMilliseconds() + multiplier * milliseconds);
14567
+ return newDate;
14568
+ };
14569
+ var addDuration = (date, duration) => {
14570
+ return changeDuration(date, duration, true);
14571
+ };
14572
+ var subtractDuration = (date, duration) => {
14573
+ return changeDuration(date, duration, false);
14574
+ };
14575
+ var between = (value, startDate, endDate) => {
14576
+ if (startDate && endDate) {
14577
+ console.assert(startDate <= endDate);
14578
+ return startDate <= value && value <= endDate;
14579
+ } else if (startDate) {
14580
+ return startDate <= value;
14581
+ } else if (endDate) {
14582
+ return endDate >= value;
14583
+ } else {
14584
+ return true;
14585
+ }
14586
+ };
14587
+ var equalDate = (date1, date2) => {
14588
+ return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
14589
+ };
14590
+ var weeksForCalenderMonth = (date, weekStart, weeks = 6) => {
14591
+ const month = date.getMonth();
14592
+ const year = date.getFullYear();
14593
+ const dayList = [];
14594
+ let currentDate = new Date(year, month, 1);
14595
+ const weekStartIndex = weekDayList.indexOf(weekStart);
14596
+ while (currentDate.getDay() !== weekStartIndex) {
14597
+ currentDate = subtractDuration(currentDate, { days: 1 });
14598
+ }
14599
+ while (dayList.length < 7 * weeks) {
14600
+ const date2 = new Date(currentDate);
14601
+ date2.setHours(date2.getHours(), date2.getMinutes());
14602
+ dayList.push(date2);
14603
+ currentDate = addDuration(currentDate, { days: 1 });
14604
+ }
14605
+ return equalSizeGroups(dayList, 7);
14606
+ };
14607
+ var formatAbsolute = (date, locale, format) => {
14608
+ let options;
14609
+ switch (format) {
14610
+ case "date":
14611
+ options = {
14612
+ year: "2-digit",
14613
+ month: "2-digit",
14614
+ day: "2-digit"
14615
+ };
14616
+ break;
14617
+ case "time":
14618
+ options = {
14619
+ hour: "2-digit",
14620
+ minute: "2-digit"
14621
+ };
14622
+ break;
14623
+ case "dateTime":
14624
+ options = {
14625
+ year: "numeric",
14626
+ month: "2-digit",
14627
+ day: "2-digit",
14628
+ hour: "2-digit",
14629
+ minute: "2-digit"
14630
+ };
14631
+ break;
14632
+ }
14633
+ return new Intl.DateTimeFormat(locale, options).format(date);
14634
+ };
14635
+ var formatRelative = (date, locale) => {
14636
+ const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
14637
+ const now = /* @__PURE__ */ new Date();
14638
+ const diffInSeconds = (date.getTime() - now.getTime()) / 1e3;
14639
+ if (Math.abs(diffInSeconds) < timesInSeconds.minute) return rtf.format(Math.round(diffInSeconds), "second");
14640
+ if (Math.abs(diffInSeconds) < timesInSeconds.hour) return rtf.format(Math.round(diffInSeconds / timesInSeconds.minute), "minute");
14641
+ if (Math.abs(diffInSeconds) < timesInSeconds.day) return rtf.format(Math.round(diffInSeconds / timesInSeconds.hour), "hour");
14642
+ if (Math.abs(diffInSeconds) < timesInSeconds.week) return rtf.format(Math.round(diffInSeconds / timesInSeconds.day), "day");
14643
+ if (Math.abs(diffInSeconds) < timesInSeconds.monthImprecise) return rtf.format(Math.round(diffInSeconds / timesInSeconds.week), "week");
14644
+ if (Math.abs(diffInSeconds) < timesInSeconds.monthImprecise) return rtf.format(Math.round(diffInSeconds / timesInSeconds.monthImprecise), "month");
14645
+ return rtf.format(Math.round(diffInSeconds / timesInSeconds.monthImprecise), "year");
14646
+ };
14647
+ var toInputString = (date, format) => {
14648
+ switch (format) {
14649
+ case "date":
14650
+ return date.toISOString().split("T")[0];
14651
+ case "time":
14652
+ return date.toISOString().split("T")[1].split("Z")[0];
14653
+ case "dateTime":
14654
+ return date.toISOString();
14655
+ }
14656
+ };
14657
+ var DateUtils = {
14658
+ monthsList,
14659
+ weekDayList,
14660
+ equalDate,
14661
+ formatAbsolute,
14662
+ formatRelative,
14663
+ addDuration,
14664
+ subtractDuration,
14665
+ between,
14666
+ weeksForCalenderMonth,
14667
+ timesInSeconds,
14668
+ toInputString
14669
+ };
14670
+
14671
+ // src/components/user-interaction/date/DatePicker.tsx
14678
14672
  import clsx23 from "clsx";
14679
14673
 
14680
14674
  // src/components/user-interaction/date/DayPicker.tsx
@@ -14706,7 +14700,7 @@ var DayPicker = ({
14706
14700
  defaultValue: initialDisplayedMonth ?? value
14707
14701
  });
14708
14702
  const month = displayedMonth.getMonth();
14709
- const weeks = getWeeksForCalenderMonth(displayedMonth, weekStart);
14703
+ const weeks = DateUtils.weeksForCalenderMonth(displayedMonth, weekStart);
14710
14704
  const selectedButtonRef = useRef27(null);
14711
14705
  const isValueInDisplayedWeeks = useMemo22(
14712
14706
  () => !!value && weeks.some((week) => week.some((d) => DateUtils.equalDate(value, d))),
@@ -14735,7 +14729,7 @@ var DayPicker = ({
14735
14729
  }, [start, end]);
14736
14730
  const navigateTo = useCallback23((candidate) => {
14737
14731
  const clamped = clampToRange(candidate);
14738
- if (!isInTimeSpan(clamped, start, end)) return;
14732
+ if (!DateUtils.between(clamped, start, end)) return;
14739
14733
  setValue(clamped);
14740
14734
  onEditComplete?.(clamped);
14741
14735
  if (clamped.getMonth() !== displayedMonth.getMonth() || clamped.getFullYear() !== displayedMonth.getFullYear()) {
@@ -14745,10 +14739,10 @@ var DayPicker = ({
14745
14739
  const onKeyDown = useCallback23(
14746
14740
  (event) => {
14747
14741
  PropsUtil.aria.navigate({
14748
- left: () => focusTargetDate && navigateTo(subtractDuration(focusTargetDate, { days: 1 })),
14749
- right: () => focusTargetDate && navigateTo(addDuration(focusTargetDate, { days: 1 })),
14750
- up: () => focusTargetDate && navigateTo(subtractDuration(focusTargetDate, { days: 7 })),
14751
- down: () => focusTargetDate && navigateTo(addDuration(focusTargetDate, { days: 7 }))
14742
+ left: () => focusTargetDate && navigateTo(DateUtils.subtractDuration(focusTargetDate, { days: 1 })),
14743
+ right: () => focusTargetDate && navigateTo(DateUtils.addDuration(focusTargetDate, { days: 1 })),
14744
+ up: () => focusTargetDate && navigateTo(DateUtils.subtractDuration(focusTargetDate, { days: 7 })),
14745
+ down: () => focusTargetDate && navigateTo(DateUtils.addDuration(focusTargetDate, { days: 7 }))
14752
14746
  })(event);
14753
14747
  },
14754
14748
  [focusTargetDate, navigateTo]
@@ -14760,7 +14754,7 @@ var DayPicker = ({
14760
14754
  const isFocused = !!focusTargetDate && DateUtils.equalDate(focusTargetDate, date);
14761
14755
  const isToday = DateUtils.equalDate(/* @__PURE__ */ new Date(), date);
14762
14756
  const isSameMonth = date.getMonth() === month;
14763
- const isDayValid = isInTimeSpan(date, start, end);
14757
+ const isDayValid = DateUtils.between(date, start, end);
14764
14758
  return /* @__PURE__ */ jsx61(
14765
14759
  "div",
14766
14760
  {
@@ -14854,8 +14848,8 @@ var YearRow = memo(function YearRow2({
14854
14848
  }
14855
14849
  );
14856
14850
  });
14857
- var defaultStart = subtractDuration(/* @__PURE__ */ new Date(), { years: 100 });
14858
- var defaultEnd = addDuration(/* @__PURE__ */ new Date(), { years: 100 });
14851
+ var defaultStart = DateUtils.subtractDuration(/* @__PURE__ */ new Date(), { years: 100 });
14852
+ var defaultEnd = DateUtils.addDuration(/* @__PURE__ */ new Date(), { years: 100 });
14859
14853
  var YearMonthPicker = ({
14860
14854
  value: controlledValue,
14861
14855
  initialValue = /* @__PURE__ */ new Date(),
@@ -14981,9 +14975,9 @@ var DatePicker = ({
14981
14975
  {
14982
14976
  tooltip: translation("time.previousMonth"),
14983
14977
  size: "sm",
14984
- disabled: !isInTimeSpan(subtractDuration(displayedMonth, { months: 1 }), start, end),
14978
+ disabled: !DateUtils.between(DateUtils.subtractDuration(displayedMonth, { months: 1 }), start, end),
14985
14979
  onClick: () => {
14986
- setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
14980
+ setDisplayedMonth(DateUtils.subtractDuration(displayedMonth, { months: 1 }));
14987
14981
  },
14988
14982
  children: /* @__PURE__ */ jsx63(ArrowUp, { size: 20 })
14989
14983
  }
@@ -14993,9 +14987,9 @@ var DatePicker = ({
14993
14987
  {
14994
14988
  tooltip: translation("time.nextMonth"),
14995
14989
  size: "sm",
14996
- disabled: !isInTimeSpan(addDuration(displayedMonth, { months: 1 }), start, end),
14990
+ disabled: !DateUtils.between(DateUtils.addDuration(displayedMonth, { months: 1 }), start, end),
14997
14991
  onClick: () => {
14998
- setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
14992
+ setDisplayedMonth(DateUtils.addDuration(displayedMonth, { months: 1 }));
14999
14993
  },
15000
14994
  children: /* @__PURE__ */ jsx63(ArrowDown, { size: 20 })
15001
14995
  }
@@ -15085,7 +15079,6 @@ var DateTimePicker = ({
15085
15079
  ...timePickerProps,
15086
15080
  is24HourFormat,
15087
15081
  minuteIncrement,
15088
- className: clsx24({ "justify-between": mode === "time" }),
15089
15082
  value,
15090
15083
  onValueChange: setValue,
15091
15084
  onEditComplete
@@ -15181,9 +15174,9 @@ var DateTimePickerDialog = ({
15181
15174
  // src/components/user-interaction/input/DateTimeInput.tsx
15182
15175
  import { Fragment as Fragment7, jsx as jsx66, jsxs as jsxs36 } from "react/jsx-runtime";
15183
15176
  var DateTimeInput = forwardRef17(function DateTimeInput2({
15177
+ id: inputId,
15184
15178
  value,
15185
15179
  initialValue = null,
15186
- placeholder,
15187
15180
  onValueChange,
15188
15181
  onEditComplete,
15189
15182
  allowRemove = false,
@@ -15199,7 +15192,6 @@ var DateTimeInput = forwardRef17(function DateTimeInput2({
15199
15192
  ...props
15200
15193
  }, forwardedRef) {
15201
15194
  const translation = useHightideTranslation();
15202
- const { locale } = useLocale();
15203
15195
  const [isOpen, setIsOpen] = useState28(false);
15204
15196
  const [state, setState] = useControlledState({
15205
15197
  value,
@@ -15207,19 +15199,21 @@ var DateTimeInput = forwardRef17(function DateTimeInput2({
15207
15199
  defaultValue: initialValue
15208
15200
  });
15209
15201
  const [dialogValue, setDialogValue] = useState28(state ?? /* @__PURE__ */ new Date());
15202
+ const [dateString, setDateString] = useState28(state ? DateUtils.toInputString(state, mode) : "");
15210
15203
  useEffect31(() => {
15211
15204
  setDialogValue(state ?? /* @__PURE__ */ new Date());
15212
- }, [state]);
15205
+ setDateString(state ? DateUtils.toInputString(state, mode) : "");
15206
+ }, [mode, state]);
15213
15207
  const changeOpenWrapper = useCallback25((isOpen2) => {
15214
15208
  onDialogOpeningChange?.(isOpen2);
15215
15209
  setIsOpen(isOpen2);
15216
15210
  }, [onDialogOpeningChange]);
15217
- const id = useId13();
15211
+ const generatedId = useId13();
15218
15212
  const ids = useMemo24(() => ({
15219
- input: `date-time-input-${id}`,
15220
- popup: `date-time-input-popup-${id}`,
15221
- label: `date-time-input-label-${id}`
15222
- }), [id]);
15213
+ input: inputId ?? `date-time-input-${generatedId}`,
15214
+ popup: `date-time-input-popup-${generatedId}`,
15215
+ label: `date-time-input-label-${generatedId}`
15216
+ }), [generatedId, inputId]);
15223
15217
  const innerRef = useRef29(null);
15224
15218
  useImperativeHandle11(forwardedRef, () => innerRef.current);
15225
15219
  useEffect31(() => {
@@ -15227,30 +15221,28 @@ var DateTimeInput = forwardRef17(function DateTimeInput2({
15227
15221
  changeOpenWrapper(false);
15228
15222
  }
15229
15223
  }, [changeOpenWrapper, readOnly, disabled]);
15230
- const clickHandler = PropsUtil.aria.click(() => changeOpenWrapper(true));
15231
15224
  return /* @__PURE__ */ jsxs36(Fragment7, { children: [
15232
- /* @__PURE__ */ jsxs36("div", { ...containerProps, className: clsx25("relative w-full", containerProps?.className), children: [
15225
+ /* @__PURE__ */ jsxs36("div", { ...containerProps, className: clsx24("relative w-full", containerProps?.className), children: [
15233
15226
  /* @__PURE__ */ jsx66(
15234
- "div",
15227
+ "input",
15235
15228
  {
15236
15229
  ...props,
15237
15230
  ref: innerRef,
15238
15231
  id: ids.input,
15239
- onClick: (event) => {
15240
- clickHandler.onClick();
15241
- props.onClick?.(event);
15232
+ value: dateString,
15233
+ onChange: (event) => {
15234
+ const date = event.target.valueAsDate;
15235
+ if (date) {
15236
+ setState(date);
15237
+ } else {
15238
+ setDateString(event.target.value);
15239
+ }
15242
15240
  },
15243
- onKeyDown: clickHandler.onKeyDown,
15241
+ type: mode === "date" ? "date" : mode === "time" ? "time" : "datetime-local",
15244
15242
  ...PropsUtil.dataAttributes.interactionStates({ disabled, readOnly, invalid, required }),
15245
- "data-value": PropsUtil.dataAttributes.bool(!!state),
15246
- ...PropsUtil.aria.interactionStates({ disabled, readOnly, invalid, required }, props),
15247
- tabIndex: 0,
15248
- role: "combobox",
15249
- "aria-haspopup": "dialog",
15250
- "aria-expanded": isOpen,
15251
- "aria-controls": isOpen ? ids.popup : void 0,
15252
15243
  "data-name": props["data-name"] ?? "date-time-input",
15253
- children: state ? DateUtils.formatAbsolute(state, locale, mode === "dateTime") : placeholder ?? translation("clickToSelect")
15244
+ "data-value": PropsUtil.dataAttributes.bool(!!state || !!dateString),
15245
+ ...PropsUtil.aria.interactionStates({ disabled, readOnly, invalid, required }, props)
15254
15246
  }
15255
15247
  ),
15256
15248
  /* @__PURE__ */ jsx66(Visibility, { isVisible: !readOnly, children: /* @__PURE__ */ jsx66(
@@ -15732,6 +15724,12 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
15732
15724
  };
15733
15725
  var DateFilter = ({ filterValue, onFilterValueChange }) => {
15734
15726
  const translation = useHightideTranslation();
15727
+ const id = useId14();
15728
+ const ids = {
15729
+ startDate: `date-filter-start-date-${id}`,
15730
+ endDate: `date-filter-end-date-${id}`,
15731
+ compareDate: `date-filter-compare-date-${id}`
15732
+ };
15735
15733
  const operator = filterValue?.operator ?? "dateBetween";
15736
15734
  const parameter = filterValue?.parameter ?? {};
15737
15735
  const [temporaryMinDateValue, setTemporaryMinDateValue] = useState29(null);
@@ -15759,11 +15757,12 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
15759
15757
  ),
15760
15758
  /* @__PURE__ */ jsx69("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
15761
15759
  /* @__PURE__ */ jsx69(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ jsxs39("div", { className: "flex-col-2 gap-2", children: [
15760
+ /* @__PURE__ */ jsx69("label", { htmlFor: ids.startDate, className: "typography-label-md", children: translation("startDate") }),
15762
15761
  /* @__PURE__ */ jsx69(
15763
15762
  DateTimeInput,
15764
15763
  {
15764
+ id: ids.startDate,
15765
15765
  value: temporaryMinDateValue ?? parameter.min ?? null,
15766
- placeholder: translation("startDate"),
15767
15766
  onValueChange: (value) => setTemporaryMinDateValue(value),
15768
15767
  onEditComplete: (value) => {
15769
15768
  if (value && parameter.max && value > parameter.max) {
@@ -15792,11 +15791,12 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
15792
15791
  className: "min-w-64"
15793
15792
  }
15794
15793
  ),
15794
+ /* @__PURE__ */ jsx69("label", { htmlFor: ids.endDate, className: "typography-label-md", children: translation("endDate") }),
15795
15795
  /* @__PURE__ */ jsx69(
15796
15796
  DateTimeInput,
15797
15797
  {
15798
+ id: ids.endDate,
15798
15799
  value: temporaryMaxDateValue ?? parameter.max ?? null,
15799
- placeholder: translation("endDate"),
15800
15800
  onValueChange: (value) => setTemporaryMaxDateValue(value),
15801
15801
  onEditComplete: (value) => {
15802
15802
  if (value && parameter.min && value < parameter.min) {
@@ -15825,27 +15825,36 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
15825
15825
  }
15826
15826
  )
15827
15827
  ] }) }),
15828
- /* @__PURE__ */ jsx69(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ jsx69(
15829
- DateTimeInput,
15830
- {
15831
- value: parameter.compareDate ?? null,
15832
- placeholder: translation("date"),
15833
- onValueChange: (compareDate) => {
15834
- onFilterValueChange({
15835
- operator,
15836
- parameter: { compareDate }
15837
- });
15838
- },
15839
- allowRemove: true,
15840
- outsideClickCloses: false,
15841
- className: "min-w-64"
15842
- }
15843
- ) }),
15828
+ /* @__PURE__ */ jsxs39(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: [
15829
+ /* @__PURE__ */ jsx69("label", { htmlFor: ids.compareDate, className: "typography-label-md", children: translation("date") }),
15830
+ /* @__PURE__ */ jsx69(
15831
+ DateTimeInput,
15832
+ {
15833
+ id: ids.compareDate,
15834
+ value: parameter.compareDate ?? null,
15835
+ onValueChange: (compareDate) => {
15836
+ onFilterValueChange({
15837
+ operator,
15838
+ parameter: { compareDate }
15839
+ });
15840
+ },
15841
+ allowRemove: true,
15842
+ outsideClickCloses: false,
15843
+ className: "min-w-64"
15844
+ }
15845
+ )
15846
+ ] }),
15844
15847
  /* @__PURE__ */ jsx69(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx69("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
15845
15848
  ] });
15846
15849
  };
15847
15850
  var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
15848
15851
  const translation = useHightideTranslation();
15852
+ const id = useId14();
15853
+ const ids = {
15854
+ startDate: `datetime-filter-start-date-${id}`,
15855
+ endDate: `datetime-filter-end-date-${id}`,
15856
+ compareDate: `datetime-filter-compare-date-${id}`
15857
+ };
15849
15858
  const operator = filterValue?.operator ?? "dateTimeBetween";
15850
15859
  const parameter = filterValue?.parameter ?? {};
15851
15860
  const [temporaryMinDateValue, setTemporaryMinDateValue] = useState29(null);
@@ -15873,12 +15882,13 @@ var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
15873
15882
  ),
15874
15883
  /* @__PURE__ */ jsx69("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
15875
15884
  /* @__PURE__ */ jsx69(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ jsxs39("div", { className: "flex-col-2 gap-2", children: [
15885
+ /* @__PURE__ */ jsx69("label", { htmlFor: ids.startDate, className: "typography-label-md", children: translation("startDate") }),
15876
15886
  /* @__PURE__ */ jsx69(
15877
15887
  DateTimeInput,
15878
15888
  {
15889
+ id: ids.startDate,
15879
15890
  mode: "dateTime",
15880
15891
  value: temporaryMinDateValue ?? parameter.min ?? null,
15881
- placeholder: translation("startDate"),
15882
15892
  onValueChange: (value) => setTemporaryMinDateValue(value),
15883
15893
  onEditComplete: (value) => {
15884
15894
  if (value && parameter.max && value > parameter.max) {
@@ -15907,12 +15917,13 @@ var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
15907
15917
  className: "min-w-64"
15908
15918
  }
15909
15919
  ),
15920
+ /* @__PURE__ */ jsx69("label", { htmlFor: ids.endDate, className: "typography-label-md", children: translation("endDate") }),
15910
15921
  /* @__PURE__ */ jsx69(
15911
15922
  DateTimeInput,
15912
15923
  {
15924
+ id: ids.endDate,
15913
15925
  mode: "dateTime",
15914
15926
  value: temporaryMaxDateValue ?? parameter.max ?? null,
15915
- placeholder: translation("endDate"),
15916
15927
  onValueChange: (value) => setTemporaryMaxDateValue(value),
15917
15928
  onEditComplete: (value) => {
15918
15929
  if (value && parameter.min && value < parameter.min) {
@@ -15941,22 +15952,25 @@ var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
15941
15952
  }
15942
15953
  )
15943
15954
  ] }) }),
15944
- /* @__PURE__ */ jsx69(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ jsx69(
15945
- DateTimeInput,
15946
- {
15947
- value: parameter.compareDatetime ?? null,
15948
- placeholder: translation("date"),
15949
- onValueChange: (compareDatetime) => {
15950
- onFilterValueChange({
15951
- operator,
15952
- parameter: { compareDatetime }
15953
- });
15954
- },
15955
- allowRemove: true,
15956
- outsideClickCloses: false,
15957
- className: "min-w-64"
15958
- }
15959
- ) }),
15955
+ /* @__PURE__ */ jsxs39(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: [
15956
+ /* @__PURE__ */ jsx69("label", { htmlFor: ids.compareDate, className: "typography-label-md", children: translation("date") }),
15957
+ /* @__PURE__ */ jsx69(
15958
+ DateTimeInput,
15959
+ {
15960
+ id: ids.compareDate,
15961
+ value: parameter.compareDatetime ?? null,
15962
+ onValueChange: (compareDatetime) => {
15963
+ onFilterValueChange({
15964
+ operator,
15965
+ parameter: { compareDatetime }
15966
+ });
15967
+ },
15968
+ allowRemove: true,
15969
+ outsideClickCloses: false,
15970
+ className: "min-w-64"
15971
+ }
15972
+ )
15973
+ ] }),
15960
15974
  /* @__PURE__ */ jsx69(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx69("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
15961
15975
  ] });
15962
15976
  };
@@ -16293,14 +16307,14 @@ var TableHeader = ({ isSticky = false }) => {
16293
16307
  },
16294
16308
  header.id
16295
16309
  )) }) }, headerGroup.id)),
16296
- /* @__PURE__ */ jsx71("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx71("tr", { "data-name": "table-header-row", className: clsx26(table.options.meta?.headerRowClassName), children: headerGroup.headers.map((header) => {
16310
+ /* @__PURE__ */ jsx71("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx71("tr", { "data-name": "table-header-row", className: clsx25(table.options.meta?.headerRowClassName), children: headerGroup.headers.map((header) => {
16297
16311
  return /* @__PURE__ */ jsxs41(
16298
16312
  "th",
16299
16313
  {
16300
16314
  colSpan: header.colSpan,
16301
16315
  "data-sticky": isSticky ? "" : void 0,
16302
16316
  "data-name": "table-header-cell",
16303
- className: clsx26("group/table-header-cell", header.column.columnDef.meta?.className),
16317
+ className: clsx25("group/table-header-cell", header.column.columnDef.meta?.className),
16304
16318
  children: [
16305
16319
  /* @__PURE__ */ jsx71(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ jsxs41("div", { className: "flex-row-1 items-center", children: [
16306
16320
  /* @__PURE__ */ jsx71(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ jsx71(
@@ -16400,7 +16414,7 @@ var TableDisplay = ({
16400
16414
  };
16401
16415
 
16402
16416
  // src/components/layout/table/TablePagination.tsx
16403
- import clsx27 from "clsx";
16417
+ import clsx26 from "clsx";
16404
16418
  import { jsx as jsx73, jsxs as jsxs43 } from "react/jsx-runtime";
16405
16419
  var TablePaginationMenu = ({ ...props }) => {
16406
16420
  const { table } = useTableStateWithoutSizingContext();
@@ -16435,7 +16449,7 @@ var TablePageSizeSelect = ({
16435
16449
  );
16436
16450
  };
16437
16451
  var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props }) => {
16438
- return /* @__PURE__ */ jsxs43("div", { ...props, className: clsx27("container flex-col-2 sm:flex-row-8 items-center justify-center", props.className), children: [
16452
+ return /* @__PURE__ */ jsxs43("div", { ...props, className: clsx26("container flex-col-2 sm:flex-row-8 items-center justify-center", props.className), children: [
16439
16453
  /* @__PURE__ */ jsx73(TablePaginationMenu, {}),
16440
16454
  /* @__PURE__ */ jsx73(Visibility, { isVisible: allowChangingPageSize, children: /* @__PURE__ */ jsx73(TablePageSizeSelect, { pageSizeOptions, buttonProps: { className: "h-10 min-w-24 max-w-24" } }) })
16441
16455
  ] });
@@ -16528,11 +16542,11 @@ var TableWithSelectionProvider = ({
16528
16542
  };
16529
16543
 
16530
16544
  // src/components/layout/table/Table.tsx
16531
- import clsx28 from "clsx";
16545
+ import clsx27 from "clsx";
16532
16546
  import { jsx as jsx75, jsxs as jsxs44 } from "react/jsx-runtime";
16533
16547
  var Table = ({ children, table, paginationOptions, displayProps, header, footer, ...props }) => {
16534
16548
  const { showPagination = true, allowChangingPageSize, pageSizeOptions } = paginationOptions ?? {};
16535
- return /* @__PURE__ */ jsx75("div", { ...props, className: clsx28("flex-col-3", props.className), children: /* @__PURE__ */ jsxs44(TableProvider, { ...table, children: [
16549
+ return /* @__PURE__ */ jsx75("div", { ...props, className: clsx27("flex-col-3", props.className), children: /* @__PURE__ */ jsxs44(TableProvider, { ...table, children: [
16536
16550
  header,
16537
16551
  /* @__PURE__ */ jsx75(TableDisplay, { ...displayProps, children }),
16538
16552
  /* @__PURE__ */ jsx75(Visibility, { isVisible: showPagination, children: /* @__PURE__ */ jsx75(TablePagination, { allowChangingPageSize, pageSizeOptions }) }),
@@ -16549,7 +16563,7 @@ var TableWithSelection = ({
16549
16563
  ...props
16550
16564
  }) => {
16551
16565
  const { showPagination = true, allowChangingPageSize, pageSizeOptions } = paginationOptions ?? {};
16552
- return /* @__PURE__ */ jsx75("div", { ...props, className: clsx28("flex-col-3", props.className), children: /* @__PURE__ */ jsxs44(TableWithSelectionProvider, { ...table, children: [
16566
+ return /* @__PURE__ */ jsx75("div", { ...props, className: clsx27("flex-col-3", props.className), children: /* @__PURE__ */ jsxs44(TableWithSelectionProvider, { ...table, children: [
16553
16567
  header,
16554
16568
  /* @__PURE__ */ jsx75(TableDisplay, { ...displayProps, children }),
16555
16569
  /* @__PURE__ */ jsx75(Visibility, { isVisible: showPagination, children: /* @__PURE__ */ jsx75(TablePagination, { allowChangingPageSize, pageSizeOptions }) }),
@@ -16868,7 +16882,7 @@ var TableColumnSwitcher = ({ buttonProps, ...props }) => {
16868
16882
 
16869
16883
  // src/components/user-interaction/CopyToClipboardWrapper.tsx
16870
16884
  import { useState as useState32 } from "react";
16871
- import { clsx as clsx29 } from "clsx";
16885
+ import { clsx as clsx28 } from "clsx";
16872
16886
 
16873
16887
  // src/utils/writeToClipboard.ts
16874
16888
  var writeToClipboard = (text) => {
@@ -16907,7 +16921,7 @@ var CopyToClipboardWrapper = ({
16907
16921
  "div",
16908
16922
  {
16909
16923
  ref: callbackRef,
16910
- className: clsx29("w-fit hover:cursor-copy", containerClassName),
16924
+ className: clsx28("w-fit hover:cursor-copy", containerClassName),
16911
16925
  ...disabled2 ? void 0 : props2,
16912
16926
  onClick: () => {
16913
16927
  if (disabled2) return;
@@ -16940,7 +16954,7 @@ var CopyToClipboardWrapper = ({
16940
16954
 
16941
16955
  // src/components/user-interaction/Menu.tsx
16942
16956
  import { useCallback as useCallback29, useRef as useRef32, useState as useState33 } from "react";
16943
- import clsx30 from "clsx";
16957
+ import clsx29 from "clsx";
16944
16958
  import { Fragment as Fragment11, jsx as jsx79, jsxs as jsxs47 } from "react/jsx-runtime";
16945
16959
  var MenuItem = ({
16946
16960
  children,
@@ -16950,7 +16964,7 @@ var MenuItem = ({
16950
16964
  }) => /* @__PURE__ */ jsx79(
16951
16965
  "div",
16952
16966
  {
16953
- className: clsx30("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
16967
+ className: clsx29("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
16954
16968
  "text-disabled cursor-not-allowed": isDisabled,
16955
16969
  "text-menu-text hover:bg-primary/20": !isDisabled,
16956
16970
  "cursor-pointer": !!onClick
@@ -16997,7 +17011,7 @@ var Menu = ({
16997
17011
 
16998
17012
  // src/components/user-interaction/ScrollPicker.tsx
16999
17013
  import { useCallback as useCallback30, useEffect as useEffect35, useState as useState34 } from "react";
17000
- import clsx31 from "clsx";
17014
+ import clsx30 from "clsx";
17001
17015
  import { jsx as jsx80, jsxs as jsxs48 } from "react/jsx-runtime";
17002
17016
  var up = 1;
17003
17017
  var down = -1;
@@ -17167,7 +17181,7 @@ var ScrollPicker = ({
17167
17181
  children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ jsx80(
17168
17182
  "div",
17169
17183
  {
17170
- className: clsx31(
17184
+ className: clsx30(
17171
17185
  `flex-col-2 items-center justify-center rounded-md`,
17172
17186
  {
17173
17187
  "text-primary font-bold": currentIndex === index,
@@ -17250,7 +17264,7 @@ var Switch = ({
17250
17264
 
17251
17265
  // src/components/user-interaction/Textarea.tsx
17252
17266
  import { forwardRef as forwardRef19, useCallback as useCallback32, useId as useId17 } from "react";
17253
- import clsx32 from "clsx";
17267
+ import clsx31 from "clsx";
17254
17268
  import { jsx as jsx82, jsxs as jsxs49 } from "react/jsx-runtime";
17255
17269
  var Textarea = forwardRef19(function Textarea2({
17256
17270
  value: controlledValue,
@@ -17311,7 +17325,7 @@ var TextareaWithHeadline = ({
17311
17325
  return /* @__PURE__ */ jsxs49(
17312
17326
  "div",
17313
17327
  {
17314
- className: clsx32(
17328
+ className: clsx31(
17315
17329
  "group flex-col-3 border-2 rounded-lg",
17316
17330
  {
17317
17331
  "bg-input-background text-input-text hover:border-primary focus-within:border-primary": !disabled,
@@ -17320,13 +17334,13 @@ var TextareaWithHeadline = ({
17320
17334
  containerClassName
17321
17335
  ),
17322
17336
  children: [
17323
- headline && /* @__PURE__ */ jsx82("label", { ...headlineProps, htmlFor: usedId, className: clsx32("typography-lable-md text-label", headlineProps.className), children: headline }),
17337
+ headline && /* @__PURE__ */ jsx82("label", { ...headlineProps, htmlFor: usedId, className: clsx31("typography-lable-md text-label", headlineProps.className), children: headline }),
17324
17338
  /* @__PURE__ */ jsx82(
17325
17339
  Textarea,
17326
17340
  {
17327
17341
  ...props,
17328
17342
  id: usedId,
17329
- className: clsx32(
17343
+ className: clsx31(
17330
17344
  "border-transparent focus:ring-0 focus-visible:ring-0 resize-none h-32",
17331
17345
  className
17332
17346
  )
@@ -17381,7 +17395,7 @@ var TimeDisplay = ({
17381
17395
  // src/components/user-interaction/input/InsideLabelInput.tsx
17382
17396
  import { useId as useId18 } from "react";
17383
17397
  import { forwardRef as forwardRef20, useState as useState35 } from "react";
17384
- import clsx33 from "clsx";
17398
+ import clsx32 from "clsx";
17385
17399
  import { jsx as jsx84, jsxs as jsxs50 } from "react/jsx-runtime";
17386
17400
  var InsideLabelInput = forwardRef20(function InsideLabelInput2({
17387
17401
  id: customId,
@@ -17399,7 +17413,7 @@ var InsideLabelInput = forwardRef20(function InsideLabelInput2({
17399
17413
  const [isFocused, setIsFocused] = useState35(false);
17400
17414
  const generatedId = useId18();
17401
17415
  const id = customId ?? generatedId;
17402
- return /* @__PURE__ */ jsxs50("div", { className: clsx33("relative"), children: [
17416
+ return /* @__PURE__ */ jsxs50("div", { className: clsx32("relative"), children: [
17403
17417
  /* @__PURE__ */ jsx84(
17404
17418
  Input,
17405
17419
  {
@@ -17417,7 +17431,7 @@ var InsideLabelInput = forwardRef20(function InsideLabelInput2({
17417
17431
  setIsFocused(false);
17418
17432
  },
17419
17433
  "aria-labelledby": id + "-label",
17420
- className: clsx33("h-14 px-4 pb-2 py-6.5", props.className)
17434
+ className: clsx32("h-14 px-4 pb-2 py-6.5", props.className)
17421
17435
  }
17422
17436
  ),
17423
17437
  /* @__PURE__ */ jsx84(
@@ -17426,7 +17440,7 @@ var InsideLabelInput = forwardRef20(function InsideLabelInput2({
17426
17440
  id: id + "-label",
17427
17441
  "aria-hidden": true,
17428
17442
  "data-display": isFocused || !!value ? "small" : "full",
17429
- className: clsx33(
17443
+ className: clsx32(
17430
17444
  // margin left to account for the border which is ignored for absolute positions
17431
17445
  "absolute left-4 ml-0.5 top-2 transition-all delay-25 pointer-events-none touch-none",
17432
17446
  "data-[display=small]:top-2 data-[display=small]:h-force-4.5 data-[display=small]:typography-caption-sm data-[display=small]:overflow-y-hidden",
@@ -17440,7 +17454,7 @@ var InsideLabelInput = forwardRef20(function InsideLabelInput2({
17440
17454
 
17441
17455
  // src/components/user-interaction/input/SearchBar.tsx
17442
17456
  import { Search } from "lucide-react";
17443
- import { clsx as clsx34 } from "clsx";
17457
+ import { clsx as clsx33 } from "clsx";
17444
17458
  import { jsx as jsx85, jsxs as jsxs51 } from "react/jsx-runtime";
17445
17459
  var SearchBar = ({
17446
17460
  value: controlledValue,
@@ -17457,7 +17471,7 @@ var SearchBar = ({
17457
17471
  onValueChange,
17458
17472
  defaultValue: initialValue
17459
17473
  });
17460
- return /* @__PURE__ */ jsxs51("div", { ...containerProps, className: clsx34("relative", containerProps?.className), children: [
17474
+ return /* @__PURE__ */ jsxs51("div", { ...containerProps, className: clsx33("relative", containerProps?.className), children: [
17461
17475
  /* @__PURE__ */ jsx85(
17462
17476
  Input,
17463
17477
  {
@@ -17466,7 +17480,7 @@ var SearchBar = ({
17466
17480
  onValueChange: setValue,
17467
17481
  onEditComplete: onSearch,
17468
17482
  placeholder: inputProps.placeholder ?? translation("search"),
17469
- className: clsx34("pr-10 w-full", inputProps.className)
17483
+ className: clsx33("pr-10 w-full", inputProps.className)
17470
17484
  }
17471
17485
  ),
17472
17486
  /* @__PURE__ */ jsx85(
@@ -17478,7 +17492,7 @@ var SearchBar = ({
17478
17492
  color: "neutral",
17479
17493
  coloringStyle: "text",
17480
17494
  onClick: () => onSearch(value),
17481
- className: clsx34("absolute right-1.5 top-1/2 -translate-y-1/2", searchButtonProps?.className),
17495
+ className: clsx33("absolute right-1.5 top-1/2 -translate-y-1/2", searchButtonProps?.className),
17482
17496
  children: /* @__PURE__ */ jsx85(Search, { className: "w-full h-full" })
17483
17497
  }
17484
17498
  )
@@ -17488,7 +17502,7 @@ var SearchBar = ({
17488
17502
  // src/components/user-interaction/input/ToggleableInput.tsx
17489
17503
  import { forwardRef as forwardRef21, useEffect as useEffect36, useImperativeHandle as useImperativeHandle12, useRef as useRef33, useState as useState36 } from "react";
17490
17504
  import { Pencil } from "lucide-react";
17491
- import clsx35 from "clsx";
17505
+ import clsx34 from "clsx";
17492
17506
  import { jsx as jsx86, jsxs as jsxs52 } from "react/jsx-runtime";
17493
17507
  var ToggleableInput = forwardRef21(function ToggleableInput2({
17494
17508
  value: controlledValue,
@@ -17511,7 +17525,7 @@ var ToggleableInput = forwardRef21(function ToggleableInput2({
17511
17525
  innerRef.current?.focus();
17512
17526
  }
17513
17527
  }, [isEditing]);
17514
- return /* @__PURE__ */ jsxs52("div", { className: clsx35("relative flex-row-2", { "flex-1": isEditing }), children: [
17528
+ return /* @__PURE__ */ jsxs52("div", { className: clsx34("relative flex-row-2", { "flex-1": isEditing }), children: [
17515
17529
  /* @__PURE__ */ jsx86(
17516
17530
  Input,
17517
17531
  {
@@ -17537,8 +17551,8 @@ var ToggleableInput = forwardRef21(function ToggleableInput2({
17537
17551
  }
17538
17552
  ),
17539
17553
  !isEditing && /* @__PURE__ */ jsxs52("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
17540
- /* @__PURE__ */ jsx86("span", { className: clsx35(" truncate"), children: value }),
17541
- /* @__PURE__ */ jsx86(Pencil, { className: clsx35(`size-force-4`, { "text-transparent": isEditing }) })
17554
+ /* @__PURE__ */ jsx86("span", { className: clsx34(" truncate"), children: value }),
17555
+ /* @__PURE__ */ jsx86(Pencil, { className: clsx34(`size-force-4`, { "text-transparent": isEditing }) })
17542
17556
  ] })
17543
17557
  ] });
17544
17558
  });
@@ -17547,7 +17561,7 @@ var ToggleableInput = forwardRef21(function ToggleableInput2({
17547
17561
  import { Check as Check3 } from "lucide-react";
17548
17562
 
17549
17563
  // src/components/user-interaction/properties/PropertyBase.tsx
17550
- import clsx36 from "clsx";
17564
+ import clsx35 from "clsx";
17551
17565
  import { AlertTriangle, Trash, X as X3 } from "lucide-react";
17552
17566
  import { jsx as jsx87, jsxs as jsxs53 } from "react/jsx-runtime";
17553
17567
  var PropertyBase = ({
@@ -17571,7 +17585,7 @@ var PropertyBase = ({
17571
17585
  return /* @__PURE__ */ jsxs53(
17572
17586
  "div",
17573
17587
  {
17574
- className: clsx36("group/property", className),
17588
+ className: clsx35("group/property", className),
17575
17589
  "data-name": "property-root",
17576
17590
  "data-invalid": PropsUtil.dataAttributes.bool(invalid),
17577
17591
  children: [
@@ -18296,6 +18310,53 @@ var useSearch = ({
18296
18310
  };
18297
18311
  };
18298
18312
 
18313
+ // src/hooks/useUpdatingDateString.ts
18314
+ import { useEffect as useEffect45, useState as useState41 } from "react";
18315
+ var UseUpdatingDateString = ({ absoluteFormat = "dateTime", localeOverride, date }) => {
18316
+ const { locale: contextLocale } = useLocale();
18317
+ const locale = localeOverride ?? contextLocale;
18318
+ const [dateAndTimeStrings, setDateAndTimeStrings] = useState41({
18319
+ compareDate: date,
18320
+ absolute: DateUtils.formatAbsolute(date, locale, absoluteFormat),
18321
+ relative: DateUtils.formatRelative(date, locale)
18322
+ });
18323
+ useEffect45(() => {
18324
+ setDateAndTimeStrings({
18325
+ compareDate: date,
18326
+ absolute: DateUtils.formatAbsolute(date, locale, absoluteFormat),
18327
+ relative: DateUtils.formatRelative(date, locale)
18328
+ });
18329
+ }, [date, absoluteFormat, locale]);
18330
+ useEffect45(() => {
18331
+ let timeoutId;
18332
+ const startTimer = () => {
18333
+ const now = /* @__PURE__ */ new Date();
18334
+ const diff = Math.abs((date.getTime() - now.getTime()) / 1e3);
18335
+ let delayInSeconds;
18336
+ if (diff < DateUtils.timesInSeconds.minute) {
18337
+ delayInSeconds = DateUtils.timesInSeconds.second;
18338
+ } else if (diff < DateUtils.timesInSeconds.hour) {
18339
+ delayInSeconds = DateUtils.timesInSeconds.minute;
18340
+ } else {
18341
+ delayInSeconds = DateUtils.timesInSeconds.hour;
18342
+ }
18343
+ timeoutId = setInterval(() => {
18344
+ setDateAndTimeStrings({
18345
+ compareDate: date,
18346
+ absolute: DateUtils.formatAbsolute(date, locale, absoluteFormat),
18347
+ relative: DateUtils.formatRelative(date, locale)
18348
+ });
18349
+ }, delayInSeconds * 1e3 / 2);
18350
+ };
18351
+ startTimer();
18352
+ return () => clearInterval(timeoutId);
18353
+ }, [absoluteFormat, date, locale]);
18354
+ return {
18355
+ absolute: dateAndTimeStrings.absolute,
18356
+ relative: dateAndTimeStrings.relative
18357
+ };
18358
+ };
18359
+
18299
18360
  // src/utils/emailValidation.ts
18300
18361
  var validateEmail = (email) => {
18301
18362
  return /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(email);
@@ -18786,13 +18847,12 @@ export {
18786
18847
  TooltipRoot,
18787
18848
  TooltipTrigger,
18788
18849
  Transition,
18850
+ UseUpdatingDateString,
18789
18851
  UseValidators,
18790
18852
  VerticalDivider,
18791
18853
  Visibility,
18792
18854
  YearMonthPicker,
18793
- addDuration,
18794
18855
  builder,
18795
- changeDuration,
18796
18856
  closestMatch,
18797
18857
  createLoopingList,
18798
18858
  createLoopingListWithIndex,
@@ -18805,21 +18865,15 @@ export {
18805
18865
  filterTags,
18806
18866
  filterTagsSingle,
18807
18867
  filterText,
18808
- formatDate,
18809
- formatDateTime,
18810
- getBetweenDuration,
18811
18868
  getNeighbours,
18812
- getWeeksForCalenderMonth,
18813
18869
  hightideTranslation,
18814
18870
  hightideTranslationLocales,
18815
- isInTimeSpan,
18816
18871
  isTableFilterCategory,
18817
18872
  match,
18818
18873
  mergeProps,
18819
18874
  noop,
18820
18875
  range,
18821
18876
  resolveSetState,
18822
- subtractDuration,
18823
18877
  toSizeVars,
18824
18878
  useAnchoredPosition,
18825
18879
  useControlledState,