@helpwave/hightide 0.4.0 → 0.5.1

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
@@ -6489,10 +6489,6 @@ var formatDateTime = (date) => {
6489
6489
  const minutes = date.getMinutes().toString().padStart(2, "0");
6490
6490
  return `${dateString}T${hours}:${minutes}`;
6491
6491
  };
6492
- var getDaysInMonth = (year, month) => {
6493
- const lastDayOfMonth = new Date(year, month + 1, 0);
6494
- return lastDayOfMonth.getDate();
6495
- };
6496
6492
  var changeDuration = (date, duration, isAdding) => {
6497
6493
  const {
6498
6494
  years = 0,
@@ -6602,6 +6598,51 @@ var getWeeksForCalenderMonth = (date, weekStart, weeks = 6) => {
6602
6598
  }
6603
6599
  return equalSizeGroups(dayList, 7);
6604
6600
  };
6601
+ var formatGerman = (date, showTime) => {
6602
+ const d = new Intl.DateTimeFormat("de-DE", {
6603
+ day: "2-digit",
6604
+ month: "2-digit",
6605
+ year: "numeric"
6606
+ }).format(date);
6607
+ if (!showTime) return d;
6608
+ const t = new Intl.DateTimeFormat("de-DE", {
6609
+ hour: "2-digit",
6610
+ minute: "2-digit"
6611
+ }).format(date);
6612
+ return `${d} um ${t} Uhr`;
6613
+ };
6614
+ var formatAbsolute = (date, locale, showTime) => {
6615
+ if (locale === "de-DE") {
6616
+ return formatGerman(date, showTime);
6617
+ }
6618
+ const options = {
6619
+ year: "numeric",
6620
+ month: "numeric",
6621
+ day: "numeric"
6622
+ };
6623
+ if (showTime) {
6624
+ options.hour = "numeric";
6625
+ options.minute = "numeric";
6626
+ }
6627
+ return new Intl.DateTimeFormat(locale, options).format(date);
6628
+ };
6629
+ var formatRelative = (date, locale, showTime) => {
6630
+ const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
6631
+ const now = /* @__PURE__ */ new Date();
6632
+ const diffInSeconds = (date.getTime() - now.getTime()) / 1e3;
6633
+ if (Math.abs(diffInSeconds) < 60) return rtf.format(Math.round(diffInSeconds), "second");
6634
+ if (Math.abs(diffInSeconds) < 3600) return rtf.format(Math.round(diffInSeconds / 60), "minute");
6635
+ if (Math.abs(diffInSeconds) < 86400) return rtf.format(Math.round(diffInSeconds / 3600), "hour");
6636
+ if (Math.abs(diffInSeconds) < 604800) return rtf.format(Math.round(diffInSeconds / 86400), "day");
6637
+ return formatAbsolute(date, locale, showTime);
6638
+ };
6639
+ var DateUtils = {
6640
+ monthsList,
6641
+ weekDayList,
6642
+ equalDate,
6643
+ formatAbsolute,
6644
+ formatRelative
6645
+ };
6605
6646
 
6606
6647
  // src/components/date/DatePicker.tsx
6607
6648
  import clsx7 from "clsx";
@@ -6784,6 +6825,16 @@ var hightideTranslation = {
6784
6825
  "remove": `Entfernen`,
6785
6826
  "required": `Erforderlich`,
6786
6827
  "reset": `Zur\xFCcksetzen`,
6828
+ "rSortingOrderAfter": ({ otherSortings }) => {
6829
+ let _out = "";
6830
+ _out += `Angewendet `;
6831
+ _out += TranslationGen.resolvePlural(otherSortings, {
6832
+ "=0": `als prim\xE4re Sortierung`,
6833
+ "=1": `nach ${otherSortings} anderen Sortierung`,
6834
+ "other": `nach ${otherSortings} anderen Sortierungen`
6835
+ });
6836
+ return _out;
6837
+ },
6787
6838
  "save": `Speichern`,
6788
6839
  "saved": `Gespeichert`,
6789
6840
  "search": `Suche`,
@@ -7020,6 +7071,16 @@ var hightideTranslation = {
7020
7071
  "remove": `Remove`,
7021
7072
  "required": `Required`,
7022
7073
  "reset": `Reset`,
7074
+ "rSortingOrderAfter": ({ otherSortings }) => {
7075
+ let _out = "";
7076
+ _out += `Applied `;
7077
+ _out += TranslationGen.resolvePlural(otherSortings, {
7078
+ "=0": `as the first sorting`,
7079
+ "=1": `after ${otherSortings} other sorting`,
7080
+ "other": `after ${otherSortings} other sortings`
7081
+ });
7082
+ return _out;
7083
+ },
7023
7084
  "save": `Save`,
7024
7085
  "saved": `Saved`,
7025
7086
  "search": `Search`,
@@ -7318,6 +7379,7 @@ var Button = forwardRef(function SolidButton({
7318
7379
  startIcon,
7319
7380
  endIcon,
7320
7381
  disabled,
7382
+ allowClickEventPropagation = false,
7321
7383
  className,
7322
7384
  ...restProps
7323
7385
  }, ref) {
@@ -7340,6 +7402,12 @@ var Button = forwardRef(function SolidButton({
7340
7402
  paddingMapping[layout][size],
7341
7403
  className
7342
7404
  ),
7405
+ onClick: (event) => {
7406
+ if (!allowClickEventPropagation) {
7407
+ event.stopPropagation();
7408
+ }
7409
+ restProps?.onClick(event);
7410
+ },
7343
7411
  disabled,
7344
7412
  children: [
7345
7413
  startIcon,
@@ -7368,8 +7436,8 @@ var DayPicker = ({
7368
7436
  return /* @__PURE__ */ jsxs4("div", { className: clsx4("flex-col-1 min-w-[220px] select-none", className), children: [
7369
7437
  /* @__PURE__ */ jsx4("div", { className: "flex-row-2 text-center", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ jsx4("div", { className: "flex-1 font-semibold", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
7370
7438
  weeks.map((week, index) => /* @__PURE__ */ jsx4("div", { className: "flex-row-2 text-center", children: week.map((date) => {
7371
- const isSelected = !!selected && equalDate(selected, date);
7372
- const isToday = equalDate(/* @__PURE__ */ new Date(), date);
7439
+ const isSelected = !!selected && DateUtils.equalDate(selected, date);
7440
+ const isToday = DateUtils.equalDate(/* @__PURE__ */ new Date(), date);
7373
7441
  const isSameMonth = date.getMonth() === month;
7374
7442
  const isDayValid = isInTimeSpan(date, start, end);
7375
7443
  return /* @__PURE__ */ jsx4(
@@ -7569,8 +7637,9 @@ var YearMonthPicker = ({
7569
7637
  label: /* @__PURE__ */ jsx6("span", { className: clsx6({ "text-primary font-bold": selectedYear }), children: year }),
7570
7638
  isExpanded: showValueOpen && selectedYear,
7571
7639
  contentClassName: "gap-y-1",
7572
- children: equalSizeGroups([...monthsList], 3).map((monthList, index) => /* @__PURE__ */ jsx6("div", { className: "flex-row-1", children: monthList.map((month) => {
7573
- const monthIndex = monthsList.indexOf(month);
7640
+ contentExpandedClassName: "!p-2",
7641
+ children: equalSizeGroups([...DateUtils.monthsList], 3).map((monthList, index) => /* @__PURE__ */ jsx6("div", { className: "flex-row-1", children: monthList.map((month) => {
7642
+ const monthIndex = DateUtils.monthsList.indexOf(month);
7574
7643
  const newDate = new Date(year, monthIndex);
7575
7644
  const selectedMonth = selectedYear && monthIndex === displayedYearMonth.getMonth();
7576
7645
  const firstOfMonth = new Date(year, monthIndex, 1);
@@ -7869,7 +7938,7 @@ var TimePicker = ({
7869
7938
  transformer(newDate);
7870
7939
  onChange?.(newDate);
7871
7940
  };
7872
- return /* @__PURE__ */ jsxs7("div", { className: clsx8("flex-row-2 w-fit min-w-[150px] select-none overflow-hidden", className), children: [
7941
+ return /* @__PURE__ */ jsxs7("div", { className: clsx8("flex-row-2 select-none overflow-hidden", className), children: [
7873
7942
  /* @__PURE__ */ jsx9("div", { className: "flex-col-1 h-full overflow-y-auto min-w-16", children: hours.map((hour) => {
7874
7943
  const isSelected = hour === time.getHours() - (!is24HourFormat && isPM ? 12 : 0);
7875
7944
  return /* @__PURE__ */ jsx9(
@@ -10219,7 +10288,9 @@ function CarouselTabs({
10219
10288
  "button",
10220
10289
  {
10221
10290
  id: `${id}-tab-${index}`,
10222
- ref: (el) => tabRefs.current[index] = el,
10291
+ ref: (el) => {
10292
+ tabRefs.current[index] = el;
10293
+ },
10223
10294
  onClick: () => onChange(index),
10224
10295
  onKeyDown: (e) => handleKeyDown(e, index),
10225
10296
  className: clsx19(
@@ -11165,7 +11236,9 @@ function TabView({ children, outerDivProps, onTabChanged, initialTabIndex = 0, .
11165
11236
  "aria-controls": `${t.id}-panel`,
11166
11237
  id: `${t.id}-tab`,
11167
11238
  tabIndex: active === t.id ? 0 : -1,
11168
- ref: (el) => buttonRefs.current[t.id] = el,
11239
+ ref: (el) => {
11240
+ buttonRefs.current[t.id] = el;
11241
+ },
11169
11242
  onClick: () => setActive(t.id),
11170
11243
  onKeyDown: (e) => onKeyDown(e, t.id),
11171
11244
  className: clsx24(
@@ -11304,6 +11377,14 @@ var VerticalDivider = ({
11304
11377
  ) });
11305
11378
  };
11306
11379
 
11380
+ // src/components/layout/Visibility.tsx
11381
+ function Visibility({ children, isVisible }) {
11382
+ if (isVisible) {
11383
+ return children;
11384
+ }
11385
+ return void 0;
11386
+ }
11387
+
11307
11388
  // src/components/loading-states/ErrorComponent.tsx
11308
11389
  import { AlertOctagon } from "lucide-react";
11309
11390
  import clsx26 from "clsx";
@@ -11485,7 +11566,7 @@ var NavigationItemWithSubItem = ({
11485
11566
  ...options
11486
11567
  }) => {
11487
11568
  const [isOpen, setOpen] = useState21(false);
11488
- const containerRef = useRef11();
11569
+ const containerRef = useRef11(null);
11489
11570
  const triggerRef = useRef11(null);
11490
11571
  const id = useId8();
11491
11572
  const style = useFloatingElement({
@@ -12399,8 +12480,8 @@ var TableFilters = {
12399
12480
  };
12400
12481
 
12401
12482
  // src/components/table/Table.tsx
12402
- import { useCallback as useCallback12, useEffect as useEffect27, useMemo as useMemo7, useRef as useRef13, useState as useState26 } from "react";
12403
- import clsx47 from "clsx";
12483
+ import { useCallback as useCallback12, useEffect as useEffect27, useMemo as useMemo7, useRef as useRef14, useState as useState27 } from "react";
12484
+ import clsx48 from "clsx";
12404
12485
  import {
12405
12486
  flexRender,
12406
12487
  getCoreRowModel,
@@ -12433,43 +12514,195 @@ var useResizeCallbackWrapper = (callback) => {
12433
12514
 
12434
12515
  // src/components/table/TableSortButton.tsx
12435
12516
  import { ChevronDown as ChevronDown3, ChevronsUpDown, ChevronUp } from "lucide-react";
12436
- import clsx45 from "clsx";
12437
- import { jsx as jsx56 } from "react/jsx-runtime";
12517
+ import clsx46 from "clsx";
12518
+
12519
+ // src/components/user-action/Tooltip.tsx
12520
+ import { useRef as useRef12, useState as useState23 } from "react";
12521
+ import { clsx as clsx45 } from "clsx";
12522
+ import { createPortal as createPortal4 } from "react-dom";
12523
+ import { jsx as jsx56, jsxs as jsxs35 } from "react/jsx-runtime";
12524
+ var Tooltip = ({
12525
+ tooltip,
12526
+ children,
12527
+ appearDelay = 400,
12528
+ disappearDelay = 50,
12529
+ tooltipClassName = "",
12530
+ containerClassName = "",
12531
+ position = "bottom",
12532
+ disabled = false
12533
+ }) => {
12534
+ const [state, setState] = useState23({
12535
+ isShown: false,
12536
+ timer: null
12537
+ });
12538
+ const { isShown } = state;
12539
+ const anchorRef = useRef12(null);
12540
+ const containerRef = useRef12(null);
12541
+ const triangleRef = useRef12(null);
12542
+ const triangleSize = 0.375;
12543
+ const triangleClasses = {
12544
+ top: `border-t-tooltip-background border-l-transparent border-r-transparent`,
12545
+ bottom: `border-b-tooltip-background border-l-transparent border-r-transparent`,
12546
+ left: `border-l-tooltip-background border-t-transparent border-b-transparent`,
12547
+ right: `border-r-tooltip-background border-t-transparent border-b-transparent`
12548
+ };
12549
+ const triangleStyle = {
12550
+ top: {
12551
+ borderWidth: `${triangleSize}rem ${triangleSize}rem 0 ${triangleSize}rem`,
12552
+ transform: `translate(0,${triangleSize}rem)`
12553
+ },
12554
+ bottom: {
12555
+ borderWidth: `0 ${triangleSize}rem ${triangleSize}rem ${triangleSize}rem`,
12556
+ transform: `translate(0,-${triangleSize}rem)`
12557
+ },
12558
+ left: {
12559
+ borderWidth: `${triangleSize}rem 0 ${triangleSize}rem ${triangleSize}rem`,
12560
+ transform: `translate(${triangleSize}rem,0)`
12561
+ },
12562
+ right: {
12563
+ borderWidth: `${triangleSize}rem ${triangleSize}rem ${triangleSize}rem 0`,
12564
+ transform: `translate(-${triangleSize}rem,0)`
12565
+ }
12566
+ };
12567
+ const isActive = !disabled && isShown;
12568
+ const css = useFloatingElement({
12569
+ active: isActive,
12570
+ anchorRef,
12571
+ containerRef,
12572
+ horizontalAlignment: position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
12573
+ verticalAlignment: position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center"
12574
+ });
12575
+ const cssTriangle = useFloatingElement({
12576
+ active: isActive,
12577
+ anchorRef,
12578
+ containerRef: triangleRef,
12579
+ horizontalAlignment: position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
12580
+ verticalAlignment: position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center"
12581
+ });
12582
+ const zIndex = useZIndexRegister(isActive);
12583
+ const zIndexTriangle = useZIndexRegister(isActive);
12584
+ return /* @__PURE__ */ jsxs35(
12585
+ "div",
12586
+ {
12587
+ ref: anchorRef,
12588
+ className: clsx45("relative inline-block", containerClassName),
12589
+ onPointerEnter: () => setState((prevState) => {
12590
+ if (prevState.isShown) {
12591
+ return prevState;
12592
+ }
12593
+ return {
12594
+ ...prevState,
12595
+ timer: setTimeout(() => {
12596
+ setState((prevState2) => {
12597
+ clearTimeout(prevState2.timer);
12598
+ return { isShown: true, timer: null };
12599
+ });
12600
+ }, appearDelay)
12601
+ };
12602
+ }),
12603
+ onPointerLeave: () => setState((prevState) => {
12604
+ clearTimeout(prevState.timer);
12605
+ return {
12606
+ ...prevState,
12607
+ timer: setTimeout(() => {
12608
+ setState((prevState2) => {
12609
+ clearTimeout(prevState2.timer);
12610
+ return { isShown: false, timer: null };
12611
+ });
12612
+ }, disappearDelay)
12613
+ };
12614
+ }),
12615
+ children: [
12616
+ children,
12617
+ /* @__PURE__ */ jsxs35(Visibility, { isVisible: isActive, children: [
12618
+ createPortal4(
12619
+ /* @__PURE__ */ jsx56(
12620
+ "div",
12621
+ {
12622
+ ref: containerRef,
12623
+ className: clsx45(
12624
+ `opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded
12625
+ animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
12626
+ tooltipClassName
12627
+ ),
12628
+ style: { ...css, zIndex, animationDelay: appearDelay + "ms" },
12629
+ children: tooltip
12630
+ }
12631
+ ),
12632
+ document.body
12633
+ ),
12634
+ createPortal4(
12635
+ /* @__PURE__ */ jsx56(
12636
+ "div",
12637
+ {
12638
+ ref: triangleRef,
12639
+ className: clsx45(`absolute w-0 h-0 opacity-0 animate-tooltip-fade-in`, triangleClasses[position]),
12640
+ style: {
12641
+ ...cssTriangle,
12642
+ ...triangleStyle[position],
12643
+ zIndex: zIndexTriangle,
12644
+ animationDelay: appearDelay + "ms"
12645
+ }
12646
+ }
12647
+ ),
12648
+ document.body
12649
+ )
12650
+ ] })
12651
+ ]
12652
+ }
12653
+ );
12654
+ };
12655
+
12656
+ // src/components/table/TableSortButton.tsx
12657
+ import { jsx as jsx57, jsxs as jsxs36 } from "react/jsx-runtime";
12438
12658
  var TableSortButton = ({
12439
12659
  sortDirection,
12440
12660
  invert = false,
12441
12661
  color = "neutral",
12442
12662
  size = "tiny",
12443
12663
  className,
12444
- ...buttonProps
12664
+ sortingIndexDisplay,
12665
+ ...props
12445
12666
  }) => {
12446
- let icon = /* @__PURE__ */ jsx56(ChevronsUpDown, { className: "w-full h-full" });
12667
+ const translation = useHightideTranslation();
12668
+ const { sortingsCount, index } = sortingIndexDisplay;
12669
+ let icon = /* @__PURE__ */ jsx57(ChevronsUpDown, { className: "size-4" });
12447
12670
  if (sortDirection) {
12448
12671
  let usedSortDirection = sortDirection;
12449
12672
  if (invert) {
12450
12673
  usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
12451
12674
  }
12452
- icon = usedSortDirection === "asc" ? /* @__PURE__ */ jsx56(ChevronUp, { className: "w-full h-full" }) : /* @__PURE__ */ jsx56(ChevronDown3, { className: "w-full h-full" });
12675
+ icon = usedSortDirection === "asc" ? /* @__PURE__ */ jsx57(ChevronUp, { className: "size-4" }) : /* @__PURE__ */ jsx57(ChevronDown3, { className: "size-4" });
12453
12676
  }
12454
- return /* @__PURE__ */ jsx56(
12677
+ const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
12678
+ return /* @__PURE__ */ jsx57(Tooltip, { tooltip: translation("rSortingOrderAfter", { otherSortings: index - 1 }), disabled: !hasSortingIndex, children: /* @__PURE__ */ jsxs36(
12455
12679
  Button,
12456
12680
  {
12457
- layout: "icon",
12681
+ layout: hasSortingIndex ? "default" : "icon",
12458
12682
  color,
12459
12683
  size,
12460
- className: clsx45(className),
12461
- ...buttonProps,
12462
- children: icon
12684
+ className: clsx46("relative", className),
12685
+ ...props,
12686
+ children: [
12687
+ /* @__PURE__ */ jsx57(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ jsx57(
12688
+ "div",
12689
+ {
12690
+ className: clsx46("absolute bottom-0 right-1/2 translate-x-1/2 translate-y-2/3 z-1 primary coloring-solid rounded-full h-4 w-5 text-sm"),
12691
+ children: `${index}.`
12692
+ }
12693
+ ) }),
12694
+ icon
12695
+ ]
12463
12696
  }
12464
- );
12697
+ ) });
12465
12698
  };
12466
12699
 
12467
12700
  // src/components/table/TableFilterButton.tsx
12468
12701
  import { FilterIcon } from "lucide-react";
12469
12702
 
12470
12703
  // src/components/user-action/Menu.tsx
12471
- import { useEffect as useEffect25, useRef as useRef12, useState as useState24 } from "react";
12472
- import clsx46 from "clsx";
12704
+ import { useEffect as useEffect25, useRef as useRef13, useState as useState25 } from "react";
12705
+ import clsx47 from "clsx";
12473
12706
 
12474
12707
  // src/utils/bagFunctions.ts
12475
12708
  var resolve = (children, bag) => {
@@ -12483,7 +12716,7 @@ var BagFunctionUtil = {
12483
12716
  };
12484
12717
 
12485
12718
  // src/components/user-action/Menu.tsx
12486
- import { createPortal as createPortal4 } from "react-dom";
12719
+ import { createPortal as createPortal5 } from "react-dom";
12487
12720
 
12488
12721
  // src/hooks/usePopoverPosition.ts
12489
12722
  var defaultPopoverPositionOptions = {
@@ -12540,15 +12773,15 @@ var usePopoverPosition = (trigger, options) => {
12540
12773
  };
12541
12774
 
12542
12775
  // src/hooks/useHoverState.ts
12543
- import { useEffect as useEffect23, useState as useState23 } from "react";
12776
+ import { useEffect as useEffect23, useState as useState24 } from "react";
12544
12777
  var defaultUseHoverStateProps = {
12545
12778
  closingDelay: 200,
12546
12779
  isDisabled: false
12547
12780
  };
12548
12781
  var useHoverState = (props = void 0) => {
12549
12782
  const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
12550
- const [isHovered, setIsHovered] = useState23(false);
12551
- const [timer, setTimer] = useState23();
12783
+ const [isHovered, setIsHovered] = useState24(false);
12784
+ const [timer, setTimer] = useState24();
12552
12785
  const onMouseEnter = () => {
12553
12786
  if (isDisabled) {
12554
12787
  return;
@@ -12604,17 +12837,17 @@ var useOutsideClick = (refs, handler) => {
12604
12837
  };
12605
12838
 
12606
12839
  // src/components/user-action/Menu.tsx
12607
- import { Fragment as Fragment6, jsx as jsx57, jsxs as jsxs35 } from "react/jsx-runtime";
12840
+ import { Fragment as Fragment6, jsx as jsx58, jsxs as jsxs37 } from "react/jsx-runtime";
12608
12841
  var MenuItem = ({
12609
12842
  children,
12610
12843
  onClick,
12611
12844
  alignment = "left",
12612
12845
  isDisabled = false,
12613
12846
  className
12614
- }) => /* @__PURE__ */ jsx57(
12847
+ }) => /* @__PURE__ */ jsx58(
12615
12848
  "div",
12616
12849
  {
12617
- className: clsx46("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
12850
+ className: clsx47("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
12618
12851
  "text-right": alignment === "right",
12619
12852
  "text-left": alignment === "left",
12620
12853
  "text-disabled cursor-not-allowed": isDisabled,
@@ -12644,10 +12877,10 @@ var Menu = ({
12644
12877
  menuClassName = ""
12645
12878
  }) => {
12646
12879
  const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
12647
- const triggerRef = useRef12(null);
12648
- const menuRef = useRef12(null);
12880
+ const triggerRef = useRef13(null);
12881
+ const menuRef = useRef13(null);
12649
12882
  useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
12650
- const [isHidden, setIsHidden] = useState24(true);
12883
+ const [isHidden, setIsHidden] = useState25(true);
12651
12884
  const bag = {
12652
12885
  isOpen,
12653
12886
  close: () => setIsOpen(false),
@@ -12681,14 +12914,14 @@ var Menu = ({
12681
12914
  }
12682
12915
  }, [isOpen]);
12683
12916
  const zIndex = useZIndexRegister(isOpen);
12684
- return /* @__PURE__ */ jsxs35(Fragment6, { children: [
12917
+ return /* @__PURE__ */ jsxs37(Fragment6, { children: [
12685
12918
  trigger(bag, triggerRef),
12686
- createPortal4(/* @__PURE__ */ jsx57(
12919
+ createPortal5(/* @__PURE__ */ jsx58(
12687
12920
  "div",
12688
12921
  {
12689
12922
  ref: menuRef,
12690
12923
  onClick: (e) => e.stopPropagation(),
12691
- className: clsx46(
12924
+ className: clsx47(
12692
12925
  "absolute rounded-md bg-menu-background text-menu-text shadow-around-lg shadow-strong z-[300]",
12693
12926
  {
12694
12927
  "animate-pop-in": isOpen,
@@ -12713,34 +12946,34 @@ var Menu = ({
12713
12946
  };
12714
12947
 
12715
12948
  // src/components/table/TableFilterButton.tsx
12716
- import { useEffect as useEffect26, useState as useState25 } from "react";
12717
- import { Fragment as Fragment7, jsx as jsx58, jsxs as jsxs36 } from "react/jsx-runtime";
12949
+ import { useEffect as useEffect26, useState as useState26 } from "react";
12950
+ import { Fragment as Fragment7, jsx as jsx59, jsxs as jsxs38 } from "react/jsx-runtime";
12718
12951
  var TableFilterButton = ({
12719
12952
  filterType,
12720
12953
  column
12721
12954
  }) => {
12722
12955
  const translation = useHightideTranslation();
12723
12956
  const columnFilterValue = column.getFilterValue();
12724
- const [filterValue, setFilterValue] = useState25(columnFilterValue);
12957
+ const [filterValue, setFilterValue] = useState26(columnFilterValue);
12725
12958
  const hasFilter = !!filterValue;
12726
12959
  useEffect26(() => {
12727
12960
  setFilterValue(columnFilterValue);
12728
12961
  }, [columnFilterValue]);
12729
- return /* @__PURE__ */ jsx58(
12962
+ return /* @__PURE__ */ jsx59(
12730
12963
  Menu,
12731
12964
  {
12732
- trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ jsxs36("div", { ref, className: "relative", children: [
12733
- /* @__PURE__ */ jsx58(
12965
+ trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ jsxs38("div", { ref, className: "relative", children: [
12966
+ /* @__PURE__ */ jsx59(
12734
12967
  Button,
12735
12968
  {
12736
12969
  layout: "icon",
12737
12970
  color: "neutral",
12738
12971
  size: "tiny",
12739
12972
  onClick: toggleOpen,
12740
- children: /* @__PURE__ */ jsx58(FilterIcon, {})
12973
+ children: /* @__PURE__ */ jsx59(FilterIcon, { className: "size-4" })
12741
12974
  }
12742
12975
  ),
12743
- hasFilter && /* @__PURE__ */ jsx58(
12976
+ hasFilter && /* @__PURE__ */ jsx59(
12744
12977
  "div",
12745
12978
  {
12746
12979
  className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
@@ -12748,9 +12981,9 @@ var TableFilterButton = ({
12748
12981
  }
12749
12982
  )
12750
12983
  ] }),
12751
- children: ({ close }) => /* @__PURE__ */ jsxs36("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
12752
- /* @__PURE__ */ jsx58("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
12753
- filterType === "text" && /* @__PURE__ */ jsx58(
12984
+ children: ({ close }) => /* @__PURE__ */ jsxs38("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
12985
+ /* @__PURE__ */ jsx59("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
12986
+ filterType === "text" && /* @__PURE__ */ jsx59(
12754
12987
  Input,
12755
12988
  {
12756
12989
  value: filterValue ?? "",
@@ -12760,8 +12993,8 @@ var TableFilterButton = ({
12760
12993
  className: "h-10"
12761
12994
  }
12762
12995
  ),
12763
- filterType === "range" && /* @__PURE__ */ jsxs36("div", { className: "flex-row-2 items-center", children: [
12764
- /* @__PURE__ */ jsx58(
12996
+ filterType === "range" && /* @__PURE__ */ jsxs38("div", { className: "flex-row-2 items-center", children: [
12997
+ /* @__PURE__ */ jsx59(
12765
12998
  Input,
12766
12999
  {
12767
13000
  value: filterValue?.[0] ?? "",
@@ -12774,8 +13007,8 @@ var TableFilterButton = ({
12774
13007
  className: "h-10 input-indicator-hidden w-40"
12775
13008
  }
12776
13009
  ),
12777
- /* @__PURE__ */ jsx58("span", { className: "font-bold", children: "-" }),
12778
- /* @__PURE__ */ jsx58(
13010
+ /* @__PURE__ */ jsx59("span", { className: "font-bold", children: "-" }),
13011
+ /* @__PURE__ */ jsx59(
12779
13012
  Input,
12780
13013
  {
12781
13014
  value: filterValue?.[1] ?? "",
@@ -12789,8 +13022,8 @@ var TableFilterButton = ({
12789
13022
  }
12790
13023
  )
12791
13024
  ] }),
12792
- filterType === "dateRange" && /* @__PURE__ */ jsxs36(Fragment7, { children: [
12793
- /* @__PURE__ */ jsx58(
13025
+ filterType === "dateRange" && /* @__PURE__ */ jsxs38(Fragment7, { children: [
13026
+ /* @__PURE__ */ jsx59(
12794
13027
  Input,
12795
13028
  {
12796
13029
  value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
@@ -12803,7 +13036,7 @@ var TableFilterButton = ({
12803
13036
  className: "h-10 w-50"
12804
13037
  }
12805
13038
  ),
12806
- /* @__PURE__ */ jsx58(
13039
+ /* @__PURE__ */ jsx59(
12807
13040
  Input,
12808
13041
  {
12809
13042
  value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
@@ -12817,12 +13050,12 @@ var TableFilterButton = ({
12817
13050
  }
12818
13051
  )
12819
13052
  ] }),
12820
- /* @__PURE__ */ jsxs36("div", { className: "flex-row-2 justify-end w-full", children: [
12821
- hasFilter && /* @__PURE__ */ jsx58(Button, { color: "negative", size: "small", onClick: () => {
13053
+ /* @__PURE__ */ jsxs38("div", { className: "flex-row-2 justify-end w-full", children: [
13054
+ hasFilter && /* @__PURE__ */ jsx59(Button, { color: "negative", size: "small", onClick: () => {
12822
13055
  column.setFilterValue(void 0);
12823
13056
  close();
12824
13057
  }, children: translation("remove") }),
12825
- /* @__PURE__ */ jsx58(Button, { size: "small", onClick: () => {
13058
+ /* @__PURE__ */ jsx59(Button, { size: "small", onClick: () => {
12826
13059
  column.setFilterValue(filterValue);
12827
13060
  close();
12828
13061
  }, children: translation("apply") })
@@ -12833,7 +13066,7 @@ var TableFilterButton = ({
12833
13066
  };
12834
13067
 
12835
13068
  // src/components/table/Table.tsx
12836
- import { jsx as jsx59, jsxs as jsxs37 } from "react/jsx-runtime";
13069
+ import { jsx as jsx60, jsxs as jsxs39 } from "react/jsx-runtime";
12837
13070
  var Table = ({
12838
13071
  data,
12839
13072
  fillerRow,
@@ -12847,21 +13080,21 @@ var Table = ({
12847
13080
  columns,
12848
13081
  ...tableOptions
12849
13082
  }) => {
12850
- const ref = useRef13(null);
12851
- const tableRef = useRef13(null);
12852
- const [columnSizing, setColumnSizing] = useState26(columns.reduce((previousValue, currentValue) => {
13083
+ const ref = useRef14(null);
13084
+ const tableRef = useRef14(null);
13085
+ const [columnSizing, setColumnSizing] = useState27(columns.reduce((previousValue, currentValue) => {
12853
13086
  return {
12854
13087
  ...previousValue,
12855
13088
  [currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
12856
13089
  };
12857
13090
  }, {}));
12858
- const [columnSizingInfo, setColumnSizingInfo] = useState26();
12859
- const [pagination, setPagination] = useState26({
13091
+ const [columnSizingInfo, setColumnSizingInfo] = useState27();
13092
+ const [pagination, setPagination] = useState27({
12860
13093
  pageSize: 10,
12861
13094
  pageIndex: 0,
12862
13095
  ...initialState?.pagination
12863
13096
  });
12864
- const [columnFilters, setColumnFilters] = useState26(initialState?.columnFilters);
13097
+ const [columnFilters, setColumnFilters] = useState27(initialState?.columnFilters);
12865
13098
  const computedColumnMinWidths = useMemo7(() => {
12866
13099
  return columns.reduce((previousValue, column) => {
12867
13100
  return {
@@ -12953,7 +13186,7 @@ var Table = ({
12953
13186
  minSize: 60,
12954
13187
  maxSize: 700,
12955
13188
  cell: ({ cell }) => {
12956
- return /* @__PURE__ */ jsx59(TableCell, { children: cell.getValue() });
13189
+ return /* @__PURE__ */ jsx60(TableCell, { children: cell.getValue() });
12957
13190
  },
12958
13191
  ...defaultColumn
12959
13192
  },
@@ -13001,7 +13234,7 @@ var Table = ({
13001
13234
  columnResizeMode: "onChange",
13002
13235
  ...tableOptions
13003
13236
  });
13004
- const [hasInitializedSizing, setHasInitializedSizing] = useState26(false);
13237
+ const [hasInitializedSizing, setHasInitializedSizing] = useState27(false);
13005
13238
  useEffect27(() => {
13006
13239
  if (!hasInitializedSizing && ref.current) {
13007
13240
  setHasInitializedSizing(true);
@@ -13038,18 +13271,18 @@ var Table = ({
13038
13271
  }
13039
13272
  return colSizes;
13040
13273
  }, [table.getState().columnSizingInfo, table.getState().columnSizing]);
13041
- return /* @__PURE__ */ jsxs37("div", { ref, className: clsx47("flex-col-4", className), children: [
13042
- /* @__PURE__ */ jsx59("div", { className: clsx47("flex-col-0 w-full overflow-auto", tableContainerClassName), children: /* @__PURE__ */ jsxs37(
13274
+ return /* @__PURE__ */ jsxs39("div", { ref, className: clsx48("flex-col-4", className), children: [
13275
+ /* @__PURE__ */ jsx60("div", { className: clsx48("flex-col-0 w-full overflow-auto", tableContainerClassName), children: /* @__PURE__ */ jsxs39(
13043
13276
  "table",
13044
13277
  {
13045
13278
  ref: tableRef,
13046
- className: clsx47(tableClassName),
13279
+ className: clsx48(tableClassName),
13047
13280
  style: {
13048
13281
  ...columnSizeVars,
13049
13282
  width: Math.floor(Math.max(table.getTotalSize() - columns.length, ref.current?.offsetWidth ?? table.getTotalSize()))
13050
13283
  },
13051
13284
  children: [
13052
- table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx59("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx59(
13285
+ table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx60("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx60(
13053
13286
  "col",
13054
13287
  {
13055
13288
  style: {
@@ -13060,18 +13293,22 @@ var Table = ({
13060
13293
  },
13061
13294
  header.id
13062
13295
  )) }, headerGroup.id)),
13063
- /* @__PURE__ */ jsx59("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx59("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
13064
- return /* @__PURE__ */ jsxs37(
13296
+ /* @__PURE__ */ jsx60("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx60("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
13297
+ return /* @__PURE__ */ jsxs39(
13065
13298
  "th",
13066
13299
  {
13067
13300
  colSpan: header.colSpan,
13068
- className: clsx47("relative group", header.column.columnDef.meta?.className),
13301
+ className: clsx48("relative group", header.column.columnDef.meta?.className),
13069
13302
  children: [
13070
- /* @__PURE__ */ jsx59("div", { className: "flex-row-2 w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs37("div", { className: "flex-row-1 items-center", children: [
13071
- header.column.getCanSort() && /* @__PURE__ */ jsx59(
13303
+ /* @__PURE__ */ jsx60("div", { className: "flex-row-2 w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs39("div", { className: "flex-row-1 items-center", children: [
13304
+ header.column.getCanSort() && /* @__PURE__ */ jsx60(
13072
13305
  TableSortButton,
13073
13306
  {
13074
13307
  sortDirection: header.column.getIsSorted(),
13308
+ sortingIndexDisplay: {
13309
+ index: header.column.getIsSorted() ? header.column.getSortIndex() + 1 : -1,
13310
+ sortingsCount: table.getState().sorting.length
13311
+ },
13075
13312
  onClick: () => {
13076
13313
  const sorted = header.column.getIsSorted();
13077
13314
  const isMulti = header.column.getCanMultiSort();
@@ -13090,7 +13327,7 @@ var Table = ({
13090
13327
  }
13091
13328
  }
13092
13329
  ),
13093
- header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ jsx59(
13330
+ header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ jsx60(
13094
13331
  TableFilterButton,
13095
13332
  {
13096
13333
  column: header.column,
@@ -13102,7 +13339,7 @@ var Table = ({
13102
13339
  header.getContext()
13103
13340
  )
13104
13341
  ] }) }),
13105
- header.column.getCanResize() && /* @__PURE__ */ jsx59(
13342
+ header.column.getCanResize() && /* @__PURE__ */ jsx60(
13106
13343
  "div",
13107
13344
  {
13108
13345
  onMouseDown: header.getResizeHandler(),
@@ -13121,15 +13358,15 @@ var Table = ({
13121
13358
  header.id
13122
13359
  );
13123
13360
  }) }, headerGroup.id)) }),
13124
- /* @__PURE__ */ jsxs37("tbody", { children: [
13361
+ /* @__PURE__ */ jsxs39("tbody", { children: [
13125
13362
  table.getRowModel().rows.map((row) => {
13126
- return /* @__PURE__ */ jsx59(
13363
+ return /* @__PURE__ */ jsx60(
13127
13364
  "tr",
13128
13365
  {
13129
13366
  onClick: () => onRowClick?.(row, table),
13130
13367
  className: table.options.meta?.bodyRowClassName,
13131
13368
  children: row.getVisibleCells().map((cell) => {
13132
- return /* @__PURE__ */ jsx59("td", { children: flexRender(
13369
+ return /* @__PURE__ */ jsx60("td", { children: flexRender(
13133
13370
  cell.column.columnDef.cell,
13134
13371
  cell.getContext()
13135
13372
  ) }, cell.id);
@@ -13139,15 +13376,15 @@ var Table = ({
13139
13376
  );
13140
13377
  }),
13141
13378
  range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
13142
- return /* @__PURE__ */ jsx59("tr", { children: columns.map((column) => {
13143
- return /* @__PURE__ */ jsx59("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ jsx59(FillerRowElement, {}) }, column.id);
13379
+ return /* @__PURE__ */ jsx60("tr", { children: columns.map((column) => {
13380
+ return /* @__PURE__ */ jsx60("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ jsx60(FillerRowElement, {}) }, column.id);
13144
13381
  }) }, "filler-row-" + index);
13145
13382
  })
13146
13383
  ] })
13147
13384
  ]
13148
13385
  }
13149
13386
  ) }),
13150
- /* @__PURE__ */ jsx59("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ jsx59(
13387
+ /* @__PURE__ */ jsx60("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ jsx60(
13151
13388
  Pagination,
13152
13389
  {
13153
13390
  pageIndex: table.getState().pagination.pageIndex,
@@ -13159,7 +13396,7 @@ var Table = ({
13159
13396
  };
13160
13397
  var TableUncontrolled = ({ data, ...props }) => {
13161
13398
  const [usedDate] = useOverwritableState(data);
13162
- return /* @__PURE__ */ jsx59(
13399
+ return /* @__PURE__ */ jsx60(
13163
13400
  Table,
13164
13401
  {
13165
13402
  ...props,
@@ -13183,7 +13420,7 @@ var TableWithSelection = ({
13183
13420
  {
13184
13421
  id: selectionRowId,
13185
13422
  header: ({ table }) => {
13186
- return /* @__PURE__ */ jsx59(
13423
+ return /* @__PURE__ */ jsx60(
13187
13424
  Checkbox,
13188
13425
  {
13189
13426
  checked: table.getIsAllRowsSelected(),
@@ -13196,7 +13433,7 @@ var TableWithSelection = ({
13196
13433
  );
13197
13434
  },
13198
13435
  cell: ({ row }) => {
13199
- return /* @__PURE__ */ jsx59(
13436
+ return /* @__PURE__ */ jsx60(
13200
13437
  Checkbox,
13201
13438
  {
13202
13439
  disabled: !row.getCanSelect(),
@@ -13214,15 +13451,15 @@ var TableWithSelection = ({
13214
13451
  ...columns
13215
13452
  ];
13216
13453
  }, [columns, selectionRowId]);
13217
- return /* @__PURE__ */ jsx59(
13454
+ return /* @__PURE__ */ jsx60(
13218
13455
  Table,
13219
13456
  {
13220
13457
  columns: columnsWithSelection,
13221
13458
  fillerRow: (columnId, table) => {
13222
13459
  if (columnId === selectionRowId) {
13223
- return /* @__PURE__ */ jsx59(Checkbox, { checked: false, disabled: true, className: "max-w-6" });
13460
+ return /* @__PURE__ */ jsx60(Checkbox, { checked: false, disabled: true, className: "max-w-6" });
13224
13461
  }
13225
- return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ jsx59(FillerRowElement, {});
13462
+ return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ jsx60(FillerRowElement, {});
13226
13463
  },
13227
13464
  state: {
13228
13465
  rowSelection,
@@ -13236,7 +13473,7 @@ var TableWithSelection = ({
13236
13473
  },
13237
13474
  meta: {
13238
13475
  ...meta,
13239
- bodyRowClassName: clsx47(
13476
+ bodyRowClassName: clsx48(
13240
13477
  { "cursor-pointer": !disableClickRowClickSelection },
13241
13478
  meta?.bodyRowClassName
13242
13479
  )
@@ -13247,8 +13484,8 @@ var TableWithSelection = ({
13247
13484
  };
13248
13485
 
13249
13486
  // src/components/user-action/CopyToClipboardWrapper.tsx
13250
- import { useState as useState27 } from "react";
13251
- import { clsx as clsx48 } from "clsx";
13487
+ import { useState as useState28 } from "react";
13488
+ import { clsx as clsx49 } from "clsx";
13252
13489
 
13253
13490
  // src/utils/writeToClipboard.ts
13254
13491
  var writeToClipboard = (text) => {
@@ -13257,7 +13494,7 @@ var writeToClipboard = (text) => {
13257
13494
 
13258
13495
  // src/components/user-action/CopyToClipboardWrapper.tsx
13259
13496
  import { CheckIcon as CheckIcon2, Copy } from "lucide-react";
13260
- import { jsx as jsx60, jsxs as jsxs38 } from "react/jsx-runtime";
13497
+ import { jsx as jsx61, jsxs as jsxs40 } from "react/jsx-runtime";
13261
13498
  var CopyToClipboardWrapper = ({
13262
13499
  children,
13263
13500
  textToCopy,
@@ -13267,8 +13504,8 @@ var CopyToClipboardWrapper = ({
13267
13504
  zIndex = 10
13268
13505
  }) => {
13269
13506
  const translation = useHightideTranslation();
13270
- const [isShowingIndication, setIsShowingIndication] = useState27(false);
13271
- const [isShowingConfirmation, setIsShowingConfirmation] = useState27(false);
13507
+ const [isShowingIndication, setIsShowingIndication] = useState28(false);
13508
+ const [isShowingConfirmation, setIsShowingConfirmation] = useState28(false);
13272
13509
  const positionClasses = {
13273
13510
  top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
13274
13511
  bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
@@ -13288,10 +13525,10 @@ var CopyToClipboardWrapper = ({
13288
13525
  left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
13289
13526
  right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
13290
13527
  };
13291
- return /* @__PURE__ */ jsxs38(
13528
+ return /* @__PURE__ */ jsxs40(
13292
13529
  "div",
13293
13530
  {
13294
- className: clsx48("relative inline-block cursor-copy", containerClassName),
13531
+ className: clsx49("relative inline-block cursor-copy", containerClassName),
13295
13532
  onMouseEnter: () => {
13296
13533
  setIsShowingIndication(true);
13297
13534
  },
@@ -13306,10 +13543,10 @@ var CopyToClipboardWrapper = ({
13306
13543
  },
13307
13544
  children: [
13308
13545
  children,
13309
- /* @__PURE__ */ jsxs38(
13546
+ /* @__PURE__ */ jsxs40(
13310
13547
  "div",
13311
13548
  {
13312
- className: clsx48(
13549
+ className: clsx49(
13313
13550
  `absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
13314
13551
  shadow-around-md bg-tooltip-background cursor-default pointer-events-none`,
13315
13552
  "transition-opacity duration-200",
@@ -13321,18 +13558,18 @@ var CopyToClipboardWrapper = ({
13321
13558
  opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
13322
13559
  },
13323
13560
  children: [
13324
- isShowingConfirmation && /* @__PURE__ */ jsxs38("div", { className: "flex-row-1", children: [
13325
- /* @__PURE__ */ jsx60(CheckIcon2, { size: 16, className: "text-positive" }),
13561
+ isShowingConfirmation && /* @__PURE__ */ jsxs40("div", { className: "flex-row-1", children: [
13562
+ /* @__PURE__ */ jsx61(CheckIcon2, { size: 16, className: "text-positive" }),
13326
13563
  translation("copied")
13327
13564
  ] }),
13328
- isShowingIndication && /* @__PURE__ */ jsxs38("div", { className: "flex-row-1 text-description", children: [
13329
- /* @__PURE__ */ jsx60(Copy, { size: 16 }),
13565
+ isShowingIndication && /* @__PURE__ */ jsxs40("div", { className: "flex-row-1 text-description", children: [
13566
+ /* @__PURE__ */ jsx61(Copy, { size: 16 }),
13330
13567
  translation("clickToCopy")
13331
13568
  ] }),
13332
- /* @__PURE__ */ jsx60(
13569
+ /* @__PURE__ */ jsx61(
13333
13570
  "div",
13334
13571
  {
13335
- className: clsx48(`absolute w-0 h-0`, triangleClasses[position]),
13572
+ className: clsx49(`absolute w-0 h-0`, triangleClasses[position]),
13336
13573
  style: { ...triangleStyle[position], zIndex: zIndex + 1 }
13337
13574
  }
13338
13575
  )
@@ -13345,30 +13582,27 @@ var CopyToClipboardWrapper = ({
13345
13582
  };
13346
13583
 
13347
13584
  // src/components/user-action/DateAndTimePicker.tsx
13348
- import clsx49 from "clsx";
13349
- import { jsx as jsx61, jsxs as jsxs39 } from "react/jsx-runtime";
13585
+ import clsx50 from "clsx";
13586
+ import { jsx as jsx62, jsxs as jsxs41 } from "react/jsx-runtime";
13350
13587
  var DateTimePicker = ({
13351
13588
  value = /* @__PURE__ */ new Date(),
13352
13589
  start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
13353
13590
  end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
13354
13591
  mode = "dateTime",
13355
- onFinish,
13356
13592
  onChange,
13357
- onRemove,
13358
13593
  timePickerProps,
13359
13594
  datePickerProps
13360
13595
  }) => {
13361
- const translation = useHightideTranslation();
13362
13596
  const useDate = mode === "dateTime" || mode === "date";
13363
13597
  const useTime = mode === "dateTime" || mode === "time";
13364
13598
  let dateDisplay;
13365
13599
  let timeDisplay;
13366
13600
  if (useDate) {
13367
- dateDisplay = /* @__PURE__ */ jsx61(
13601
+ dateDisplay = /* @__PURE__ */ jsx62(
13368
13602
  DatePicker,
13369
13603
  {
13370
13604
  ...datePickerProps,
13371
- className: "min-w-80 min-h-71 max-h-71",
13605
+ className: "min-w-80",
13372
13606
  yearMonthPickerProps: { className: "h-full grow" },
13373
13607
  value,
13374
13608
  start,
@@ -13378,39 +13612,26 @@ var DateTimePicker = ({
13378
13612
  );
13379
13613
  }
13380
13614
  if (useTime) {
13381
- timeDisplay = /* @__PURE__ */ jsx61(
13615
+ timeDisplay = /* @__PURE__ */ jsx62(
13382
13616
  TimePicker,
13383
13617
  {
13384
13618
  ...timePickerProps,
13385
- className: clsx49("min-h-71 max-h-71", { "justify-between w-full": mode === "time" }),
13619
+ className: clsx50({ "justify-between": mode === "time" }),
13386
13620
  time: value,
13387
13621
  onChange
13388
13622
  }
13389
13623
  );
13390
13624
  }
13391
- return /* @__PURE__ */ jsxs39("div", { className: "flex-col-2 w-fit", children: [
13392
- /* @__PURE__ */ jsxs39("div", { className: "flex-row-4", children: [
13393
- dateDisplay,
13394
- timeDisplay
13395
- ] }),
13396
- /* @__PURE__ */ jsx61("div", { className: "flex-row-2 justify-end", children: /* @__PURE__ */ jsxs39("div", { className: "flex-row-2 mt-1", children: [
13397
- /* @__PURE__ */ jsx61(Button, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
13398
- /* @__PURE__ */ jsx61(
13399
- Button,
13400
- {
13401
- size: "medium",
13402
- onClick: () => onFinish?.(value),
13403
- children: translation("change")
13404
- }
13405
- )
13406
- ] }) })
13625
+ return /* @__PURE__ */ jsxs41("div", { className: "flex-row-2 min-h-71 max-h-71", children: [
13626
+ dateDisplay,
13627
+ timeDisplay
13407
13628
  ] });
13408
13629
  };
13409
13630
 
13410
13631
  // src/components/user-action/ScrollPicker.tsx
13411
- import { useCallback as useCallback13, useEffect as useEffect28, useState as useState28 } from "react";
13412
- import clsx50 from "clsx";
13413
- import { jsx as jsx62, jsxs as jsxs40 } from "react/jsx-runtime";
13632
+ import { useCallback as useCallback13, useEffect as useEffect28, useState as useState29 } from "react";
13633
+ import clsx51 from "clsx";
13634
+ import { jsx as jsx63, jsxs as jsxs42 } from "react/jsx-runtime";
13414
13635
  var up = 1;
13415
13636
  var down = -1;
13416
13637
  var ScrollPicker = ({
@@ -13429,7 +13650,7 @@ var ScrollPicker = ({
13429
13650
  transition,
13430
13651
  items,
13431
13652
  lastTimeStamp
13432
- }, setAnimation] = useState28({
13653
+ }, setAnimation] = useState29({
13433
13654
  targetIndex: selectedIndex,
13434
13655
  currentIndex: disabled ? selectedIndex : 0,
13435
13656
  velocity: 0,
@@ -13549,7 +13770,7 @@ var ScrollPicker = ({
13549
13770
  }
13550
13771
  return clamp(1 - opacityValue / max);
13551
13772
  };
13552
- return /* @__PURE__ */ jsx62(
13773
+ return /* @__PURE__ */ jsx63(
13553
13774
  "div",
13554
13775
  {
13555
13776
  className: "relative overflow-hidden",
@@ -13560,15 +13781,15 @@ var ScrollPicker = ({
13560
13781
  setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
13561
13782
  }
13562
13783
  },
13563
- children: /* @__PURE__ */ jsxs40("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
13564
- /* @__PURE__ */ jsx62(
13784
+ children: /* @__PURE__ */ jsxs42("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
13785
+ /* @__PURE__ */ jsx63(
13565
13786
  "div",
13566
13787
  {
13567
13788
  className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/50 border-y-2 border-x-0 ",
13568
13789
  style: { height: `${itemHeight}px` }
13569
13790
  }
13570
13791
  ),
13571
- /* @__PURE__ */ jsx62(
13792
+ /* @__PURE__ */ jsx63(
13572
13793
  "div",
13573
13794
  {
13574
13795
  className: "flex-col-2 select-none",
@@ -13576,10 +13797,10 @@ var ScrollPicker = ({
13576
13797
  transform: `translateY(${-transition * (distance + itemHeight)}px)`,
13577
13798
  columnGap: `${distance}px`
13578
13799
  },
13579
- children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ jsx62(
13800
+ children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ jsx63(
13580
13801
  "div",
13581
13802
  {
13582
- className: clsx50(
13803
+ className: clsx51(
13583
13804
  `flex-col-2 items-center justify-center rounded-md`,
13584
13805
  {
13585
13806
  "text-primary font-bold": currentIndex === index,
@@ -13605,93 +13826,163 @@ var ScrollPicker = ({
13605
13826
  );
13606
13827
  };
13607
13828
 
13608
- // src/components/user-action/Tooltip.tsx
13609
- import { clsx as clsx51 } from "clsx";
13610
- import { jsx as jsx63, jsxs as jsxs41 } from "react/jsx-runtime";
13611
- var Tooltip = ({
13612
- tooltip,
13613
- children,
13614
- animationDelay = 650,
13615
- tooltipClassName = "",
13616
- containerClassName = "",
13617
- position = "bottom"
13829
+ // src/components/user-action/input/DateTimeInput.tsx
13830
+ import { useEffect as useEffect29, useMemo as useMemo8, useRef as useRef15, useState as useState30 } from "react";
13831
+ import { CalendarIcon } from "lucide-react";
13832
+ import clsx52 from "clsx";
13833
+ import { Fragment as Fragment8, jsx as jsx64, jsxs as jsxs43 } from "react/jsx-runtime";
13834
+ var DateTimeInput = ({
13835
+ date,
13836
+ onValueChange,
13837
+ onEditCompleted,
13838
+ onRemove,
13839
+ containerProps,
13840
+ mode = "date",
13841
+ pickerProps,
13842
+ ...props
13618
13843
  }) => {
13619
- const { isHovered, handlers } = useHoverState();
13620
- const positionClasses = {
13621
- top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
13622
- bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
13623
- left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,
13624
- right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`
13625
- };
13626
- const triangleSize = 6;
13627
- const triangleClasses = {
13628
- top: `top-full left-1/2 -translate-x-1/2 border-t-tooltip-background border-l-transparent border-r-transparent`,
13629
- bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-tooltip-background border-l-transparent border-r-transparent`,
13630
- left: `left-full top-1/2 -translate-y-1/2 border-l-tooltip-background border-t-transparent border-b-transparent`,
13631
- right: `right-full top-1/2 -translate-y-1/2 border-r-tooltip-background border-t-transparent border-b-transparent`
13632
- };
13633
- const triangleStyle = {
13634
- top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },
13635
- bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },
13636
- left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
13637
- right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
13638
- };
13639
- const zIndex = useZIndexRegister(isHovered);
13640
- return /* @__PURE__ */ jsxs41(
13641
- "div",
13844
+ const translation = useHightideTranslation();
13845
+ const { locale } = useLocale();
13846
+ const [isOpen, setIsOpen] = useState30(false);
13847
+ const containerRef = useRef15(null);
13848
+ useOutsideClick([containerRef], () => {
13849
+ setIsOpen(false);
13850
+ });
13851
+ const zIndex = useZIndexRegister(isOpen);
13852
+ const isReadOnly = useMemo8(() => props.readOnly || props.disabled, [props.readOnly, props.disabled]);
13853
+ useEffect29(() => {
13854
+ if (isReadOnly) {
13855
+ setIsOpen(false);
13856
+ }
13857
+ }, [isReadOnly]);
13858
+ const cleanInputProps = { ...props };
13859
+ delete cleanInputProps["isShowingError"];
13860
+ delete cleanInputProps["setIsShowingError"];
13861
+ return /* @__PURE__ */ jsxs43(Fragment8, { children: [
13862
+ /* @__PURE__ */ jsxs43("div", { ...containerProps, className: clsx52("relative w-full", containerProps?.className), children: [
13863
+ /* @__PURE__ */ jsx64(
13864
+ Input,
13865
+ {
13866
+ ...cleanInputProps,
13867
+ placeholder: translation("clickToAdd"),
13868
+ value: date ? DateUtils.formatAbsolute(date, locale, mode === "dateTime") : "",
13869
+ onClick: (event) => {
13870
+ setIsOpen(true);
13871
+ cleanInputProps.onClick?.(event);
13872
+ },
13873
+ readOnly: true,
13874
+ className: clsx52(
13875
+ "pr-10 w-full",
13876
+ { "hover:cursor-pointer": !isReadOnly },
13877
+ cleanInputProps.className
13878
+ )
13879
+ }
13880
+ ),
13881
+ /* @__PURE__ */ jsx64(
13882
+ Button,
13883
+ {
13884
+ coloringStyle: "text",
13885
+ layout: "icon",
13886
+ color: "neutral",
13887
+ size: "small",
13888
+ className: "absolute right-1 top-1/2 -translate-y-1/2",
13889
+ disabled: isReadOnly,
13890
+ onClick: () => setIsOpen((prevState) => !prevState),
13891
+ children: /* @__PURE__ */ jsx64(CalendarIcon, { className: "size-5" })
13892
+ }
13893
+ )
13894
+ ] }),
13895
+ /* @__PURE__ */ jsx64(Visibility, { isVisible: isOpen, children: /* @__PURE__ */ jsxs43(
13896
+ "div",
13897
+ {
13898
+ ref: containerRef,
13899
+ className: "absolute left-0 flex-col-3 rounded-lg shadow-xl border bg-surface-variant text-on-surface border-divider p-2",
13900
+ style: { zIndex },
13901
+ children: [
13902
+ /* @__PURE__ */ jsx64(
13903
+ DateTimePicker,
13904
+ {
13905
+ ...pickerProps,
13906
+ mode,
13907
+ value: date,
13908
+ onChange: (newDate) => {
13909
+ onValueChange(newDate);
13910
+ }
13911
+ }
13912
+ ),
13913
+ /* @__PURE__ */ jsxs43("div", { className: "flex-row-2 justify-end", children: [
13914
+ /* @__PURE__ */ jsx64(Visibility, { isVisible: !!onRemove, children: /* @__PURE__ */ jsx64(
13915
+ Button,
13916
+ {
13917
+ size: "medium",
13918
+ color: "negative",
13919
+ onClick: () => {
13920
+ onRemove?.();
13921
+ setIsOpen(false);
13922
+ },
13923
+ children: translation("clear")
13924
+ }
13925
+ ) }),
13926
+ /* @__PURE__ */ jsx64(
13927
+ Button,
13928
+ {
13929
+ size: "medium",
13930
+ onClick: () => {
13931
+ onEditCompleted?.(date);
13932
+ setIsOpen(false);
13933
+ },
13934
+ children: translation("change")
13935
+ }
13936
+ )
13937
+ ] })
13938
+ ]
13939
+ }
13940
+ ) })
13941
+ ] });
13942
+ };
13943
+ var DateTimeInputUncontrolled = ({
13944
+ date: initialDate,
13945
+ ...props
13946
+ }) => {
13947
+ const [date, setDate] = useOverwritableState(useMemo8(() => initialDate ?? /* @__PURE__ */ new Date(), [initialDate]));
13948
+ return /* @__PURE__ */ jsx64(
13949
+ DateTimeInput,
13642
13950
  {
13643
- className: clsx51("relative inline-block", containerClassName),
13644
- ...handlers,
13645
- children: [
13646
- children,
13647
- isHovered && /* @__PURE__ */ jsxs41(
13648
- "div",
13649
- {
13650
- className: clsx51(
13651
- `opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
13652
- animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
13653
- positionClasses[position],
13654
- tooltipClassName
13655
- ),
13656
- style: { zIndex, animationDelay: animationDelay + "ms" },
13657
- children: [
13658
- tooltip,
13659
- /* @__PURE__ */ jsx63(
13660
- "div",
13661
- {
13662
- className: clsx51(`absolute w-0 h-0`, triangleClasses[position]),
13663
- style: { ...triangleStyle[position], zIndex: zIndex + 1 }
13664
- }
13665
- )
13666
- ]
13667
- }
13668
- )
13669
- ]
13951
+ ...props,
13952
+ date,
13953
+ onValueChange: (newDate) => {
13954
+ setDate(newDate);
13955
+ props.onValueChange?.(newDate);
13956
+ },
13957
+ onRemove: () => {
13958
+ setDate(/* @__PURE__ */ new Date());
13959
+ props.onRemove?.();
13960
+ }
13670
13961
  }
13671
13962
  );
13672
13963
  };
13673
13964
 
13674
13965
  // src/components/user-action/input/InsideLabelInput.tsx
13675
13966
  import { useId as useId11 } from "react";
13676
- import { forwardRef as forwardRef9, useState as useState29 } from "react";
13677
- import clsx52 from "clsx";
13678
- import { jsx as jsx64, jsxs as jsxs42 } from "react/jsx-runtime";
13967
+ import { forwardRef as forwardRef9, useState as useState31 } from "react";
13968
+ import clsx53 from "clsx";
13969
+ import { jsx as jsx65, jsxs as jsxs44 } from "react/jsx-runtime";
13679
13970
  var InsideLabelInput = forwardRef9(function InsideLabelInput2({
13680
13971
  id: customId,
13681
13972
  label,
13682
13973
  ...props
13683
13974
  }, forwardedRef) {
13684
13975
  const { value } = props;
13685
- const [isFocused, setIsFocused] = useState29(false);
13976
+ const [isFocused, setIsFocused] = useState31(false);
13686
13977
  const generatedId = useId11();
13687
13978
  const id = customId ?? generatedId;
13688
- return /* @__PURE__ */ jsxs42("div", { className: clsx52("relative"), children: [
13689
- /* @__PURE__ */ jsx64(
13979
+ return /* @__PURE__ */ jsxs44("div", { className: clsx53("relative"), children: [
13980
+ /* @__PURE__ */ jsx65(
13690
13981
  Input,
13691
13982
  {
13692
13983
  ...props,
13693
13984
  id,
13694
- className: clsx52("h-14 px-4 pb-2 py-6.5", props.className),
13985
+ className: clsx53("h-14 px-4 pb-2 py-6.5", props.className),
13695
13986
  ref: forwardedRef,
13696
13987
  "aria-labelledby": id + "-label",
13697
13988
  onFocus: (event) => {
@@ -13704,13 +13995,13 @@ var InsideLabelInput = forwardRef9(function InsideLabelInput2({
13704
13995
  }
13705
13996
  }
13706
13997
  ),
13707
- /* @__PURE__ */ jsx64(
13998
+ /* @__PURE__ */ jsx65(
13708
13999
  "label",
13709
14000
  {
13710
14001
  id: id + "-label",
13711
14002
  "aria-hidden": true,
13712
14003
  "data-display": isFocused || !!value ? "small" : "full",
13713
- className: clsx52(
14004
+ className: clsx53(
13714
14005
  // margin left to account for the border which is ignored for absolute positions
13715
14006
  "absolute left-4 ml-0.5 top-2 transition-all delay-25 pointer-events-none touch-none",
13716
14007
  "data-[display=small]:top-2 data-[display=small]:h-force-4.5 data-[display=small]:typography-caption-sm data-[display=small]:overflow-y-hidden",
@@ -13726,7 +14017,7 @@ var InsideLabelInputUncontrolled = ({
13726
14017
  ...props
13727
14018
  }) => {
13728
14019
  const [value, setValue] = useOverwritableState(initialValue, props.onChangeText);
13729
- return /* @__PURE__ */ jsx64(
14020
+ return /* @__PURE__ */ jsx65(
13730
14021
  InsideLabelInput,
13731
14022
  {
13732
14023
  ...props,
@@ -13738,8 +14029,8 @@ var InsideLabelInputUncontrolled = ({
13738
14029
 
13739
14030
  // src/components/user-action/input/SearchBar.tsx
13740
14031
  import { Search } from "lucide-react";
13741
- import { clsx as clsx53 } from "clsx";
13742
- import { jsx as jsx65, jsxs as jsxs43 } from "react/jsx-runtime";
14032
+ import { clsx as clsx54 } from "clsx";
14033
+ import { jsx as jsx66, jsxs as jsxs45 } from "react/jsx-runtime";
13743
14034
  var SearchBar = ({
13744
14035
  onSearch,
13745
14036
  searchButtonProps,
@@ -13747,16 +14038,16 @@ var SearchBar = ({
13747
14038
  ...inputProps
13748
14039
  }) => {
13749
14040
  const translation = useHightideTranslation();
13750
- return /* @__PURE__ */ jsxs43("div", { ...containerProps, className: clsx53("relative", containerProps?.className), children: [
13751
- /* @__PURE__ */ jsx65(
14041
+ return /* @__PURE__ */ jsxs45("div", { ...containerProps, className: clsx54("relative", containerProps?.className), children: [
14042
+ /* @__PURE__ */ jsx66(
13752
14043
  InputUncontrolled,
13753
14044
  {
13754
14045
  ...inputProps,
13755
14046
  placeholder: inputProps.placeholder ?? translation("search"),
13756
- className: clsx53("pr-10 w-full", inputProps.className)
14047
+ className: clsx54("pr-10 w-full", inputProps.className)
13757
14048
  }
13758
14049
  ),
13759
- onSearch && /* @__PURE__ */ jsx65(
14050
+ onSearch && /* @__PURE__ */ jsx66(
13760
14051
  Button,
13761
14052
  {
13762
14053
  ...searchButtonProps,
@@ -13765,34 +14056,34 @@ var SearchBar = ({
13765
14056
  color: "neutral",
13766
14057
  coloringStyle: "text",
13767
14058
  onClick: (event) => onSearch(event),
13768
- className: clsx53("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
13769
- children: /* @__PURE__ */ jsx65(Search, { className: "w-full h-full" })
14059
+ className: clsx54("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
14060
+ children: /* @__PURE__ */ jsx66(Search, { className: "w-full h-full" })
13770
14061
  }
13771
14062
  )
13772
14063
  ] });
13773
14064
  };
13774
14065
 
13775
14066
  // src/components/user-action/input/ToggleableInput.tsx
13776
- import { forwardRef as forwardRef10, useEffect as useEffect29, useImperativeHandle as useImperativeHandle4, useRef as useRef14, useState as useState30 } from "react";
14067
+ import { forwardRef as forwardRef10, useEffect as useEffect30, useImperativeHandle as useImperativeHandle4, useRef as useRef16, useState as useState32 } from "react";
13777
14068
  import { Pencil } from "lucide-react";
13778
- import clsx54 from "clsx";
13779
- import { jsx as jsx66, jsxs as jsxs44 } from "react/jsx-runtime";
14069
+ import clsx55 from "clsx";
14070
+ import { jsx as jsx67, jsxs as jsxs46 } from "react/jsx-runtime";
13780
14071
  var ToggleableInput = forwardRef10(function ToggleableInput2({
13781
14072
  value,
13782
14073
  initialState = "display",
13783
14074
  editCompleteOptions,
13784
14075
  ...props
13785
14076
  }, forwardedRef) {
13786
- const [isEditing, setIsEditing] = useState30(initialState !== "display");
13787
- const innerRef = useRef14(null);
14077
+ const [isEditing, setIsEditing] = useState32(initialState !== "display");
14078
+ const innerRef = useRef16(null);
13788
14079
  useImperativeHandle4(forwardedRef, () => innerRef.current);
13789
- useEffect29(() => {
14080
+ useEffect30(() => {
13790
14081
  if (isEditing) {
13791
14082
  innerRef.current?.focus();
13792
14083
  }
13793
14084
  }, [isEditing]);
13794
- return /* @__PURE__ */ jsxs44("div", { className: clsx54("relative flex-row-2", { "flex-1": isEditing }), children: [
13795
- /* @__PURE__ */ jsx66(
14085
+ return /* @__PURE__ */ jsxs46("div", { className: clsx55("relative flex-row-2", { "flex-1": isEditing }), children: [
14086
+ /* @__PURE__ */ jsx67(
13796
14087
  Input,
13797
14088
  {
13798
14089
  ...props,
@@ -13813,14 +14104,14 @@ var ToggleableInput = forwardRef10(function ToggleableInput2({
13813
14104
  },
13814
14105
  "data-name": props["data-name"] ?? "togglable-input",
13815
14106
  "data-isEditing": isEditing ? "" : void 0,
13816
- className: clsx54(`w-full rounded-md`, {
14107
+ className: clsx55(`w-full rounded-md`, {
13817
14108
  "text-transparent": !isEditing
13818
14109
  })
13819
14110
  }
13820
14111
  ),
13821
- !isEditing && /* @__PURE__ */ jsxs44("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
13822
- /* @__PURE__ */ jsx66("span", { className: clsx54(" truncate"), children: value }),
13823
- /* @__PURE__ */ jsx66(Pencil, { className: clsx54(`size-force-4`, { "text-transparent": isEditing }) })
14112
+ !isEditing && /* @__PURE__ */ jsxs46("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
14113
+ /* @__PURE__ */ jsx67("span", { className: clsx55(" truncate"), children: value }),
14114
+ /* @__PURE__ */ jsx67(Pencil, { className: clsx55(`size-force-4`, { "text-transparent": isEditing }) })
13824
14115
  ] })
13825
14116
  ] });
13826
14117
  });
@@ -13830,7 +14121,7 @@ var ToggleableInputUncontrolled = ({
13830
14121
  ...restProps
13831
14122
  }) => {
13832
14123
  const [value, setValue] = useOverwritableState(initialValue, onChangeText);
13833
- return /* @__PURE__ */ jsx66(
14124
+ return /* @__PURE__ */ jsx67(
13834
14125
  ToggleableInput,
13835
14126
  {
13836
14127
  value,
@@ -13841,33 +14132,33 @@ var ToggleableInputUncontrolled = ({
13841
14132
  };
13842
14133
 
13843
14134
  // src/components/utils/FocusTrap.tsx
13844
- import { useRef as useRef15 } from "react";
14135
+ import { useRef as useRef17 } from "react";
13845
14136
  import { useImperativeHandle as useImperativeHandle5 } from "react";
13846
14137
  import { forwardRef as forwardRef11 } from "react";
13847
- import { jsx as jsx67 } from "react/jsx-runtime";
14138
+ import { jsx as jsx68 } from "react/jsx-runtime";
13848
14139
  var FocusTrap = forwardRef11(function FocusTrap2({
13849
14140
  active = true,
13850
14141
  initialFocus,
13851
14142
  focusFirst = false,
13852
14143
  ...props
13853
14144
  }, forwardedRef) {
13854
- const innerRef = useRef15(null);
14145
+ const innerRef = useRef17(null);
13855
14146
  useImperativeHandle5(forwardedRef, () => innerRef.current);
13856
14147
  useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
13857
- return /* @__PURE__ */ jsx67("div", { ref: innerRef, ...props });
14148
+ return /* @__PURE__ */ jsx68("div", { ref: innerRef, ...props });
13858
14149
  });
13859
14150
 
13860
14151
  // src/components/utils/Transition.tsx
13861
- import { useEffect as useEffect30, useState as useState31 } from "react";
14152
+ import { useEffect as useEffect31, useState as useState33 } from "react";
13862
14153
  function Transition({
13863
14154
  children,
13864
14155
  show,
13865
14156
  includeAnimation = true
13866
14157
  }) {
13867
- const [isOpen, setIsOpen] = useState31(show);
13868
- const [isTransitioning, setIsTransitioning] = useState31(!isOpen);
14158
+ const [isOpen, setIsOpen] = useState33(show);
14159
+ const [isTransitioning, setIsTransitioning] = useState33(!isOpen);
13869
14160
  const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
13870
- useEffect30(() => {
14161
+ useEffect31(() => {
13871
14162
  setIsOpen(show);
13872
14163
  setIsTransitioning(true);
13873
14164
  }, [show]);
@@ -13892,7 +14183,7 @@ function Transition({
13892
14183
  }
13893
14184
 
13894
14185
  // src/hooks/focus/useFocusGuards.ts
13895
- import { useEffect as useEffect31 } from "react";
14186
+ import { useEffect as useEffect32 } from "react";
13896
14187
  var selectorName = "data-hw-focus-guard";
13897
14188
  function FocusGuard() {
13898
14189
  const element = document.createElement("div");
@@ -13930,7 +14221,7 @@ var FocusGuardsService = class _FocusGuardsService {
13930
14221
  }
13931
14222
  };
13932
14223
  var useFocusGuards = () => {
13933
- useEffect31(() => {
14224
+ useEffect32(() => {
13934
14225
  FocusGuardsService.getInstance().add();
13935
14226
  return () => {
13936
14227
  FocusGuardsService.getInstance().remove();
@@ -13939,10 +14230,10 @@ var useFocusGuards = () => {
13939
14230
  };
13940
14231
 
13941
14232
  // src/hooks/focus/useFocusOnceVisible.ts
13942
- import React6, { useEffect as useEffect32 } from "react";
14233
+ import React6, { useEffect as useEffect33 } from "react";
13943
14234
  var useFocusOnceVisible = (ref, disable = false) => {
13944
14235
  const [hasUsedFocus, setHasUsedFocus] = React6.useState(false);
13945
- useEffect32(() => {
14236
+ useEffect33(() => {
13946
14237
  if (disable || hasUsedFocus) {
13947
14238
  return;
13948
14239
  }
@@ -13968,7 +14259,7 @@ var useRerender = () => {
13968
14259
  };
13969
14260
 
13970
14261
  // src/hooks/useSearch.ts
13971
- import { useCallback as useCallback14, useEffect as useEffect33, useMemo as useMemo8, useState as useState32 } from "react";
14262
+ import { useCallback as useCallback14, useEffect as useEffect34, useMemo as useMemo9, useState as useState34 } from "react";
13972
14263
 
13973
14264
  // src/utils/simpleSearch.ts
13974
14265
  var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
@@ -14007,9 +14298,9 @@ var useSearch = ({
14007
14298
  filter,
14008
14299
  disabled = false
14009
14300
  }) => {
14010
- const [search, setSearch] = useState32(initialSearch ?? "");
14011
- const [result, setResult] = useState32(list);
14012
- const searchTags = useMemo8(() => additionalSearchTags ?? [], [additionalSearchTags]);
14301
+ const [search, setSearch] = useState34(initialSearch ?? "");
14302
+ const [result, setResult] = useState34(list);
14303
+ const searchTags = useMemo9(() => additionalSearchTags ?? [], [additionalSearchTags]);
14013
14304
  const updateSearch = useCallback14((newSearch) => {
14014
14305
  const usedSearch = newSearch ?? search;
14015
14306
  if (newSearch) {
@@ -14017,24 +14308,24 @@ var useSearch = ({
14017
14308
  }
14018
14309
  setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
14019
14310
  }, [searchTags, list, search, searchMapping]);
14020
- useEffect33(() => {
14311
+ useEffect34(() => {
14021
14312
  if (isSearchInstant) {
14022
14313
  setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
14023
14314
  }
14024
14315
  }, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
14025
- const filteredResult = useMemo8(() => {
14316
+ const filteredResult = useMemo9(() => {
14026
14317
  if (!filter) {
14027
14318
  return result;
14028
14319
  }
14029
14320
  return result.filter(filter);
14030
14321
  }, [result, filter]);
14031
- const sortedAndFilteredResult = useMemo8(() => {
14322
+ const sortedAndFilteredResult = useMemo9(() => {
14032
14323
  if (!sortingFunction) {
14033
14324
  return filteredResult;
14034
14325
  }
14035
14326
  return filteredResult.sort(sortingFunction);
14036
14327
  }, [filteredResult, sortingFunction]);
14037
- const usedResult = useMemo8(() => {
14328
+ const usedResult = useMemo9(() => {
14038
14329
  if (!disabled) {
14039
14330
  return sortedAndFilteredResult;
14040
14331
  }
@@ -14144,6 +14435,106 @@ var builder = (value, update) => {
14144
14435
  return value;
14145
14436
  };
14146
14437
 
14438
+ // src/utils/duration.ts
14439
+ var Duration = class _Duration {
14440
+ constructor({
14441
+ years = 0,
14442
+ months = 0,
14443
+ days = 0,
14444
+ hours = 0,
14445
+ minutes = 0,
14446
+ seconds = 0,
14447
+ milliseconds = 0
14448
+ } = {}) {
14449
+ this.assertRanges({ years, months, days, hours, minutes, seconds, milliseconds });
14450
+ this.years = years;
14451
+ this.months = months;
14452
+ this.days = days;
14453
+ this.hours = hours;
14454
+ this.minutes = minutes;
14455
+ this.seconds = seconds;
14456
+ this.milliseconds = milliseconds;
14457
+ }
14458
+ /** Date arithmetic */
14459
+ addTo(date) {
14460
+ return this.applyTo(date, 1);
14461
+ }
14462
+ subtractFrom(date) {
14463
+ return this.applyTo(date, -1);
14464
+ }
14465
+ /** Duration arithmetic */
14466
+ add(other) {
14467
+ return new _Duration({
14468
+ years: this.years + other.years,
14469
+ months: this.months + other.months,
14470
+ days: this.days + other.days,
14471
+ hours: this.hours + other.hours,
14472
+ minutes: this.minutes + other.minutes,
14473
+ seconds: this.seconds + other.seconds,
14474
+ milliseconds: this.milliseconds + other.milliseconds
14475
+ });
14476
+ }
14477
+ subtract(other) {
14478
+ return new _Duration({
14479
+ years: this.years - other.years,
14480
+ months: this.months - other.months,
14481
+ days: this.days - other.days,
14482
+ hours: this.hours - other.hours,
14483
+ minutes: this.minutes - other.minutes,
14484
+ seconds: this.seconds - other.seconds,
14485
+ milliseconds: this.milliseconds - other.milliseconds
14486
+ });
14487
+ }
14488
+ equals(other) {
14489
+ return this.years === other.years && this.months === other.months && this.days === other.days && this.hours === other.hours && this.minutes === other.minutes && this.seconds === other.seconds && this.milliseconds === other.milliseconds;
14490
+ }
14491
+ toJSON() {
14492
+ return { ...this };
14493
+ }
14494
+ /** Static difference */
14495
+ static difference(start, end) {
14496
+ const diff = end.getTime() - start.getTime();
14497
+ const ms = 1e3;
14498
+ const min = 60 * ms;
14499
+ const hr = 60 * min;
14500
+ const day = 24 * hr;
14501
+ const month = 30 * day;
14502
+ const year = 365.25 * day;
14503
+ return new _Duration({
14504
+ years: Math.floor(diff / year),
14505
+ months: Math.floor(diff / month),
14506
+ days: Math.floor(diff / day),
14507
+ hours: Math.floor(diff % day / hr),
14508
+ minutes: Math.floor(diff % hr / min),
14509
+ seconds: Math.floor(diff % min / ms),
14510
+ milliseconds: diff % ms
14511
+ });
14512
+ }
14513
+ applyTo(date, multiplier) {
14514
+ const d = new Date(date);
14515
+ d.setFullYear(d.getFullYear() + multiplier * this.years);
14516
+ d.setMonth(d.getMonth() + multiplier * this.months);
14517
+ d.setDate(d.getDate() + multiplier * this.days);
14518
+ d.setHours(d.getHours() + multiplier * this.hours);
14519
+ d.setMinutes(d.getMinutes() + multiplier * this.minutes);
14520
+ d.setSeconds(d.getSeconds() + multiplier * this.seconds);
14521
+ d.setMilliseconds(d.getMilliseconds() + multiplier * this.milliseconds);
14522
+ return d;
14523
+ }
14524
+ assertRanges(d) {
14525
+ if (d.years < 0) throw new RangeError("years >= 0");
14526
+ if (d.months < 0 || d.months > 11) throw new RangeError("months: 0\u201311");
14527
+ if (d.days < 0) throw new RangeError("days >= 0");
14528
+ if (d.hours < 0 || d.hours > 23) throw new RangeError("hours: 0\u201323");
14529
+ if (d.minutes < 0 || d.minutes > 59) throw new RangeError("minutes: 0\u201359");
14530
+ if (d.seconds < 0 || d.seconds > 59) throw new RangeError("seconds: 0\u201359");
14531
+ if (d.milliseconds < 0) throw new RangeError("milliseconds >= 0");
14532
+ }
14533
+ valueOf() {
14534
+ return this.milliseconds + this.seconds * 1e3 + this.minutes * 6e4 + this.hours * 36e5 + this.days * 864e5;
14535
+ }
14536
+ };
14537
+
14147
14538
  // src/utils/easeFunctions.ts
14148
14539
  var EaseFunctions = class _EaseFunctions {
14149
14540
  static cubicBezierGeneric(x1, y1, x2, y2) {
@@ -14281,12 +14672,16 @@ export {
14281
14672
  DatePicker,
14282
14673
  DatePickerUncontrolled,
14283
14674
  DateProperty,
14675
+ DateTimeInput,
14676
+ DateTimeInputUncontrolled,
14284
14677
  DateTimePicker,
14678
+ DateUtils,
14285
14679
  DayPicker,
14286
14680
  DayPickerUncontrolled,
14287
14681
  Dialog,
14288
14682
  DiscardChangesDialog,
14289
14683
  DividerInserter,
14684
+ Duration,
14290
14685
  EaseFunctions,
14291
14686
  ErrorComponent,
14292
14687
  Expandable,
@@ -14384,6 +14779,7 @@ export {
14384
14779
  Transition,
14385
14780
  UseValidators,
14386
14781
  VerticalDivider,
14782
+ Visibility,
14387
14783
  YearMonthPicker,
14388
14784
  YearMonthPickerUncontrolled,
14389
14785
  addDuration,
@@ -14393,19 +14789,16 @@ export {
14393
14789
  closestMatch,
14394
14790
  createLoopingList,
14395
14791
  createLoopingListWithIndex,
14396
- equalDate,
14397
14792
  equalSizeGroups,
14398
14793
  formatDate,
14399
14794
  formatDateTime,
14400
14795
  getBetweenDuration,
14401
- getDaysInMonth,
14402
14796
  getNeighbours,
14403
14797
  getWeeksForCalenderMonth,
14404
14798
  hightideTranslation,
14405
14799
  hightideTranslationLocales,
14406
14800
  isInTimeSpan,
14407
14801
  match,
14408
- monthsList,
14409
14802
  noop,
14410
14803
  range,
14411
14804
  resolveSetState,
@@ -14435,7 +14828,6 @@ export {
14435
14828
  useTranslatedValidators,
14436
14829
  useZIndexRegister,
14437
14830
  validateEmail,
14438
- weekDayList,
14439
14831
  writeToClipboard
14440
14832
  };
14441
14833
  //# sourceMappingURL=index.mjs.map