@payglocal_ui/flux-ui 0.3.0 → 0.3.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.js CHANGED
@@ -2568,7 +2568,7 @@ function useSpotlight(steps, initialStep = 0) {
2568
2568
  else setCurrentStep((s) => s + 1);
2569
2569
  },
2570
2570
  goBack: () => setCurrentStep((s) => Math.max(0, s - 1)),
2571
- goTo: (step) => setCurrentStep(Math.max(0, Math.min(step, steps.length - 1)))
2571
+ goTo: (step2) => setCurrentStep(Math.max(0, Math.min(step2, steps.length - 1)))
2572
2572
  };
2573
2573
  }
2574
2574
 
@@ -3613,20 +3613,20 @@ var Progress = React36.forwardRef(({ className, value, variant = "default", size
3613
3613
  ] }));
3614
3614
  Progress.displayName = "Progress";
3615
3615
  var ProgressTracker = React36.forwardRef(
3616
- ({ className, steps, ...props }, ref) => /* @__PURE__ */ jsx47("div", { ref, className: cn("flex items-start", className), ...props, children: steps.map((step, i) => /* @__PURE__ */ jsxs28(React36.Fragment, { children: [
3616
+ ({ className, steps, ...props }, ref) => /* @__PURE__ */ jsx47("div", { ref, className: cn("flex items-start", className), ...props, children: steps.map((step2, i) => /* @__PURE__ */ jsxs28(React36.Fragment, { children: [
3617
3617
  /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center gap-1.5 min-w-0", children: [
3618
3618
  /* @__PURE__ */ jsx47("div", { className: cn(
3619
3619
  "flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors",
3620
- step.status === "complete" && "bg-primary border-primary text-primary-foreground",
3621
- step.status === "current" && "bg-primary/10 border-primary text-primary",
3622
- step.status === "upcoming" && "bg-card border-border text-muted-foreground"
3623
- ), children: step.status === "complete" ? /* @__PURE__ */ jsx47(Check7, { className: "size-4", strokeWidth: 2.5 }) : i + 1 }),
3620
+ step2.status === "complete" && "bg-primary border-primary text-primary-foreground",
3621
+ step2.status === "current" && "bg-primary/10 border-primary text-primary",
3622
+ step2.status === "upcoming" && "bg-card border-border text-muted-foreground"
3623
+ ), children: step2.status === "complete" ? /* @__PURE__ */ jsx47(Check7, { className: "size-4", strokeWidth: 2.5 }) : i + 1 }),
3624
3624
  /* @__PURE__ */ jsxs28("div", { className: "text-center px-1", children: [
3625
- /* @__PURE__ */ jsx47("p", { className: cn("text-xs font-medium", step.status === "upcoming" ? "text-muted-foreground" : "text-foreground"), children: step.label }),
3626
- step.description && /* @__PURE__ */ jsx47("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: step.description })
3625
+ /* @__PURE__ */ jsx47("p", { className: cn("text-xs font-medium", step2.status === "upcoming" ? "text-muted-foreground" : "text-foreground"), children: step2.label }),
3626
+ step2.description && /* @__PURE__ */ jsx47("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: step2.description })
3627
3627
  ] })
3628
3628
  ] }),
3629
- i < steps.length - 1 && /* @__PURE__ */ jsx47("div", { className: "flex-1 mt-4 mx-1", children: /* @__PURE__ */ jsx47("div", { className: cn("h-0.5 w-full rounded-full transition-colors", step.status === "complete" ? "bg-primary" : "bg-border") }) })
3629
+ i < steps.length - 1 && /* @__PURE__ */ jsx47("div", { className: "flex-1 mt-4 mx-1", children: /* @__PURE__ */ jsx47("div", { className: cn("h-0.5 w-full rounded-full transition-colors", step2.status === "complete" ? "bg-primary" : "bg-border") }) })
3630
3630
  ] }, i)) })
3631
3631
  );
3632
3632
  ProgressTracker.displayName = "ProgressTracker";
@@ -4247,7 +4247,7 @@ var PAGE_BUTTON = "w-7 h-7 rounded-md flex items-center justify-center text-[12p
4247
4247
  var PAGE_BUTTON_IDLE = "text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-30 disabled:cursor-not-allowed";
4248
4248
  var PAGE_BUTTON_ACTIVE = "bg-primary text-primary-foreground shadow-sm";
4249
4249
  function DataTableFooter({
4250
- pad: pad2,
4250
+ pad: pad3,
4251
4251
  summary,
4252
4252
  countLabels,
4253
4253
  leading,
@@ -4288,7 +4288,7 @@ function DataTableFooter({
4288
4288
  {
4289
4289
  className: cn(
4290
4290
  "flex items-center gap-4 flex-wrap border-t border-border",
4291
- pad2,
4291
+ pad3,
4292
4292
  summary === "none" && !showRowsPerPage && !leading ? "justify-end" : "justify-between"
4293
4293
  ),
4294
4294
  children: [
@@ -4636,7 +4636,7 @@ function CopyableCell({
4636
4636
  valueClassName
4637
4637
  );
4638
4638
  const elided = display !== void 0 && display !== value;
4639
- const copyHint = copied ? "Copied" : elided ? `Copy ${value}` : `Copy ${label}`;
4639
+ const copyHint = copied ? "Copied" : `Copy ${label}`;
4640
4640
  if (variant === "cell") {
4641
4641
  return /* @__PURE__ */ jsx53(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
4642
4642
  /* @__PURE__ */ jsx53(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs34(
@@ -4674,31 +4674,45 @@ function CopyableCell({
4674
4674
  /* @__PURE__ */ jsx53(TooltipContent, { side: "top", className: "text-xs", children: copied ? "Copied" : "Copy" })
4675
4675
  ] }) });
4676
4676
  }
4677
+ const valueNode = onClick ? (
4678
+ // A bare <button>, deliberately, where the rest of flux would reach for
4679
+ // `Button variant="link"`. That variant hard-codes `text-[15px]`, and
4680
+ // the obvious override — `text-[inherit]` — does not beat it: Tailwind
4681
+ // and tailwind-merge read `text-[<non-length>]` as a COLOUR, so the
4682
+ // size class survives and the cell renders 2px larger than every other
4683
+ // cell in the row. Preflight already gives a bare button `font: inherit`,
4684
+ // so this simply inherits the cell's size at whatever density the table
4685
+ // is using, which is what a cell should do.
4686
+ /* @__PURE__ */ jsx53(
4687
+ "button",
4688
+ {
4689
+ type: "button",
4690
+ onClick,
4691
+ title: elided ? void 0 : value,
4692
+ "aria-label": elided ? value : void 0,
4693
+ className: cn(
4694
+ "cursor-pointer bg-transparent p-0 text-left underline-offset-4",
4695
+ "hover:underline focus-visible:underline focus-visible:outline-none",
4696
+ text
4697
+ ),
4698
+ children: display ?? value
4699
+ }
4700
+ )
4701
+ ) : /* @__PURE__ */ jsx53(
4702
+ "span",
4703
+ {
4704
+ className: text,
4705
+ title: elided ? void 0 : value,
4706
+ "aria-hidden": elided || void 0,
4707
+ children: display ?? value
4708
+ }
4709
+ );
4677
4710
  return /* @__PURE__ */ jsxs34("div", { className: cn("group/copy flex min-w-0 items-center gap-1", className), children: [
4678
- onClick ? (
4679
- // A bare <button>, deliberately, where the rest of flux would reach for
4680
- // `Button variant="link"`. That variant hard-codes `text-[15px]`, and
4681
- // the obvious override — `text-[inherit]` — does not beat it: Tailwind
4682
- // and tailwind-merge read `text-[<non-length>]` as a COLOUR, so the
4683
- // size class survives and the cell renders 2px larger than every other
4684
- // cell in the row. Preflight already gives a bare button `font: inherit`,
4685
- // so this simply inherits the cell's size at whatever density the table
4686
- // is using, which is what a cell should do.
4687
- /* @__PURE__ */ jsx53(
4688
- "button",
4689
- {
4690
- type: "button",
4691
- onClick,
4692
- title: value,
4693
- className: cn(
4694
- "cursor-pointer bg-transparent p-0 text-left underline-offset-4",
4695
- "hover:underline focus-visible:underline focus-visible:outline-none",
4696
- text
4697
- ),
4698
- children: display ?? value
4699
- }
4700
- )
4701
- ) : /* @__PURE__ */ jsx53("span", { className: text, title: value, children: display ?? value }),
4711
+ elided ? /* @__PURE__ */ jsx53(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
4712
+ /* @__PURE__ */ jsx53(TooltipTrigger, { asChild: true, children: valueNode }),
4713
+ /* @__PURE__ */ jsx53(TooltipContent, { side: "top", className: "text-xs", children: value })
4714
+ ] }) }) : valueNode,
4715
+ elided && !onClick && /* @__PURE__ */ jsx53("span", { className: "sr-only", children: value }),
4702
4716
  /* @__PURE__ */ jsx53(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
4703
4717
  /* @__PURE__ */ jsx53(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx53(
4704
4718
  Button,
@@ -5652,11 +5666,12 @@ function CalendarDayButton({
5652
5666
  }
5653
5667
 
5654
5668
  // src/date-picker.tsx
5655
- import { useState as useState12, useRef as useRef8, useEffect as useEffect8 } from "react";
5669
+ import { useState as useState12, useRef as useRef8, useEffect as useEffect8, useMemo as useMemo7, useCallback as useCallback5 } from "react";
5656
5670
  import { createPortal } from "react-dom";
5671
+ import { RemoveScroll } from "react-remove-scroll";
5657
5672
  import { ChevronLeft as ChevronLeft6, ChevronRight as ChevronRight8, ChevronDown as ChevronDown8, CalendarDays } from "lucide-react";
5658
5673
  import { AnimatePresence, motion } from "framer-motion";
5659
- import { jsx as jsx62, jsxs as jsxs41 } from "react/jsx-runtime";
5674
+ import { Fragment as Fragment8, jsx as jsx62, jsxs as jsxs41 } from "react/jsx-runtime";
5660
5675
  var MONTHS = [
5661
5676
  "January",
5662
5677
  "February",
@@ -5673,30 +5688,117 @@ var MONTHS = [
5673
5688
  ];
5674
5689
  var DAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
5675
5690
  var PRIMARY = "#0061E3";
5676
- var PANEL_W = 296;
5691
+ var CALENDAR_W = 296;
5692
+ var TIME_COL_W = 58;
5693
+ var TIME_ITEM_H = 28;
5694
+ var TIME_COL_H = 232;
5677
5695
  function daysInMonth(y, m) {
5678
5696
  return new Date(y, m + 1, 0).getDate();
5679
5697
  }
5680
5698
  function firstDayOf(y, m) {
5681
5699
  return new Date(y, m, 1).getDay();
5682
5700
  }
5683
- function parseYMD(s) {
5701
+ function pad(n) {
5702
+ return String(n).padStart(2, "0");
5703
+ }
5704
+ function parseValue(s) {
5684
5705
  if (!s) return null;
5685
- const [y, m, d] = s.split("-").map(Number);
5706
+ const [datePart, timePart = ""] = s.trim().split(/[ T]/);
5707
+ const [y, m, d] = datePart.split("-").map(Number);
5686
5708
  if (!y || !m || !d) return null;
5687
- return { y, m: m - 1, d };
5709
+ const [hh = 0, mm = 0, ss = 0] = timePart ? timePart.split(":").map(Number) : [];
5710
+ return {
5711
+ y,
5712
+ m: m - 1,
5713
+ d,
5714
+ hh: Number.isFinite(hh) ? hh : 0,
5715
+ mm: Number.isFinite(mm) ? mm : 0,
5716
+ ss: Number.isFinite(ss) ? ss : 0
5717
+ };
5718
+ }
5719
+ function parseYMD(s) {
5720
+ const p = parseValue(s);
5721
+ return p ? { y: p.y, m: p.m, d: p.d } : null;
5688
5722
  }
5689
5723
  function toYMD(y, m, d) {
5690
- return `${y}-${String(m + 1).padStart(2, "0")}-${String(d).padStart(2, "0")}`;
5724
+ return `${y}-${pad(m + 1)}-${pad(d)}`;
5725
+ }
5726
+ function formatValue(p, showTime, showSecond) {
5727
+ const date = toYMD(p.y, p.m, p.d);
5728
+ if (!showTime) return date;
5729
+ return showSecond ? `${date} ${pad(p.hh)}:${pad(p.mm)}:${pad(p.ss)}` : `${date} ${pad(p.hh)}:${pad(p.mm)}`;
5691
5730
  }
5692
- function displayDate(ymd) {
5693
- const p = parseYMD(ymd);
5731
+ function displayTime(p, showSecond) {
5732
+ const period = p.hh < 12 ? "AM" : "PM";
5733
+ const h12 = p.hh % 12 === 0 ? 12 : p.hh % 12;
5734
+ const base = showSecond ? `${pad(h12)}:${pad(p.mm)}:${pad(p.ss)}` : `${pad(h12)}:${pad(p.mm)}`;
5735
+ return `${base} ${period}`;
5736
+ }
5737
+ function displayValue(value, showTime, showSecond) {
5738
+ const p = parseValue(value);
5694
5739
  if (!p) return "";
5695
- return `${String(p.d).padStart(2, "0")} ${MONTHS[p.m].slice(0, 3)} ${p.y}`;
5740
+ const date = `${pad(p.d)} ${MONTHS[p.m].slice(0, 3)} ${p.y}`;
5741
+ return showTime ? `${date}, ${displayTime(p, showSecond)}` : date;
5742
+ }
5743
+ function step(n) {
5744
+ return Math.max(1, Math.floor(n ?? 1));
5696
5745
  }
5697
- function DatePicker({ value, onChange, placeholder = "Select date", className, min, max, label }) {
5746
+ function TimeColumn({
5747
+ label,
5748
+ items,
5749
+ selected,
5750
+ onSelect,
5751
+ render
5752
+ }) {
5753
+ const ref = useRef8(null);
5754
+ const index = items.indexOf(selected);
5755
+ useEffect8(() => {
5756
+ const el = ref.current;
5757
+ if (!el || index < 0) return;
5758
+ el.scrollTo({ top: index * TIME_ITEM_H, behavior: "smooth" });
5759
+ }, [index]);
5760
+ return /* @__PURE__ */ jsxs41("div", { className: "flex flex-col border-l border-border", style: { width: TIME_COL_W }, children: [
5761
+ /* @__PURE__ */ jsx62("div", { className: "py-1 text-center text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/70", children: label }),
5762
+ /* @__PURE__ */ jsxs41(
5763
+ "div",
5764
+ {
5765
+ ref,
5766
+ className: "overflow-y-auto",
5767
+ style: { height: TIME_COL_H, scrollbarWidth: "none", msOverflowStyle: "none" },
5768
+ children: [
5769
+ items.map((item) => {
5770
+ const active = item === selected;
5771
+ return /* @__PURE__ */ jsx62(
5772
+ "button",
5773
+ {
5774
+ type: "button",
5775
+ onClick: () => onSelect(item),
5776
+ className: cn(
5777
+ "flex w-full items-center justify-center rounded-md text-[13px] font-medium transition-colors",
5778
+ active ? "font-semibold text-white" : "text-foreground hover:bg-muted"
5779
+ ),
5780
+ style: { height: TIME_ITEM_H, background: active ? PRIMARY : void 0 },
5781
+ children: render ? render(item) : String(item)
5782
+ },
5783
+ String(item)
5784
+ );
5785
+ }),
5786
+ /* @__PURE__ */ jsx62("div", { style: { height: TIME_COL_H - TIME_ITEM_H } })
5787
+ ]
5788
+ }
5789
+ )
5790
+ ] });
5791
+ }
5792
+ function DatePicker({ value, onChange, placeholder = "Select date", className, min, max, label, showTime = false, showNow = true }) {
5698
5793
  const today = /* @__PURE__ */ new Date();
5699
- const parsed = parseYMD(value);
5794
+ const parsed = parseValue(value);
5795
+ const timeOptions = useMemo7(
5796
+ () => typeof showTime === "object" ? showTime : {},
5797
+ [showTime]
5798
+ );
5799
+ const withTime = showTime !== false && showTime !== void 0;
5800
+ const use12Hours = timeOptions.use12Hours ?? true;
5801
+ const showSecond = timeOptions.showSecond ?? false;
5700
5802
  const [open, setOpen] = useState12(false);
5701
5803
  const [panelPos, setPanelPos] = useState12({ top: 0, left: 0 });
5702
5804
  const [viewYear, setViewYear] = useState12(parsed?.y ?? today.getFullYear());
@@ -5715,34 +5817,39 @@ function DatePicker({ value, onChange, placeholder = "Select date", className, m
5715
5817
  setViewMonth(parsed.m);
5716
5818
  }
5717
5819
  }, [value]);
5820
+ const columnCount = withTime ? (showSecond ? 3 : 2) + (use12Hours ? 1 : 0) : 0;
5821
+ const PANEL_W2 = CALENDAR_W + columnCount * TIME_COL_W;
5822
+ const PANEL_H2 = withTime ? 392 : 340;
5718
5823
  function openPanel() {
5719
5824
  if (!triggerRef.current) return;
5720
5825
  const trigger = triggerRef.current;
5721
5826
  const vw = window.innerWidth;
5722
5827
  const vh = window.innerHeight;
5723
- const PANEL_H2 = 340;
5724
5828
  trigger.scrollIntoView({ block: "center", behavior: "auto" });
5725
5829
  requestAnimationFrame(() => {
5726
5830
  if (!triggerRef.current) return;
5727
5831
  const rect = triggerRef.current.getBoundingClientRect();
5728
5832
  let left = rect.left;
5729
- if (left + PANEL_W > vw - 8) left = vw - PANEL_W - 8;
5833
+ if (left + PANEL_W2 > vw - 8) left = vw - PANEL_W2 - 8;
5834
+ if (left < 8) left = 8;
5730
5835
  let top = rect.bottom + 6;
5731
5836
  if (top + PANEL_H2 > vh - 8) top = rect.top - PANEL_H2 - 6;
5837
+ if (top < 8) top = 8;
5732
5838
  setPanelPos({ top, left });
5733
5839
  setOpen(true);
5734
5840
  });
5735
5841
  }
5842
+ function closePanel() {
5843
+ setOpen(false);
5844
+ setYearMenu(false);
5845
+ setMonthMenu(false);
5846
+ }
5736
5847
  useEffect8(() => {
5737
5848
  if (!open) return;
5738
5849
  function handler(e) {
5739
5850
  const inTrigger = triggerRef.current?.contains(e.target);
5740
5851
  const inPanel = panelRef.current?.contains(e.target);
5741
- if (!inTrigger && !inPanel) {
5742
- setOpen(false);
5743
- setYearMenu(false);
5744
- setMonthMenu(false);
5745
- }
5852
+ if (!inTrigger && !inPanel) closePanel();
5746
5853
  }
5747
5854
  document.addEventListener("mousedown", handler);
5748
5855
  return () => document.removeEventListener("mousedown", handler);
@@ -5785,18 +5892,251 @@ function DatePicker({ value, onChange, placeholder = "Select date", className, m
5785
5892
  cells.push({ d, m, y, current: false });
5786
5893
  }
5787
5894
  const years = Array.from({ length: 15 }, (_, i) => today.getFullYear() - 2 + i);
5895
+ const fallback = parseValue(`2000-01-01 ${timeOptions.defaultValue ?? "00:00"}`);
5896
+ const current = parsed ?? {
5897
+ y: today.getFullYear(),
5898
+ m: today.getMonth(),
5899
+ d: today.getDate(),
5900
+ hh: fallback.hh,
5901
+ mm: fallback.mm,
5902
+ ss: fallback.ss
5903
+ };
5904
+ const emit = useCallback5(
5905
+ (next) => onChange(formatValue(next, withTime, showSecond)),
5906
+ [onChange, withTime, showSecond]
5907
+ );
5908
+ function patchTime(patch) {
5909
+ emit({ ...current, ...patch });
5910
+ }
5911
+ const hourStep = step(timeOptions.hourStep);
5912
+ const minuteStep = step(timeOptions.minuteStep);
5913
+ const secondStep = step(timeOptions.secondStep);
5914
+ const hourItems = use12Hours ? Array.from({ length: Math.ceil(12 / hourStep) }, (_, i) => i * hourStep % 12) : Array.from({ length: Math.ceil(24 / hourStep) }, (_, i) => i * hourStep);
5915
+ const minuteItems = Array.from({ length: Math.ceil(60 / minuteStep) }, (_, i) => i * minuteStep);
5916
+ const secondItems = Array.from({ length: Math.ceil(60 / secondStep) }, (_, i) => i * secondStep);
5917
+ const selectedHour = use12Hours ? current.hh % 12 : current.hh;
5918
+ const selectedMeridiem = current.hh < 12 ? "AM" : "PM";
5919
+ function selectHour(h) {
5920
+ if (!use12Hours) return patchTime({ hh: h });
5921
+ patchTime({ hh: selectedMeridiem === "AM" ? h : h + 12 });
5922
+ }
5923
+ function selectMeridiem(p) {
5924
+ const base = current.hh % 12;
5925
+ patchTime({ hh: p === "AM" ? base : base + 12 });
5926
+ }
5788
5927
  function selectDay(cell) {
5789
5928
  if (!cell.current) {
5790
5929
  setViewYear(cell.y);
5791
5930
  setViewMonth(cell.m);
5792
5931
  }
5793
5932
  if (cell.current && isDisabled(cell.y, cell.m, cell.d)) return;
5794
- onChange(toYMD(cell.y, cell.m, cell.d));
5795
- setOpen(false);
5933
+ emit({ y: cell.y, m: cell.m, d: cell.d, hh: current.hh, mm: current.mm, ss: current.ss });
5934
+ if (!withTime) setOpen(false);
5935
+ }
5936
+ function selectNow() {
5937
+ const n = /* @__PURE__ */ new Date();
5938
+ if (isDisabled(n.getFullYear(), n.getMonth(), n.getDate())) return;
5939
+ emit({
5940
+ y: n.getFullYear(),
5941
+ m: n.getMonth(),
5942
+ d: n.getDate(),
5943
+ hh: n.getHours(),
5944
+ mm: n.getMinutes(),
5945
+ ss: n.getSeconds()
5946
+ });
5947
+ closePanel();
5796
5948
  }
5797
5949
  const isToday = (c) => c.d === today.getDate() && c.m === today.getMonth() && c.y === today.getFullYear();
5798
5950
  const isSelected = (c) => !!parsed && c.d === parsed.d && c.m === parsed.m && c.y === parsed.y;
5799
- const panel = /* @__PURE__ */ jsx62(AnimatePresence, { children: open && /* @__PURE__ */ jsxs41(
5951
+ const calendar = /* @__PURE__ */ jsxs41("div", { style: { width: CALENDAR_W }, className: "flex flex-col", children: [
5952
+ /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between px-4 pt-4 pb-3", children: [
5953
+ /* @__PURE__ */ jsx62(
5954
+ "button",
5955
+ {
5956
+ type: "button",
5957
+ onClick: prevMonth,
5958
+ className: "w-8 h-8 rounded-full flex items-center justify-center text-muted-foreground hover:bg-muted transition-colors",
5959
+ children: /* @__PURE__ */ jsx62(ChevronLeft6, { className: "w-4 h-4" })
5960
+ }
5961
+ ),
5962
+ /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-1", children: [
5963
+ /* @__PURE__ */ jsxs41("div", { className: "relative", children: [
5964
+ /* @__PURE__ */ jsxs41(
5965
+ "button",
5966
+ {
5967
+ type: "button",
5968
+ onClick: () => {
5969
+ setMonthMenu((o) => !o);
5970
+ setYearMenu(false);
5971
+ },
5972
+ className: "flex items-center gap-1 px-2 py-1 rounded-lg text-[14px] font-semibold text-foreground hover:bg-muted transition-colors",
5973
+ children: [
5974
+ MONTHS[viewMonth].slice(0, 3),
5975
+ /* @__PURE__ */ jsx62(ChevronDown8, { className: "w-3 h-3 text-muted-foreground" })
5976
+ ]
5977
+ }
5978
+ ),
5979
+ /* @__PURE__ */ jsx62(AnimatePresence, { children: monthMenu && /* @__PURE__ */ jsx62(
5980
+ motion.div,
5981
+ {
5982
+ initial: { opacity: 0, y: -4 },
5983
+ animate: { opacity: 1, y: 0 },
5984
+ exit: { opacity: 0, y: -4 },
5985
+ transition: { duration: 0.12 },
5986
+ className: "absolute top-full left-0 z-[10000] mt-1 max-h-[220px] min-w-[130px] overflow-y-auto rounded-xl border border-border bg-popover py-1 shadow-lg",
5987
+ children: MONTHS.map((mn, mi) => /* @__PURE__ */ jsx62(
5988
+ "button",
5989
+ {
5990
+ type: "button",
5991
+ onClick: () => {
5992
+ setViewMonth(mi);
5993
+ setMonthMenu(false);
5994
+ },
5995
+ className: "w-full px-3 py-2 text-left text-[13px] text-foreground transition-colors hover:bg-muted",
5996
+ style: { fontWeight: mi === viewMonth ? 600 : 400, color: mi === viewMonth ? PRIMARY : void 0 },
5997
+ children: mn
5998
+ },
5999
+ mn
6000
+ ))
6001
+ }
6002
+ ) })
6003
+ ] }),
6004
+ /* @__PURE__ */ jsxs41("div", { className: "relative", children: [
6005
+ /* @__PURE__ */ jsxs41(
6006
+ "button",
6007
+ {
6008
+ type: "button",
6009
+ onClick: () => {
6010
+ setYearMenu((o) => !o);
6011
+ setMonthMenu(false);
6012
+ },
6013
+ className: "flex items-center gap-1 px-2 py-1 rounded-lg text-[14px] font-semibold text-foreground hover:bg-muted transition-colors",
6014
+ children: [
6015
+ viewYear,
6016
+ /* @__PURE__ */ jsx62(ChevronDown8, { className: "w-3 h-3 text-muted-foreground" })
6017
+ ]
6018
+ }
6019
+ ),
6020
+ /* @__PURE__ */ jsx62(AnimatePresence, { children: yearMenu && /* @__PURE__ */ jsx62(
6021
+ motion.div,
6022
+ {
6023
+ initial: { opacity: 0, y: -4 },
6024
+ animate: { opacity: 1, y: 0 },
6025
+ exit: { opacity: 0, y: -4 },
6026
+ transition: { duration: 0.12 },
6027
+ className: "absolute top-full left-0 z-[10000] mt-1 max-h-[200px] min-w-[90px] overflow-y-auto rounded-xl border border-border bg-popover py-1 shadow-lg",
6028
+ children: years.map((yr) => /* @__PURE__ */ jsx62(
6029
+ "button",
6030
+ {
6031
+ type: "button",
6032
+ onClick: () => {
6033
+ setViewYear(yr);
6034
+ setYearMenu(false);
6035
+ },
6036
+ className: "w-full px-3 py-2 text-left text-[13px] text-foreground transition-colors hover:bg-muted",
6037
+ style: { fontWeight: yr === viewYear ? 600 : 400, color: yr === viewYear ? PRIMARY : void 0 },
6038
+ children: yr
6039
+ },
6040
+ yr
6041
+ ))
6042
+ }
6043
+ ) })
6044
+ ] })
6045
+ ] }),
6046
+ /* @__PURE__ */ jsx62(
6047
+ "button",
6048
+ {
6049
+ type: "button",
6050
+ onClick: nextMonth,
6051
+ className: "w-8 h-8 rounded-full flex items-center justify-center text-muted-foreground hover:bg-muted transition-colors",
6052
+ children: /* @__PURE__ */ jsx62(ChevronRight8, { className: "w-4 h-4" })
6053
+ }
6054
+ )
6055
+ ] }),
6056
+ /* @__PURE__ */ jsx62(
6057
+ "div",
6058
+ {
6059
+ className: "px-3 pb-1",
6060
+ style: { display: "grid", gridTemplateColumns: "repeat(7, minmax(0, 1fr))" },
6061
+ children: DAYS.map((d) => /* @__PURE__ */ jsx62("div", { className: "py-1 text-center text-[11.5px] font-semibold text-muted-foreground", children: d }, d))
6062
+ }
6063
+ ),
6064
+ /* @__PURE__ */ jsx62(
6065
+ "div",
6066
+ {
6067
+ className: "gap-y-0.5 px-3 pb-4",
6068
+ style: { display: "grid", gridTemplateColumns: "repeat(7, minmax(0, 1fr))" },
6069
+ children: cells.map((cell, i) => {
6070
+ const selected = isSelected(cell);
6071
+ const tod = isToday(cell);
6072
+ const disabled = cell.current && isDisabled(cell.y, cell.m, cell.d);
6073
+ return /* @__PURE__ */ jsx62(
6074
+ "button",
6075
+ {
6076
+ type: "button",
6077
+ onClick: () => selectDay(cell),
6078
+ disabled,
6079
+ className: cn(
6080
+ "h-9 w-9 mx-auto rounded-full text-[13px] font-medium flex items-center justify-center transition-all",
6081
+ selected && "text-white font-semibold",
6082
+ !selected && tod && "font-semibold",
6083
+ !selected && !tod && cell.current && !disabled && "text-gray-800 hover:bg-gray-100",
6084
+ !selected && !cell.current && "text-gray-300 hover:bg-gray-50",
6085
+ disabled && "opacity-30 cursor-not-allowed"
6086
+ ),
6087
+ style: selected ? { background: PRIMARY } : tod ? { background: `${PRIMARY}18`, color: PRIMARY } : {},
6088
+ children: cell.d
6089
+ },
6090
+ i
6091
+ );
6092
+ })
6093
+ }
6094
+ )
6095
+ ] });
6096
+ const timeColumns = withTime && /* @__PURE__ */ jsxs41("div", { className: "flex pt-3", children: [
6097
+ /* @__PURE__ */ jsx62(
6098
+ TimeColumn,
6099
+ {
6100
+ label: "Hr",
6101
+ items: hourItems,
6102
+ selected: selectedHour,
6103
+ onSelect: selectHour,
6104
+ render: (h) => pad(use12Hours && h === 0 ? 12 : h)
6105
+ }
6106
+ ),
6107
+ /* @__PURE__ */ jsx62(TimeColumn, { label: "Min", items: minuteItems, selected: current.mm, onSelect: (m) => patchTime({ mm: m }), render: pad }),
6108
+ showSecond && /* @__PURE__ */ jsx62(TimeColumn, { label: "Sec", items: secondItems, selected: current.ss, onSelect: (s) => patchTime({ ss: s }), render: pad }),
6109
+ use12Hours && /* @__PURE__ */ jsx62(TimeColumn, { label: "AM/PM", items: ["AM", "PM"], selected: selectedMeridiem, onSelect: selectMeridiem })
6110
+ ] });
6111
+ const body = /* @__PURE__ */ jsxs41(Fragment8, { children: [
6112
+ /* @__PURE__ */ jsxs41("div", { className: "flex", children: [
6113
+ calendar,
6114
+ timeColumns
6115
+ ] }),
6116
+ withTime && /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between border-t border-border px-4 py-2.5", children: [
6117
+ showNow ? /* @__PURE__ */ jsx62(
6118
+ "button",
6119
+ {
6120
+ type: "button",
6121
+ onClick: selectNow,
6122
+ className: "rounded-md px-1 text-[13px] font-medium transition-colors hover:underline",
6123
+ style: { color: PRIMARY },
6124
+ children: "Now"
6125
+ }
6126
+ ) : /* @__PURE__ */ jsx62("span", {}),
6127
+ /* @__PURE__ */ jsx62(
6128
+ "button",
6129
+ {
6130
+ type: "button",
6131
+ onClick: closePanel,
6132
+ className: "rounded-lg px-3 py-1.5 text-[13px] font-semibold text-white transition-opacity hover:opacity-90",
6133
+ style: { background: PRIMARY },
6134
+ children: "OK"
6135
+ }
6136
+ )
6137
+ ] })
6138
+ ] });
6139
+ const panel = /* @__PURE__ */ jsx62(AnimatePresence, { children: open && /* @__PURE__ */ jsx62(
5800
6140
  motion.div,
5801
6141
  {
5802
6142
  ref: panelRef,
@@ -5809,149 +6149,21 @@ function DatePicker({ value, onChange, placeholder = "Select date", className, m
5809
6149
  position: "fixed",
5810
6150
  top: panelPos.top,
5811
6151
  left: panelPos.left,
5812
- width: PANEL_W,
6152
+ width: PANEL_W2,
5813
6153
  zIndex: 2e4,
6154
+ // A modal Radix Dialog sets `pointer-events: none` on <body> while
6155
+ // it is open, and this panel is portaled to <body> — so without
6156
+ // this every click on a day landed on nothing and the calendar
6157
+ // looked frozen inside a Dialog or Drawer. Hit-testing is
6158
+ // per-element, so re-enabling it here is enough; the page behind
6159
+ // the dialog stays inert. The click still reaches the dialog's
6160
+ // DismissableLayer through React's portal event propagation, so it
6161
+ // is treated as inside and does not dismiss the dialog.
6162
+ pointerEvents: "auto",
5814
6163
  backgroundColor: "var(--popover)",
5815
6164
  boxShadow: "0 16px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.07)"
5816
6165
  },
5817
- children: [
5818
- /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between px-4 pt-4 pb-3", children: [
5819
- /* @__PURE__ */ jsx62(
5820
- "button",
5821
- {
5822
- onClick: prevMonth,
5823
- className: "w-8 h-8 rounded-full flex items-center justify-center text-gray-500 hover:bg-gray-100 transition-colors",
5824
- children: /* @__PURE__ */ jsx62(ChevronLeft6, { className: "w-4 h-4" })
5825
- }
5826
- ),
5827
- /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-1", children: [
5828
- /* @__PURE__ */ jsxs41("div", { className: "relative", children: [
5829
- /* @__PURE__ */ jsxs41(
5830
- "button",
5831
- {
5832
- onClick: () => {
5833
- setMonthMenu((o) => !o);
5834
- setYearMenu(false);
5835
- },
5836
- className: "flex items-center gap-1 px-2 py-1 rounded-lg text-[14px] font-semibold text-gray-900 hover:bg-gray-100 transition-colors",
5837
- children: [
5838
- MONTHS[viewMonth].slice(0, 3),
5839
- /* @__PURE__ */ jsx62(ChevronDown8, { className: "w-3 h-3 text-gray-400" })
5840
- ]
5841
- }
5842
- ),
5843
- /* @__PURE__ */ jsx62(AnimatePresence, { children: monthMenu && /* @__PURE__ */ jsx62(
5844
- motion.div,
5845
- {
5846
- initial: { opacity: 0, y: -4 },
5847
- animate: { opacity: 1, y: 0 },
5848
- exit: { opacity: 0, y: -4 },
5849
- transition: { duration: 0.12 },
5850
- className: "absolute top-full left-0 z-[10000] mt-1 max-h-[220px] min-w-[130px] overflow-y-auto rounded-xl border border-border bg-popover py-1 shadow-lg",
5851
- children: MONTHS.map((mn, mi) => /* @__PURE__ */ jsx62(
5852
- "button",
5853
- {
5854
- onClick: () => {
5855
- setViewMonth(mi);
5856
- setMonthMenu(false);
5857
- },
5858
- className: "w-full px-3 py-2 text-left text-[13px] text-foreground transition-colors hover:bg-muted",
5859
- style: { fontWeight: mi === viewMonth ? 600 : 400, color: mi === viewMonth ? PRIMARY : void 0 },
5860
- children: mn
5861
- },
5862
- mn
5863
- ))
5864
- }
5865
- ) })
5866
- ] }),
5867
- /* @__PURE__ */ jsxs41("div", { className: "relative", children: [
5868
- /* @__PURE__ */ jsxs41(
5869
- "button",
5870
- {
5871
- onClick: () => {
5872
- setYearMenu((o) => !o);
5873
- setMonthMenu(false);
5874
- },
5875
- className: "flex items-center gap-1 px-2 py-1 rounded-lg text-[14px] font-semibold text-gray-900 hover:bg-gray-100 transition-colors",
5876
- children: [
5877
- viewYear,
5878
- /* @__PURE__ */ jsx62(ChevronDown8, { className: "w-3 h-3 text-gray-400" })
5879
- ]
5880
- }
5881
- ),
5882
- /* @__PURE__ */ jsx62(AnimatePresence, { children: yearMenu && /* @__PURE__ */ jsx62(
5883
- motion.div,
5884
- {
5885
- initial: { opacity: 0, y: -4 },
5886
- animate: { opacity: 1, y: 0 },
5887
- exit: { opacity: 0, y: -4 },
5888
- transition: { duration: 0.12 },
5889
- className: "absolute top-full left-0 z-[10000] mt-1 max-h-[200px] min-w-[90px] overflow-y-auto rounded-xl border border-border bg-popover py-1 shadow-lg",
5890
- children: years.map((yr) => /* @__PURE__ */ jsx62(
5891
- "button",
5892
- {
5893
- onClick: () => {
5894
- setViewYear(yr);
5895
- setYearMenu(false);
5896
- },
5897
- className: "w-full px-3 py-2 text-left text-[13px] text-foreground transition-colors hover:bg-muted",
5898
- style: { fontWeight: yr === viewYear ? 600 : 400, color: yr === viewYear ? PRIMARY : void 0 },
5899
- children: yr
5900
- },
5901
- yr
5902
- ))
5903
- }
5904
- ) })
5905
- ] })
5906
- ] }),
5907
- /* @__PURE__ */ jsx62(
5908
- "button",
5909
- {
5910
- onClick: nextMonth,
5911
- className: "w-8 h-8 rounded-full flex items-center justify-center text-gray-500 hover:bg-gray-100 transition-colors",
5912
- children: /* @__PURE__ */ jsx62(ChevronRight8, { className: "w-4 h-4" })
5913
- }
5914
- )
5915
- ] }),
5916
- /* @__PURE__ */ jsx62(
5917
- "div",
5918
- {
5919
- className: "px-3 pb-1",
5920
- style: { display: "grid", gridTemplateColumns: "repeat(7, minmax(0, 1fr))" },
5921
- children: DAYS.map((d) => /* @__PURE__ */ jsx62("div", { className: "py-1 text-center text-[11.5px] font-semibold text-muted-foreground", children: d }, d))
5922
- }
5923
- ),
5924
- /* @__PURE__ */ jsx62(
5925
- "div",
5926
- {
5927
- className: "gap-y-0.5 px-3 pb-4",
5928
- style: { display: "grid", gridTemplateColumns: "repeat(7, minmax(0, 1fr))" },
5929
- children: cells.map((cell, i) => {
5930
- const selected = isSelected(cell);
5931
- const tod = isToday(cell);
5932
- const disabled = cell.current && isDisabled(cell.y, cell.m, cell.d);
5933
- return /* @__PURE__ */ jsx62(
5934
- "button",
5935
- {
5936
- onClick: () => selectDay(cell),
5937
- disabled,
5938
- className: cn(
5939
- "h-9 w-9 mx-auto rounded-full text-[13px] font-medium flex items-center justify-center transition-all",
5940
- selected && "text-white font-semibold",
5941
- !selected && tod && "font-semibold",
5942
- !selected && !tod && cell.current && !disabled && "text-gray-800 hover:bg-gray-100",
5943
- !selected && !cell.current && "text-gray-300 hover:bg-gray-50",
5944
- disabled && "opacity-30 cursor-not-allowed"
5945
- ),
5946
- style: selected ? { background: PRIMARY } : tod ? { background: `${PRIMARY}18`, color: PRIMARY } : {},
5947
- children: cell.d
5948
- },
5949
- i
5950
- );
5951
- })
5952
- }
5953
- )
5954
- ]
6166
+ children: withTime ? /* @__PURE__ */ jsx62(RemoveScroll, { allowPinchZoom: true, children: body }) : body
5955
6167
  }
5956
6168
  ) });
5957
6169
  return /* @__PURE__ */ jsxs41("div", { className: cn("relative", className), children: [
@@ -5961,14 +6173,14 @@ function DatePicker({ value, onChange, placeholder = "Select date", className, m
5961
6173
  {
5962
6174
  ref: triggerRef,
5963
6175
  type: "button",
5964
- onClick: () => open ? setOpen(false) : openPanel(),
6176
+ onClick: () => open ? closePanel() : openPanel(),
5965
6177
  className: cn(
5966
6178
  "flex h-12 min-h-12 w-full items-center gap-3 rounded-xl border border-border bg-card px-5 text-left text-[15px] shadow-sm transition-colors",
5967
6179
  open ? "border-ring ring-2 ring-ring/20" : "hover:border-muted-foreground/45"
5968
6180
  ),
5969
6181
  children: [
5970
6182
  /* @__PURE__ */ jsx62(CalendarDays, { className: "size-[1.125rem] shrink-0 text-muted-foreground" }),
5971
- /* @__PURE__ */ jsx62("span", { className: cn("flex-1", value ? "text-foreground" : "text-muted-foreground"), children: value ? displayDate(value) : placeholder }),
6183
+ /* @__PURE__ */ jsx62("span", { className: cn("flex-1", value ? "text-foreground" : "text-muted-foreground"), children: value ? displayValue(value, withTime, showSecond) : placeholder }),
5972
6184
  /* @__PURE__ */ jsx62(ChevronDown8, { className: cn("size-[1.125rem] shrink-0 text-muted-foreground transition-transform", open && "rotate-180") })
5973
6185
  ]
5974
6186
  }
@@ -5980,7 +6192,7 @@ function DatePicker({ value, onChange, placeholder = "Select date", className, m
5980
6192
  // src/chart.tsx
5981
6193
  import * as React41 from "react";
5982
6194
  import * as RechartsPrimitive from "recharts";
5983
- import { Fragment as Fragment8, jsx as jsx63, jsxs as jsxs42 } from "react/jsx-runtime";
6195
+ import { Fragment as Fragment9, jsx as jsx63, jsxs as jsxs42 } from "react/jsx-runtime";
5984
6196
  var THEMES = { light: "", dark: ".dark" };
5985
6197
  var INITIAL_DIMENSION = { width: 320, height: 200 };
5986
6198
  var ChartContext = React41.createContext(null);
@@ -6114,7 +6326,7 @@ function ChartTooltipContent({
6114
6326
  "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
6115
6327
  indicator === "dot" && "items-center"
6116
6328
  ),
6117
- children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs42(Fragment8, { children: [
6329
+ children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs42(Fragment9, { children: [
6118
6330
  itemConfig?.icon ? /* @__PURE__ */ jsx63(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx63(
6119
6331
  "div",
6120
6332
  {
@@ -6241,7 +6453,7 @@ import {
6241
6453
  Info as Info5,
6242
6454
  Minus as Minus2
6243
6455
  } from "lucide-react";
6244
- import { Fragment as Fragment9, jsx as jsx64, jsxs as jsxs43 } from "react/jsx-runtime";
6456
+ import { Fragment as Fragment10, jsx as jsx64, jsxs as jsxs43 } from "react/jsx-runtime";
6245
6457
  var gridStroke = "color-mix(in srgb, var(--border) 65%, transparent)";
6246
6458
  var tickFill = "var(--muted-foreground)";
6247
6459
  function MetricSparklineCard({
@@ -6406,7 +6618,7 @@ function DashboardAreaChartTemplate({
6406
6618
  }
6407
6619
  ) : null
6408
6620
  ] }) }) }),
6409
- footer ? /* @__PURE__ */ jsxs43(Fragment9, { children: [
6621
+ footer ? /* @__PURE__ */ jsxs43(Fragment10, { children: [
6410
6622
  /* @__PURE__ */ jsx64(Separator, {}),
6411
6623
  /* @__PURE__ */ jsx64("div", { className: "px-5 py-3", children: footer })
6412
6624
  ] }) : null
@@ -6653,7 +6865,7 @@ function Toaster({ theme, ...props }) {
6653
6865
  // src/inline-edit.tsx
6654
6866
  import * as React43 from "react";
6655
6867
  import { Check as Check10, Pencil, X as X8 } from "lucide-react";
6656
- import { Fragment as Fragment10, jsx as jsx66, jsxs as jsxs44 } from "react/jsx-runtime";
6868
+ import { Fragment as Fragment11, jsx as jsx66, jsxs as jsxs44 } from "react/jsx-runtime";
6657
6869
  var InlineEdit = React43.forwardRef(
6658
6870
  ({
6659
6871
  value,
@@ -6727,7 +6939,7 @@ var InlineEdit = React43.forwardRef(
6727
6939
  "disabled:cursor-not-allowed disabled:opacity-50",
6728
6940
  inputClassName
6729
6941
  );
6730
- return /* @__PURE__ */ jsx66("div", { ref, "data-inline-edit": "", className: "relative inline-flex flex-col gap-1 max-w-full", children: editing ? /* @__PURE__ */ jsxs44(Fragment10, { children: [
6942
+ return /* @__PURE__ */ jsx66("div", { ref, "data-inline-edit": "", className: "relative inline-flex flex-col gap-1 max-w-full", children: editing ? /* @__PURE__ */ jsxs44(Fragment11, { children: [
6731
6943
  multiline ? /* @__PURE__ */ jsx66(
6732
6944
  "textarea",
6733
6945
  {
@@ -7277,7 +7489,7 @@ function useBreakpoint() {
7277
7489
  import * as React47 from "react";
7278
7490
  import * as PopoverPrimitive4 from "@radix-ui/react-popover";
7279
7491
  import { Check as Check11, ChevronDown as ChevronDown9, Search as Search4 } from "lucide-react";
7280
- import { Fragment as Fragment11, jsx as jsx70, jsxs as jsxs47 } from "react/jsx-runtime";
7492
+ import { Fragment as Fragment12, jsx as jsx70, jsxs as jsxs47 } from "react/jsx-runtime";
7281
7493
  var COUNTRIES = [
7282
7494
  { code: "US", name: "United States", flag: "\u{1F1FA}\u{1F1F8}", dialCode: "+1" },
7283
7495
  { code: "GB", name: "United Kingdom", flag: "\u{1F1EC}\u{1F1E7}", dialCode: "+44" },
@@ -7359,7 +7571,7 @@ var CountrySelect = React47.forwardRef(
7359
7571
  className
7360
7572
  ),
7361
7573
  children: [
7362
- /* @__PURE__ */ jsx70("span", { className: "flex min-w-0 items-center gap-2.5", children: selected ? /* @__PURE__ */ jsxs47(Fragment11, { children: [
7574
+ /* @__PURE__ */ jsx70("span", { className: "flex min-w-0 items-center gap-2.5", children: selected ? /* @__PURE__ */ jsxs47(Fragment12, { children: [
7363
7575
  /* @__PURE__ */ jsx70("span", { className: "text-base leading-none", "aria-hidden": "true", children: selected.flag }),
7364
7576
  /* @__PURE__ */ jsx70("span", { className: "truncate", children: selected.name }),
7365
7577
  showDialCode && /* @__PURE__ */ jsx70("span", { className: "shrink-0 text-muted-foreground", children: selected.dialCode })
@@ -7538,9 +7750,10 @@ IconButton.displayName = "IconButton";
7538
7750
  // src/time-picker.tsx
7539
7751
  import * as React48 from "react";
7540
7752
  import { createPortal as createPortal2 } from "react-dom";
7753
+ import { RemoveScroll as RemoveScroll2 } from "react-remove-scroll";
7541
7754
  import { Clock as Clock2, ChevronDown as ChevronDown10, X as X11 } from "lucide-react";
7542
- import { Fragment as Fragment12, jsx as jsx72, jsxs as jsxs48 } from "react/jsx-runtime";
7543
- function pad(n) {
7755
+ import { Fragment as Fragment13, jsx as jsx72, jsxs as jsxs48 } from "react/jsx-runtime";
7756
+ function pad2(n) {
7544
7757
  return String(n).padStart(2, "0");
7545
7758
  }
7546
7759
  function parseHHMM(v) {
@@ -7553,15 +7766,15 @@ function parseHHMM(v) {
7553
7766
  return { h, m };
7554
7767
  }
7555
7768
  function toHHMM(h, m) {
7556
- return `${pad(h)}:${pad(m)}`;
7769
+ return `${pad2(h)}:${pad2(m)}`;
7557
7770
  }
7558
- function displayTime(value, use24Hour) {
7771
+ function displayTime2(value, use24Hour) {
7559
7772
  const p = parseHHMM(value);
7560
7773
  if (!p) return "";
7561
- if (use24Hour) return `${pad(p.h)}:${pad(p.m)}`;
7774
+ if (use24Hour) return `${pad2(p.h)}:${pad2(p.m)}`;
7562
7775
  const period = p.h < 12 ? "AM" : "PM";
7563
7776
  const displayH = p.h % 12 === 0 ? 12 : p.h % 12;
7564
- return `${pad(displayH)}:${pad(p.m)} ${period}`;
7777
+ return `${pad2(displayH)}:${pad2(p.m)} ${period}`;
7565
7778
  }
7566
7779
  var ITEM_H = 36;
7567
7780
  var VISIBLE = 5;
@@ -7665,7 +7878,7 @@ function ScrollColumn({
7665
7878
  )
7666
7879
  ] });
7667
7880
  }
7668
- var PANEL_W2 = 224;
7881
+ var PANEL_W = 224;
7669
7882
  var PANEL_H = 220;
7670
7883
  var TimePicker = React48.forwardRef(
7671
7884
  ({
@@ -7719,7 +7932,7 @@ var TimePicker = React48.forwardRef(
7719
7932
  const vw = window.innerWidth;
7720
7933
  const vh = window.innerHeight;
7721
7934
  let left = rect.left;
7722
- if (left + PANEL_W2 > vw - 8) left = vw - PANEL_W2 - 8;
7935
+ if (left + PANEL_W > vw - 8) left = vw - PANEL_W - 8;
7723
7936
  let top = rect.bottom + 6;
7724
7937
  if (top + PANEL_H > vh - 8) top = rect.top - PANEL_H - 6;
7725
7938
  setPanelPos({ top, left });
@@ -7762,7 +7975,7 @@ var TimePicker = React48.forwardRef(
7762
7975
  e.stopPropagation();
7763
7976
  onValueChange("");
7764
7977
  }
7765
- const panel = open ? /* @__PURE__ */ jsxs48(
7978
+ const panel = open ? /* @__PURE__ */ jsx72(RemoveScroll2, { allowPinchZoom: true, children: /* @__PURE__ */ jsxs48(
7766
7979
  "div",
7767
7980
  {
7768
7981
  ref: panelRef,
@@ -7774,13 +7987,17 @@ var TimePicker = React48.forwardRef(
7774
7987
  position: "fixed",
7775
7988
  top: panelPos.top,
7776
7989
  left: panelPos.left,
7777
- width: PANEL_W2,
7778
- zIndex: 2e4
7990
+ width: PANEL_W,
7991
+ zIndex: 2e4,
7992
+ // See DatePicker: a modal Radix Dialog puts `pointer-events: none`
7993
+ // on <body>, which this portaled panel would otherwise inherit —
7994
+ // the columns rendered but no row could be clicked.
7995
+ pointerEvents: "auto"
7779
7996
  },
7780
7997
  children: [
7781
7998
  /* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-1.5 border-b border-border px-4 py-2.5", children: [
7782
7999
  /* @__PURE__ */ jsx72(Clock2, { className: "size-3.5 text-muted-foreground" }),
7783
- /* @__PURE__ */ jsx72("span", { className: "text-[13px] font-medium text-muted-foreground", children: value ? displayTime(value, use24Hour) : "\u2014" })
8000
+ /* @__PURE__ */ jsx72("span", { className: "text-[13px] font-medium text-muted-foreground", children: value ? displayTime2(value, use24Hour) : "\u2014" })
7784
8001
  ] }),
7785
8002
  /* @__PURE__ */ jsxs48(
7786
8003
  "div",
@@ -7801,7 +8018,7 @@ var TimePicker = React48.forwardRef(
7801
8018
  items: hours,
7802
8019
  selected: hour,
7803
8020
  onSelect: handleHourChange,
7804
- renderItem: (h) => pad(h),
8021
+ renderItem: (h) => pad2(h),
7805
8022
  getKey: (h) => h
7806
8023
  }
7807
8024
  ),
@@ -7812,11 +8029,11 @@ var TimePicker = React48.forwardRef(
7812
8029
  items: minutes,
7813
8030
  selected: minute,
7814
8031
  onSelect: handleMinuteChange,
7815
- renderItem: (m) => pad(m),
8032
+ renderItem: (m) => pad2(m),
7816
8033
  getKey: (m) => m
7817
8034
  }
7818
8035
  ),
7819
- !use24Hour && /* @__PURE__ */ jsxs48(Fragment12, { children: [
8036
+ !use24Hour && /* @__PURE__ */ jsxs48(Fragment13, { children: [
7820
8037
  /* @__PURE__ */ jsx72("div", { className: "w-px self-stretch bg-border mx-1" }),
7821
8038
  /* @__PURE__ */ jsx72(
7822
8039
  ScrollColumn,
@@ -7832,7 +8049,7 @@ var TimePicker = React48.forwardRef(
7832
8049
  ] })
7833
8050
  ]
7834
8051
  }
7835
- ) : null;
8052
+ ) }) : null;
7836
8053
  function mergeRef(el) {
7837
8054
  triggerRef.current = el;
7838
8055
  if (typeof ref === "function") ref(el);
@@ -7864,7 +8081,7 @@ var TimePicker = React48.forwardRef(
7864
8081
  "flex-1 truncate",
7865
8082
  value ? "text-foreground" : "text-muted-foreground"
7866
8083
  ),
7867
- children: value ? displayTime(value, use24Hour) : placeholder
8084
+ children: value ? displayTime2(value, use24Hour) : placeholder
7868
8085
  }
7869
8086
  ),
7870
8087
  value && !disabled ? /* @__PURE__ */ jsx72(
@@ -8132,11 +8349,11 @@ VisuallyHidden.displayName = "VisuallyHidden";
8132
8349
  import {
8133
8350
  createContext as createContext5,
8134
8351
  forwardRef as forwardRef55,
8135
- useCallback as useCallback10,
8352
+ useCallback as useCallback11,
8136
8353
  useContext as useContext4,
8137
8354
  useEffect as useEffect15,
8138
8355
  useId as useId3,
8139
- useMemo as useMemo9,
8356
+ useMemo as useMemo10,
8140
8357
  useRef as useRef14,
8141
8358
  useState as useState19
8142
8359
  } from "react";
@@ -8235,7 +8452,7 @@ function formatMonthLabel(monthKey2) {
8235
8452
  }
8236
8453
 
8237
8454
  // src/filter-chips.tsx
8238
- import { Fragment as Fragment13, jsx as jsx76, jsxs as jsxs50 } from "react/jsx-runtime";
8455
+ import { Fragment as Fragment14, jsx as jsx76, jsxs as jsxs50 } from "react/jsx-runtime";
8239
8456
  var POPOVER_FIT = "flex max-h-[var(--radix-popover-content-available-height)] flex-col overflow-hidden";
8240
8457
  var FILTER_SCROLL_AREA = "min-h-0 flex-1 overflow-y-auto";
8241
8458
  var FilterChipGroupContext = createContext5(null);
@@ -8247,11 +8464,11 @@ function FilterChipGroup({
8247
8464
  const openKeyRef = useRef14(null);
8248
8465
  const frameRef = useRef14(null);
8249
8466
  const handoffFromRef = useRef14(null);
8250
- const apply = useCallback10((next) => {
8467
+ const apply = useCallback11((next) => {
8251
8468
  openKeyRef.current = next;
8252
8469
  setOpenKey(next);
8253
8470
  }, []);
8254
- const setOpen = useCallback10(
8471
+ const setOpen = useCallback11(
8255
8472
  (key, open) => {
8256
8473
  if (frameRef.current !== null) {
8257
8474
  cancelAnimationFrame(frameRef.current);
@@ -8280,12 +8497,12 @@ function FilterChipGroup({
8280
8497
  },
8281
8498
  []
8282
8499
  );
8283
- const consumeHandoff = useCallback10((key) => {
8500
+ const consumeHandoff = useCallback11((key) => {
8284
8501
  if (handoffFromRef.current !== key) return false;
8285
8502
  handoffFromRef.current = null;
8286
8503
  return true;
8287
8504
  }, []);
8288
- const value = useMemo9(
8505
+ const value = useMemo10(
8289
8506
  () => ({ openKey, setOpen, consumeHandoff }),
8290
8507
  [openKey, setOpen, consumeHandoff]
8291
8508
  );
@@ -8295,7 +8512,7 @@ function useFilterChipState(key, controlled) {
8295
8512
  const group = useContext4(FilterChipGroupContext);
8296
8513
  const [localOpen, setLocalOpen] = useState19(false);
8297
8514
  const isControlled = controlled?.open !== void 0;
8298
- const onOpenChange = useCallback10(
8515
+ const onOpenChange = useCallback11(
8299
8516
  (next) => {
8300
8517
  controlled?.onOpenChange?.(next);
8301
8518
  if (isControlled) return;
@@ -8305,7 +8522,7 @@ function useFilterChipState(key, controlled) {
8305
8522
  [controlled, isControlled, group, key]
8306
8523
  );
8307
8524
  const open = isControlled ? controlled.open : group ? group.openKey === key : localOpen;
8308
- const onCloseAutoFocus = useCallback10(
8525
+ const onCloseAutoFocus = useCallback11(
8309
8526
  (event) => {
8310
8527
  if (group?.consumeHandoff(key)) {
8311
8528
  event.preventDefault();
@@ -8469,7 +8686,7 @@ function SelectFilterChip({
8469
8686
  const [query, setQuery] = useState19("");
8470
8687
  const supportsInvert = !!onInvertChange;
8471
8688
  const isActive = selected.length > 0;
8472
- const visible = useMemo9(() => {
8689
+ const visible = useMemo10(() => {
8473
8690
  const q = query.trim().toLowerCase();
8474
8691
  if (!q) return options;
8475
8692
  return options.filter(
@@ -8746,7 +8963,7 @@ function DateRangeFilterChip({
8746
8963
  className: "h-8 text-[12.5px]"
8747
8964
  }
8748
8965
  )
8749
- ] }, unit.key)) }) : /* @__PURE__ */ jsxs50(Fragment13, { children: [
8966
+ ] }, unit.key)) }) : /* @__PURE__ */ jsxs50(Fragment14, { children: [
8750
8967
  /* @__PURE__ */ jsxs50("div", { className: "space-y-1", children: [
8751
8968
  /* @__PURE__ */ jsx76("p", { className: "text-[11px] font-medium text-muted-foreground", children: "From" }),
8752
8969
  /* @__PURE__ */ jsx76(
@@ -9107,7 +9324,7 @@ function AddFilterMenu({
9107
9324
  const listRef = useRef14(null);
9108
9325
  const listId = useId3();
9109
9326
  const q = query.trim().toLowerCase();
9110
- const rows = useMemo9(() => {
9327
+ const rows = useMemo10(() => {
9111
9328
  const out = [];
9112
9329
  if (q) {
9113
9330
  const valueMatches = filters.flatMap(
@@ -9143,7 +9360,7 @@ function AddFilterMenu({
9143
9360
  }
9144
9361
  return out;
9145
9362
  }, [filters, q, onSelectValue, onRemoveFilter]);
9146
- const selectable = useMemo9(
9363
+ const selectable = useMemo10(
9147
9364
  () => rows.map((r, i) => r.kind === "heading" ? -1 : i).filter((i) => i >= 0),
9148
9365
  [rows]
9149
9366
  );
@@ -9265,11 +9482,11 @@ function AddFilterMenu({
9265
9482
  "flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-[12.5px] text-foreground",
9266
9483
  i === cursor && "bg-muted"
9267
9484
  ),
9268
- children: row.kind === "value" ? /* @__PURE__ */ jsxs50(Fragment13, { children: [
9485
+ children: row.kind === "value" ? /* @__PURE__ */ jsxs50(Fragment14, { children: [
9269
9486
  row.option.icon,
9270
9487
  /* @__PURE__ */ jsx76("span", { className: "min-w-0 flex-1 truncate", children: row.option.label }),
9271
9488
  /* @__PURE__ */ jsx76("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: row.filter.label })
9272
- ] }) : /* @__PURE__ */ jsxs50(Fragment13, { children: [
9489
+ ] }) : /* @__PURE__ */ jsxs50(Fragment14, { children: [
9273
9490
  /* @__PURE__ */ jsx76("span", { className: "min-w-0 flex-1 truncate", children: row.filter.label }),
9274
9491
  row.filter.activeCount ? /* @__PURE__ */ jsx76("span", { className: "shrink-0 rounded-full bg-primary/15 px-1.5 text-[10px] font-semibold tabular-nums text-primary", children: row.filter.activeCount }) : null,
9275
9492
  visibleKeys.includes(row.filter.key) ? /* @__PURE__ */ jsx76(