@j3m-quantum/ui 1.12.1 → 2.1.0

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
@@ -1,4 +1,4 @@
1
- import * as React29 from 'react';
1
+ import * as React27 from 'react';
2
2
  import { createContext, memo, useContext, useMemo, useId, useCallback, useState, useEffect, useRef } from 'react';
3
3
  import { Slot } from '@radix-ui/react-slot';
4
4
  import { cva } from 'class-variance-authority';
@@ -7,7 +7,7 @@ import { twMerge } from 'tailwind-merge';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
9
9
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
10
- import { SearchIcon, TrashIcon, CheckIcon, CircleIcon, ChevronDownIcon, ChevronUpIcon, ChevronRightIcon, ChevronLeftIcon, ArrowLeft, ArrowRight, Check, Loader2Icon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, ChevronRight, MoreHorizontal, MoreHorizontalIcon, XIcon, GripVerticalIcon, PanelLeftIcon, ArrowDown, ArrowUp, ChevronsUpDown, EyeOff, ChevronsLeft, ChevronLeft, ChevronsRight, Settings2, FolderIcon, ShareIcon, ChevronsUpDownIcon, SparklesIcon, BadgeCheckIcon, CreditCardIcon, BellIcon, LogOutIcon, X, Flag, Factory, Truck, MessageSquare, ChevronDown, Plus, Send, MessageSquarePlus, AlertTriangle, CheckCircle, Calendar as Calendar$1, MapPin, Package, User, Clock, CalendarX2, List, Columns, Grid2x2, Grid3x3, CalendarRange, Settings, Info, Moon, PlusIcon, PencilIcon, CopyIcon, ArrowUpDown, CheckCircle2, XCircle, Search, FileText } from 'lucide-react';
10
+ import { SearchIcon, TrashIcon, CheckIcon, CircleIcon, ChevronDownIcon, ChevronUpIcon, TrendingUp, AlertTriangle, Check, Truck, Factory, ChevronRightIcon, ChevronLeftIcon, ArrowLeft, ArrowRight, Loader2Icon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, ChevronRight, MoreHorizontal, MoreHorizontalIcon, XIcon, GripVerticalIcon, PanelLeftIcon, ArrowDown, ArrowUp, ChevronsUpDown, EyeOff, ChevronsLeft, ChevronLeft, ChevronsRight, Settings2, FolderIcon, ShareIcon, ChevronsUpDownIcon, SparklesIcon, BadgeCheckIcon, CreditCardIcon, BellIcon, LogOutIcon, X, Flag, MessageSquare, ChevronDown, Plus, Send, MessageSquarePlus, CheckCircle, Calendar as Calendar$1, MapPin, Package, User, Clock, CalendarX2, List, Columns, Grid2x2, Grid3x3, CalendarRange, Settings, Info, Moon, PlusIcon, PencilIcon, CopyIcon, ArrowUpDown, CheckCircle2, XCircle, Search, FileText } from 'lucide-react';
11
11
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
12
12
  import * as SwitchPrimitive from '@radix-ui/react-switch';
13
13
  import * as SliderPrimitive from '@radix-ui/react-slider';
@@ -57,8 +57,8 @@ import tunnel from 'tunnel-rat';
57
57
  // src/hooks/use-mobile.ts
58
58
  var MOBILE_BREAKPOINT = 768;
59
59
  function useIsMobile() {
60
- const [isMobile, setIsMobile] = React29.useState(void 0);
61
- React29.useEffect(() => {
60
+ const [isMobile, setIsMobile] = React27.useState(void 0);
61
+ React27.useEffect(() => {
62
62
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
63
63
  const onChange = () => {
64
64
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -72,6 +72,53 @@ function useIsMobile() {
72
72
  function cn(...inputs) {
73
73
  return twMerge(clsx(inputs));
74
74
  }
75
+ var statusCellFillClasses = {
76
+ // Green - complete/valid/ready state
77
+ complete: {
78
+ bg: "bg-green-50/50 dark:bg-green-950/30"},
79
+ ready: {
80
+ combined: "border-l-[3px] border-l-green-500 bg-green-50/50 dark:bg-green-950/30"
81
+ },
82
+ // Amber - warning/attention state
83
+ warning: {
84
+ bg: "bg-amber-50/50 dark:bg-amber-950/30"},
85
+ // Red - critical/risk state
86
+ critical: {
87
+ bg: "bg-red-50/50 dark:bg-red-950/30"},
88
+ risk: {
89
+ combined: "border-l-[3px] border-l-red-500 bg-red-50/50 dark:bg-red-950/30"
90
+ },
91
+ // Grey - normal/pending/neutral state (on track but not complete)
92
+ normal: {
93
+ combined: "border-l-[3px] border-l-muted-foreground/40 bg-muted/30 dark:bg-muted/20"
94
+ },
95
+ // Shipped - distinct muted state with green accent (greyed out + check)
96
+ shipped: {
97
+ combined: "border-l-[3px] border-l-green-500/50 bg-muted/50 dark:bg-muted/30"
98
+ }
99
+ };
100
+ var statusCellTextClasses = {
101
+ ready: {
102
+ title: "text-foreground",
103
+ subtitle: "text-green-700/80 dark:text-green-300/80",
104
+ icon: "text-green-600 dark:text-green-400"
105
+ },
106
+ risk: {
107
+ title: "text-foreground",
108
+ subtitle: "text-red-700/80 dark:text-red-300/80",
109
+ icon: "text-red-600 dark:text-red-400"
110
+ },
111
+ normal: {
112
+ title: "text-foreground",
113
+ subtitle: "text-muted-foreground",
114
+ icon: "text-muted-foreground"
115
+ },
116
+ shipped: {
117
+ title: "text-muted-foreground",
118
+ subtitle: "text-muted-foreground/70",
119
+ icon: "text-green-600/70 dark:text-green-400/70"
120
+ }
121
+ };
75
122
  var buttonVariants = cva(
76
123
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
77
124
  {
@@ -99,7 +146,7 @@ var buttonVariants = cva(
99
146
  }
100
147
  }
101
148
  );
102
- var Button = React29.forwardRef(
149
+ var Button = React27.forwardRef(
103
150
  ({ className, variant, size, asChild = false, ...props }, ref) => {
104
151
  const Comp = asChild ? Slot : "button";
105
152
  return /* @__PURE__ */ jsx(
@@ -463,7 +510,7 @@ function Slider({
463
510
  max = 100,
464
511
  ...props
465
512
  }) {
466
- const _values = React29.useMemo(
513
+ const _values = React27.useMemo(
467
514
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
468
515
  [value, defaultValue, min, max]
469
516
  );
@@ -749,7 +796,7 @@ function Toggle({
749
796
  }
750
797
  );
751
798
  }
752
- var ToggleGroupContext = React29.createContext({
799
+ var ToggleGroupContext = React27.createContext({
753
800
  size: "default",
754
801
  variant: "default",
755
802
  spacing: 0
@@ -786,7 +833,7 @@ function ToggleGroupItem({
786
833
  size,
787
834
  ...props
788
835
  }) {
789
- const context = React29.useContext(ToggleGroupContext);
836
+ const context = React27.useContext(ToggleGroupContext);
790
837
  return /* @__PURE__ */ jsx(
791
838
  ToggleGroupPrimitive.Item,
792
839
  {
@@ -816,7 +863,7 @@ function ThemeSwitch({
816
863
  className,
817
864
  size = "default"
818
865
  }) {
819
- const [isChecked, setIsChecked] = React29.useState(defaultChecked);
866
+ const [isChecked, setIsChecked] = React27.useState(defaultChecked);
820
867
  const isControlled = checked !== void 0;
821
868
  const currentChecked = isControlled ? checked : isChecked;
822
869
  const handleClick = () => {
@@ -1236,7 +1283,7 @@ function Label2({
1236
1283
  );
1237
1284
  }
1238
1285
  var Form = FormProvider;
1239
- var FormFieldContext = React29.createContext(
1286
+ var FormFieldContext = React27.createContext(
1240
1287
  {}
1241
1288
  );
1242
1289
  var FormField = ({
@@ -1245,8 +1292,8 @@ var FormField = ({
1245
1292
  return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
1246
1293
  };
1247
1294
  var useFormField = () => {
1248
- const fieldContext = React29.useContext(FormFieldContext);
1249
- const itemContext = React29.useContext(FormItemContext);
1295
+ const fieldContext = React27.useContext(FormFieldContext);
1296
+ const itemContext = React27.useContext(FormItemContext);
1250
1297
  const { getFieldState } = useFormContext();
1251
1298
  const formState = useFormState({ name: fieldContext.name });
1252
1299
  const fieldState = getFieldState(fieldContext.name, formState);
@@ -1263,11 +1310,11 @@ var useFormField = () => {
1263
1310
  ...fieldState
1264
1311
  };
1265
1312
  };
1266
- var FormItemContext = React29.createContext(
1313
+ var FormItemContext = React27.createContext(
1267
1314
  {}
1268
1315
  );
1269
1316
  function FormItem({ className, ...props }) {
1270
- const id = React29.useId();
1317
+ const id = React27.useId();
1271
1318
  return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx(
1272
1319
  "div",
1273
1320
  {
@@ -1546,6 +1593,166 @@ function FieldError({
1546
1593
  }
1547
1594
  );
1548
1595
  }
1596
+ var iconMap = {
1597
+ factory: Factory,
1598
+ truck: Truck,
1599
+ check: Check,
1600
+ alert: AlertTriangle,
1601
+ trending: TrendingUp
1602
+ };
1603
+ var statusColorMap = {
1604
+ normal: "text-muted-foreground",
1605
+ success: "text-green-600 dark:text-green-400",
1606
+ warning: "text-amber-600 dark:text-amber-400",
1607
+ critical: "text-red-600 dark:text-red-400"
1608
+ };
1609
+ function InsightBar({ metrics, className }) {
1610
+ return /* @__PURE__ */ jsx(
1611
+ "div",
1612
+ {
1613
+ "data-slot": "insight-bar",
1614
+ className: cn(
1615
+ "flex flex-wrap items-center gap-6 px-4 py-3",
1616
+ "border-b border-border bg-muted/20",
1617
+ className
1618
+ ),
1619
+ children: metrics.map((metric) => {
1620
+ const Icon2 = metric.icon ? iconMap[metric.icon] : null;
1621
+ const statusColor = metric.status ? statusColorMap[metric.status] : "text-foreground";
1622
+ return /* @__PURE__ */ jsxs(
1623
+ "div",
1624
+ {
1625
+ className: "flex items-center gap-2",
1626
+ children: [
1627
+ Icon2 && /* @__PURE__ */ jsx(Icon2, { className: cn("h-4 w-4", statusColor) }),
1628
+ /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-1.5", children: [
1629
+ /* @__PURE__ */ jsx("span", { className: cn(
1630
+ "text-lg font-semibold tabular-nums",
1631
+ statusColor
1632
+ ), children: metric.isPercentage ? `${Math.round(metric.value)}%` : metric.value.toLocaleString(void 0, { maximumFractionDigits: 1 }) }),
1633
+ metric.unit && !metric.isPercentage && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: metric.unit }),
1634
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: metric.label })
1635
+ ] })
1636
+ ]
1637
+ },
1638
+ metric.key
1639
+ );
1640
+ })
1641
+ }
1642
+ );
1643
+ }
1644
+ var iconMap2 = {
1645
+ factory: Factory,
1646
+ truck: Truck,
1647
+ check: Check
1648
+ };
1649
+ var statusBgMap = {
1650
+ normal: "bg-muted/30",
1651
+ complete: statusCellFillClasses.complete.bg,
1652
+ warning: statusCellFillClasses.warning.bg,
1653
+ critical: statusCellFillClasses.critical.bg
1654
+ };
1655
+ var statusTextMap = {
1656
+ normal: "text-muted-foreground",
1657
+ complete: "text-green-700 dark:text-green-300",
1658
+ warning: "text-amber-700 dark:text-amber-300",
1659
+ critical: "text-red-700 dark:text-red-300"
1660
+ };
1661
+ function ColumnSummaryCell({
1662
+ data,
1663
+ widthClass = "min-w-[120px]",
1664
+ className
1665
+ }) {
1666
+ const status = data.status || "normal";
1667
+ const bgClass = statusBgMap[status];
1668
+ const textClass = statusTextMap[status];
1669
+ const isClickable = !!data.onClick;
1670
+ const PrimaryIcon = data.primary?.icon ? iconMap2[data.primary.icon] : null;
1671
+ const SecondaryIcon = data.secondary?.icon ? iconMap2[data.secondary.icon] : null;
1672
+ return /* @__PURE__ */ jsxs(
1673
+ "div",
1674
+ {
1675
+ role: isClickable ? "button" : void 0,
1676
+ tabIndex: isClickable ? 0 : void 0,
1677
+ onClick: data.onClick,
1678
+ onKeyDown: (e) => {
1679
+ if (isClickable && (e.key === "Enter" || e.key === " ")) {
1680
+ e.preventDefault();
1681
+ data.onClick?.();
1682
+ }
1683
+ },
1684
+ className: cn(
1685
+ // Base sizing
1686
+ widthClass,
1687
+ "flex flex-col gap-0.5 px-2 py-1.5",
1688
+ // Background based on status
1689
+ bgClass,
1690
+ // Clickable styles
1691
+ isClickable && "cursor-pointer hover:brightness-95 transition-all",
1692
+ isClickable && "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",
1693
+ className
1694
+ ),
1695
+ children: [
1696
+ data.primary && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
1697
+ PrimaryIcon && /* @__PURE__ */ jsx(PrimaryIcon, { className: cn("h-3 w-3", textClass) }),
1698
+ /* @__PURE__ */ jsx("span", { className: cn("text-xs font-medium tabular-nums", textClass), children: data.primary.value.toLocaleString(void 0, { maximumFractionDigits: 1 }) }),
1699
+ data.primary.unit && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: data.primary.unit })
1700
+ ] }),
1701
+ data.secondary && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
1702
+ SecondaryIcon && /* @__PURE__ */ jsx(SecondaryIcon, { className: cn("h-3 w-3 text-muted-foreground") }),
1703
+ /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-muted-foreground tabular-nums", children: [
1704
+ data.secondary.value.toLocaleString(void 0, { maximumFractionDigits: 1 }),
1705
+ data.secondary.unit && ` ${data.secondary.unit}`
1706
+ ] })
1707
+ ] }),
1708
+ data.tertiary && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-muted-foreground/70 tabular-nums", children: [
1709
+ data.tertiary.value.toLocaleString(void 0, { maximumFractionDigits: 1 }),
1710
+ data.tertiary.unit && ` ${data.tertiary.unit}`
1711
+ ] }) })
1712
+ ]
1713
+ }
1714
+ );
1715
+ }
1716
+ function ColumnSummaryStrip({
1717
+ columns,
1718
+ columnWidthClass = "min-w-[120px]",
1719
+ rowHeaderLabel,
1720
+ rowHeaderWidthClass = "min-w-[200px] w-[200px]",
1721
+ className
1722
+ }) {
1723
+ return /* @__PURE__ */ jsxs(
1724
+ "div",
1725
+ {
1726
+ "data-slot": "column-summary-strip",
1727
+ className: cn(
1728
+ "flex border-b border-border",
1729
+ className
1730
+ ),
1731
+ children: [
1732
+ rowHeaderLabel !== void 0 && /* @__PURE__ */ jsx(
1733
+ "div",
1734
+ {
1735
+ className: cn(
1736
+ "flex items-center px-3 py-1.5",
1737
+ "bg-muted/30 border-r border-border",
1738
+ "sticky left-0 z-10",
1739
+ rowHeaderWidthClass
1740
+ ),
1741
+ children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wide", children: rowHeaderLabel })
1742
+ }
1743
+ ),
1744
+ /* @__PURE__ */ jsx("div", { className: "flex", children: columns.map((column) => /* @__PURE__ */ jsx(
1745
+ ColumnSummaryCell,
1746
+ {
1747
+ data: column,
1748
+ widthClass: columnWidthClass
1749
+ },
1750
+ column.columnKey
1751
+ )) })
1752
+ ]
1753
+ }
1754
+ );
1755
+ }
1549
1756
  var cardVariants = cva(
1550
1757
  "rounded-xl text-card-foreground",
1551
1758
  {
@@ -2369,8 +2576,8 @@ function CalendarDayButton({
2369
2576
  modifiers,
2370
2577
  ...props
2371
2578
  }) {
2372
- const ref = React29.useRef(null);
2373
- React29.useEffect(() => {
2579
+ const ref = React27.useRef(null);
2580
+ React27.useEffect(() => {
2374
2581
  if (modifiers.focused) ref.current?.focus();
2375
2582
  }, [modifiers.focused]);
2376
2583
  return /* @__PURE__ */ jsx(
@@ -2391,9 +2598,9 @@ function CalendarDayButton({
2391
2598
  }
2392
2599
  );
2393
2600
  }
2394
- var CarouselContext = React29.createContext(null);
2601
+ var CarouselContext = React27.createContext(null);
2395
2602
  function useCarousel() {
2396
- const context = React29.useContext(CarouselContext);
2603
+ const context = React27.useContext(CarouselContext);
2397
2604
  if (!context) {
2398
2605
  throw new Error("useCarousel must be used within a <Carousel />");
2399
2606
  }
@@ -2415,20 +2622,20 @@ function Carousel({
2415
2622
  },
2416
2623
  plugins
2417
2624
  );
2418
- const [canScrollPrev, setCanScrollPrev] = React29.useState(false);
2419
- const [canScrollNext, setCanScrollNext] = React29.useState(false);
2420
- const onSelect = React29.useCallback((api2) => {
2625
+ const [canScrollPrev, setCanScrollPrev] = React27.useState(false);
2626
+ const [canScrollNext, setCanScrollNext] = React27.useState(false);
2627
+ const onSelect = React27.useCallback((api2) => {
2421
2628
  if (!api2) return;
2422
2629
  setCanScrollPrev(api2.canScrollPrev());
2423
2630
  setCanScrollNext(api2.canScrollNext());
2424
2631
  }, []);
2425
- const scrollPrev = React29.useCallback(() => {
2632
+ const scrollPrev = React27.useCallback(() => {
2426
2633
  api?.scrollPrev();
2427
2634
  }, [api]);
2428
- const scrollNext = React29.useCallback(() => {
2635
+ const scrollNext = React27.useCallback(() => {
2429
2636
  api?.scrollNext();
2430
2637
  }, [api]);
2431
- const handleKeyDown = React29.useCallback(
2638
+ const handleKeyDown = React27.useCallback(
2432
2639
  (event) => {
2433
2640
  if (event.key === "ArrowLeft") {
2434
2641
  event.preventDefault();
@@ -2440,11 +2647,11 @@ function Carousel({
2440
2647
  },
2441
2648
  [scrollPrev, scrollNext]
2442
2649
  );
2443
- React29.useEffect(() => {
2650
+ React27.useEffect(() => {
2444
2651
  if (!api || !setApi) return;
2445
2652
  setApi(api);
2446
2653
  }, [api, setApi]);
2447
- React29.useEffect(() => {
2654
+ React27.useEffect(() => {
2448
2655
  if (!api) return;
2449
2656
  onSelect(api);
2450
2657
  api.on("reInit", onSelect);
@@ -2577,9 +2784,9 @@ function CarouselNext({
2577
2784
  );
2578
2785
  }
2579
2786
  var THEMES = { light: "", dark: ".dark" };
2580
- var ChartContext = React29.createContext(null);
2787
+ var ChartContext = React27.createContext(null);
2581
2788
  function useChart() {
2582
- const context = React29.useContext(ChartContext);
2789
+ const context = React27.useContext(ChartContext);
2583
2790
  if (!context) {
2584
2791
  throw new Error("useChart must be used within a <ChartContainer />");
2585
2792
  }
@@ -2592,7 +2799,7 @@ function ChartContainer({
2592
2799
  config,
2593
2800
  ...props
2594
2801
  }) {
2595
- const uniqueId = React29.useId();
2802
+ const uniqueId = React27.useId();
2596
2803
  const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
2597
2804
  return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
2598
2805
  "div",
@@ -2653,7 +2860,7 @@ function ChartTooltipContent({
2653
2860
  labelKey
2654
2861
  }) {
2655
2862
  const { config } = useChart();
2656
- const tooltipLabel = React29.useMemo(() => {
2863
+ const tooltipLabel = React27.useMemo(() => {
2657
2864
  if (hideLabel || !payload?.length) {
2658
2865
  return null;
2659
2866
  }
@@ -3488,7 +3695,7 @@ function StatusProgress({
3488
3695
  const resolvedVariant = variant ?? getVariantFromProgress(clampedValue);
3489
3696
  const colors = getStatusColors(resolvedVariant);
3490
3697
  const sizes = getSizeClasses(size);
3491
- const labelText = React29.useMemo(() => {
3698
+ const labelText = React27.useMemo(() => {
3492
3699
  if (currentCount !== void 0 && totalCount !== void 0) {
3493
3700
  return `${currentCount} / ${totalCount} ${unitLabel}`;
3494
3701
  }
@@ -3593,8 +3800,8 @@ function TooltipContent({
3593
3800
  ) });
3594
3801
  }
3595
3802
  function useDetectTheme() {
3596
- const [theme, setTheme] = React29.useState("light");
3597
- React29.useEffect(() => {
3803
+ const [theme, setTheme] = React27.useState("light");
3804
+ React27.useEffect(() => {
3598
3805
  const isDark = document.documentElement.classList.contains("dark");
3599
3806
  setTheme(isDark ? "dark" : "light");
3600
3807
  const observer = new MutationObserver((mutations) => {
@@ -4243,7 +4450,7 @@ function CommandShortcut({
4243
4450
  }
4244
4451
  );
4245
4452
  }
4246
- var SearchTrigger = React29.forwardRef(
4453
+ var SearchTrigger = React27.forwardRef(
4247
4454
  ({
4248
4455
  className,
4249
4456
  placeholder = "Search...",
@@ -4279,7 +4486,7 @@ var SearchTrigger = React29.forwardRef(
4279
4486
  );
4280
4487
  SearchTrigger.displayName = "SearchTrigger";
4281
4488
  function useSearchShortcut(onOpen, key = "k") {
4282
- React29.useEffect(() => {
4489
+ React27.useEffect(() => {
4283
4490
  const down = (e) => {
4284
4491
  if (e.key.toLowerCase() === key.toLowerCase() && (e.metaKey || e.ctrlKey)) {
4285
4492
  e.preventDefault();
@@ -5254,9 +5461,9 @@ var SIDEBAR_WIDTH = "16rem";
5254
5461
  var SIDEBAR_WIDTH_MOBILE = "18rem";
5255
5462
  var SIDEBAR_WIDTH_ICON = "3rem";
5256
5463
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
5257
- var SidebarContext = React29.createContext(null);
5464
+ var SidebarContext = React27.createContext(null);
5258
5465
  function useSidebar() {
5259
- const context = React29.useContext(SidebarContext);
5466
+ const context = React27.useContext(SidebarContext);
5260
5467
  if (!context) {
5261
5468
  throw new Error("useSidebar must be used within a SidebarProvider.");
5262
5469
  }
@@ -5272,10 +5479,10 @@ function SidebarProvider({
5272
5479
  ...props
5273
5480
  }) {
5274
5481
  const isMobile = useIsMobile();
5275
- const [openMobile, setOpenMobile] = React29.useState(false);
5276
- const [_open, _setOpen] = React29.useState(defaultOpen);
5482
+ const [openMobile, setOpenMobile] = React27.useState(false);
5483
+ const [_open, _setOpen] = React27.useState(defaultOpen);
5277
5484
  const open = openProp ?? _open;
5278
- const setOpen = React29.useCallback(
5485
+ const setOpen = React27.useCallback(
5279
5486
  (value) => {
5280
5487
  const openState = typeof value === "function" ? value(open) : value;
5281
5488
  if (setOpenProp) {
@@ -5287,10 +5494,10 @@ function SidebarProvider({
5287
5494
  },
5288
5495
  [setOpenProp, open]
5289
5496
  );
5290
- const toggleSidebar = React29.useCallback(() => {
5497
+ const toggleSidebar = React27.useCallback(() => {
5291
5498
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
5292
5499
  }, [isMobile, setOpen, setOpenMobile]);
5293
- React29.useEffect(() => {
5500
+ React27.useEffect(() => {
5294
5501
  const handleKeyDown = (event) => {
5295
5502
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
5296
5503
  event.preventDefault();
@@ -5301,7 +5508,7 @@ function SidebarProvider({
5301
5508
  return () => window.removeEventListener("keydown", handleKeyDown);
5302
5509
  }, [toggleSidebar]);
5303
5510
  const state = open ? "expanded" : "collapsed";
5304
- const contextValue = React29.useMemo(
5511
+ const contextValue = React27.useMemo(
5305
5512
  () => ({
5306
5513
  state,
5307
5514
  open,
@@ -5759,7 +5966,7 @@ function SidebarMenuSkeleton({
5759
5966
  showIcon = false,
5760
5967
  ...props
5761
5968
  }) {
5762
- const width = React29.useMemo(() => {
5969
+ const width = React27.useMemo(() => {
5763
5970
  return `${Math.floor(Math.random() * 40) + 50}%`;
5764
5971
  }, []);
5765
5972
  return /* @__PURE__ */ jsxs(
@@ -5902,7 +6109,7 @@ var sectionVariants = cva(
5902
6109
  }
5903
6110
  );
5904
6111
  var isGlassVariant = (variant) => variant?.startsWith("glass-") ?? false;
5905
- var Section = React29.forwardRef(
6112
+ var Section = React27.forwardRef(
5906
6113
  ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
5907
6114
  "section",
5908
6115
  {
@@ -5914,7 +6121,7 @@ var Section = React29.forwardRef(
5914
6121
  )
5915
6122
  );
5916
6123
  Section.displayName = "Section";
5917
- var SectionHeader = React29.forwardRef(
6124
+ var SectionHeader = React27.forwardRef(
5918
6125
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5919
6126
  "div",
5920
6127
  {
@@ -5929,7 +6136,7 @@ var SectionHeader = React29.forwardRef(
5929
6136
  )
5930
6137
  );
5931
6138
  SectionHeader.displayName = "SectionHeader";
5932
- var SectionTitle = React29.forwardRef(
6139
+ var SectionTitle = React27.forwardRef(
5933
6140
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5934
6141
  "h2",
5935
6142
  {
@@ -5943,7 +6150,7 @@ var SectionTitle = React29.forwardRef(
5943
6150
  )
5944
6151
  );
5945
6152
  SectionTitle.displayName = "SectionTitle";
5946
- var SectionDescription = React29.forwardRef(
6153
+ var SectionDescription = React27.forwardRef(
5947
6154
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5948
6155
  "p",
5949
6156
  {
@@ -5957,7 +6164,7 @@ var SectionDescription = React29.forwardRef(
5957
6164
  )
5958
6165
  );
5959
6166
  SectionDescription.displayName = "SectionDescription";
5960
- var SectionContent = React29.forwardRef(
6167
+ var SectionContent = React27.forwardRef(
5961
6168
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5962
6169
  "div",
5963
6170
  {
@@ -5971,7 +6178,7 @@ var SectionContent = React29.forwardRef(
5971
6178
  )
5972
6179
  );
5973
6180
  SectionContent.displayName = "SectionContent";
5974
- var SectionFooter = React29.forwardRef(
6181
+ var SectionFooter = React27.forwardRef(
5975
6182
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5976
6183
  "div",
5977
6184
  {
@@ -6279,7 +6486,7 @@ function SiteHeader({
6279
6486
  children: /* @__PURE__ */ jsxs("div", { className: "flex h-[var(--header-height,3.5rem)] w-full items-center gap-[var(--j3m-spacing-s)] px-[var(--j3m-spacing-m)]", children: [
6280
6487
  trigger,
6281
6488
  trigger && /* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "mr-[var(--j3m-spacing-s)] h-4" }),
6282
- /* @__PURE__ */ jsx(Breadcrumb, { className: "hidden sm:block", children: /* @__PURE__ */ jsx(BreadcrumbList, { children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxs(React29.Fragment, { children: [
6489
+ /* @__PURE__ */ jsx(Breadcrumb, { className: "hidden sm:block", children: /* @__PURE__ */ jsx(BreadcrumbList, { children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxs(React27.Fragment, { children: [
6283
6490
  index > 0 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
6284
6491
  /* @__PURE__ */ jsx(BreadcrumbItem, { children: item.href ? /* @__PURE__ */ jsx(BreadcrumbLink, { href: item.href, children: item.label }) : /* @__PURE__ */ jsx(BreadcrumbPage, { children: item.label }) })
6285
6492
  ] }, index)) }) }),
@@ -6900,11 +7107,11 @@ function PlanningWeekCommentPopover({
6900
7107
  open,
6901
7108
  onOpenChange
6902
7109
  }) {
6903
- const [newCommentText, setNewCommentText] = React29.useState("");
6904
- const [selectedLocationId, setSelectedLocationId] = React29.useState("");
6905
- const [viewCommentsOpen, setViewCommentsOpen] = React29.useState(true);
6906
- const [showAddForm, setShowAddForm] = React29.useState(false);
6907
- const selectedLocation = React29.useMemo(() => {
7110
+ const [newCommentText, setNewCommentText] = React27.useState("");
7111
+ const [selectedLocationId, setSelectedLocationId] = React27.useState("");
7112
+ const [viewCommentsOpen, setViewCommentsOpen] = React27.useState(true);
7113
+ const [showAddForm, setShowAddForm] = React27.useState(false);
7114
+ const selectedLocation = React27.useMemo(() => {
6908
7115
  return locationOptions.find((opt) => opt.id === selectedLocationId);
6909
7116
  }, [locationOptions, selectedLocationId]);
6910
7117
  const handleSubmit = () => {
@@ -6948,8 +7155,8 @@ function PlanningWeekCommentPopover({
6948
7155
  minute: "2-digit"
6949
7156
  }).format(date);
6950
7157
  };
6951
- const prevOpenRef = React29.useRef(open);
6952
- React29.useEffect(() => {
7158
+ const prevOpenRef = React27.useRef(open);
7159
+ React27.useEffect(() => {
6953
7160
  const wasOpen = prevOpenRef.current;
6954
7161
  prevOpenRef.current = open;
6955
7162
  if (wasOpen && !open) {
@@ -7303,22 +7510,22 @@ function PlanningTable({
7303
7510
  stickySupplierColumn = true,
7304
7511
  maxHeight = "600px"
7305
7512
  } = config;
7306
- const weeks = React29.useMemo(
7513
+ const weeks = React27.useMemo(
7307
7514
  () => generateWeeks(startDate, weekCount),
7308
7515
  [startDate, weekCount]
7309
7516
  );
7310
- const currentWeekKey = React29.useMemo(() => {
7517
+ const currentWeekKey = React27.useMemo(() => {
7311
7518
  const currentWeek = weeks.find((w) => w.isCurrentWeek);
7312
7519
  return currentWeek ? getWeekKey(currentWeek.startDate) : null;
7313
7520
  }, [weeks]);
7314
- const columns = React29.useMemo(
7521
+ const columns = React27.useMemo(
7315
7522
  () => generateColumns(weeks, config, suppliers),
7316
7523
  [weeks, config, suppliers]
7317
7524
  );
7318
- const [sorting, setSorting] = React29.useState([]);
7319
- const [columnFilters, setColumnFilters] = React29.useState([]);
7320
- const [columnVisibility, setColumnVisibility] = React29.useState({});
7321
- const [rowSelection, setRowSelection] = React29.useState({});
7525
+ const [sorting, setSorting] = React27.useState([]);
7526
+ const [columnFilters, setColumnFilters] = React27.useState([]);
7527
+ const [columnVisibility, setColumnVisibility] = React27.useState({});
7528
+ const [rowSelection, setRowSelection] = React27.useState({});
7322
7529
  const table = useReactTable({
7323
7530
  data: suppliers,
7324
7531
  columns,
@@ -7342,12 +7549,95 @@ function PlanningTable({
7342
7549
  }
7343
7550
  }
7344
7551
  });
7552
+ const insightMetrics = React27.useMemo(() => {
7553
+ let totalProduced = 0;
7554
+ let totalRequired = 0;
7555
+ let totalDeliveries = 0;
7556
+ for (const supplier of suppliers) {
7557
+ for (const weekKey in supplier.weeks) {
7558
+ const weekData = supplier.weeks[weekKey];
7559
+ if (weekData.production) {
7560
+ totalProduced += weekData.production.produced;
7561
+ totalRequired += weekData.production.target;
7562
+ }
7563
+ totalDeliveries += weekData.deliveries?.length ?? 0;
7564
+ }
7565
+ }
7566
+ const productionPercent = totalRequired > 0 ? totalProduced / totalRequired * 100 : 0;
7567
+ return [
7568
+ {
7569
+ key: "produced",
7570
+ label: "produced",
7571
+ value: totalProduced,
7572
+ unit: "tons",
7573
+ icon: "factory",
7574
+ status: productionPercent >= 100 ? "success" : "normal"
7575
+ },
7576
+ {
7577
+ key: "deliveries",
7578
+ label: "planned deliveries",
7579
+ value: totalDeliveries,
7580
+ icon: "truck",
7581
+ status: "normal"
7582
+ },
7583
+ {
7584
+ key: "progress",
7585
+ label: "produced vs required",
7586
+ value: productionPercent,
7587
+ isPercentage: true,
7588
+ icon: "trending",
7589
+ status: productionPercent >= 100 ? "success" : productionPercent >= 50 ? "normal" : "warning"
7590
+ }
7591
+ ];
7592
+ }, [suppliers]);
7593
+ const columnSummaryData = React27.useMemo(() => {
7594
+ return weeks.map((week) => {
7595
+ const weekKey = getWeekKey(week.startDate);
7596
+ let producedTons = 0;
7597
+ let plannedDeliveries = 0;
7598
+ let sentDeliveries = 0;
7599
+ let hasWarning = false;
7600
+ let hasCritical = false;
7601
+ let allComplete = true;
7602
+ for (const supplier of suppliers) {
7603
+ const weekData = supplier.weeks[weekKey];
7604
+ if (weekData) {
7605
+ if (weekData.production) {
7606
+ producedTons += weekData.production.produced;
7607
+ if (weekData.production.progress !== void 0 && weekData.production.progress < 100) {
7608
+ allComplete = false;
7609
+ }
7610
+ }
7611
+ if (weekData.deliveries) {
7612
+ plannedDeliveries += weekData.deliveries.length;
7613
+ sentDeliveries += weekData.deliveries.filter(
7614
+ (d) => d.status === "on-time" && (d.progress ?? 0) >= 100
7615
+ ).length;
7616
+ }
7617
+ if (weekData.hasWarning) hasWarning = true;
7618
+ if (weekData.deliveries?.some((d) => d.status === "critical")) hasCritical = true;
7619
+ }
7620
+ }
7621
+ let status = "normal";
7622
+ if (hasCritical) status = "critical";
7623
+ else if (hasWarning) status = "warning";
7624
+ else if (allComplete && producedTons > 0) status = "complete";
7625
+ return {
7626
+ weekKey,
7627
+ producedTons,
7628
+ plannedDeliveries,
7629
+ sentDeliveries,
7630
+ status
7631
+ };
7632
+ });
7633
+ }, [weeks, suppliers]);
7345
7634
  return /* @__PURE__ */ jsxs(
7346
7635
  "div",
7347
7636
  {
7348
7637
  "data-slot": "planning-table",
7349
7638
  className: cn("flex flex-col gap-4", className),
7350
7639
  children: [
7640
+ /* @__PURE__ */ jsx(InsightBar, { metrics: insightMetrics }),
7351
7641
  showToolbar && /* @__PURE__ */ jsx(PlanningTableToolbar, { table }),
7352
7642
  /* @__PURE__ */ jsx("div", { className: "rounded-xl border bg-background shadow-sm overflow-hidden", children: /* @__PURE__ */ jsxs(
7353
7643
  ScrollArea,
@@ -7356,37 +7646,80 @@ function PlanningTable({
7356
7646
  style: { maxHeight },
7357
7647
  children: [
7358
7648
  /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse", children: [
7359
- /* @__PURE__ */ jsx("thead", { className: "sticky top-0 z-20", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(
7360
- "tr",
7361
- {
7362
- children: headerGroup.headers.map((header, index) => {
7363
- const isCurrentWeekColumn = header.id === currentWeekKey;
7649
+ /* @__PURE__ */ jsxs("thead", { className: "sticky top-0 z-20", children: [
7650
+ table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(
7651
+ "tr",
7652
+ {
7653
+ children: headerGroup.headers.map((header, index) => {
7654
+ const isCurrentWeekColumn = header.id === currentWeekKey;
7655
+ return /* @__PURE__ */ jsx(
7656
+ "th",
7657
+ {
7658
+ className: cn(
7659
+ "h-14 px-3 text-left align-middle font-semibold text-xs text-muted-foreground uppercase tracking-wide",
7660
+ "border-r border-b border-border last:border-r-0 bg-sidebar",
7661
+ // First column: sticky with right-edge shadow (Quantum token)
7662
+ index === 0 && stickySupplierColumn && [
7663
+ "sticky left-0 z-30 min-w-[200px]",
7664
+ "shadow-[var(--j3m-shadow-sticky-edge)]"
7665
+ ],
7666
+ index > 0 && "min-w-[140px]",
7667
+ // Current week: only highlight text/dot, not full background
7668
+ isCurrentWeekColumn && highlightCurrentWeek && "text-primary"
7669
+ ),
7670
+ children: header.isPlaceholder ? null : flexRender(
7671
+ header.column.columnDef.header,
7672
+ header.getContext()
7673
+ )
7674
+ },
7675
+ header.id
7676
+ );
7677
+ })
7678
+ },
7679
+ headerGroup.id
7680
+ )),
7681
+ /* @__PURE__ */ jsxs("tr", { children: [
7682
+ /* @__PURE__ */ jsx("th", { className: cn(
7683
+ "h-auto px-3 py-1.5 text-left align-middle",
7684
+ "border-r border-b border-border bg-muted/30",
7685
+ stickySupplierColumn && "sticky left-0 z-30 min-w-[200px]",
7686
+ stickySupplierColumn && "shadow-[var(--j3m-shadow-sticky-edge)]"
7687
+ ), children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wide", children: "Summary" }) }),
7688
+ columnSummaryData.map((summary) => {
7689
+ const statusBg = summary.status === "complete" ? "bg-green-50/50 dark:bg-green-950/30" : summary.status === "critical" ? "bg-red-50/50 dark:bg-red-950/30" : summary.status === "warning" ? "bg-amber-50/50 dark:bg-amber-950/30" : "bg-muted/30";
7690
+ const statusText = summary.status === "complete" ? "text-green-700 dark:text-green-300" : summary.status === "critical" ? "text-red-700 dark:text-red-300" : summary.status === "warning" ? "text-amber-700 dark:text-amber-300" : "text-muted-foreground";
7364
7691
  return /* @__PURE__ */ jsx(
7365
7692
  "th",
7366
7693
  {
7367
7694
  className: cn(
7368
- "h-14 px-3 text-left align-middle font-semibold text-xs text-muted-foreground uppercase tracking-wide",
7369
- "border-r border-b border-border last:border-r-0 bg-sidebar",
7370
- // First column: sticky with right-edge shadow (Quantum token)
7371
- index === 0 && stickySupplierColumn && [
7372
- "sticky left-0 z-30 min-w-[200px]",
7373
- "shadow-[var(--j3m-shadow-sticky-edge)]"
7374
- ],
7375
- index > 0 && "min-w-[140px]",
7376
- // Current week: only highlight text/dot, not full background
7377
- isCurrentWeekColumn && highlightCurrentWeek && "text-primary"
7695
+ "h-auto px-2 py-1.5 text-left align-middle",
7696
+ "border-r border-b border-border last:border-r-0 min-w-[140px]",
7697
+ statusBg
7378
7698
  ),
7379
- children: header.isPlaceholder ? null : flexRender(
7380
- header.column.columnDef.header,
7381
- header.getContext()
7382
- )
7699
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
7700
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
7701
+ /* @__PURE__ */ jsx(Factory, { className: cn("h-3 w-3", statusText) }),
7702
+ /* @__PURE__ */ jsxs("span", { className: cn("text-xs font-medium tabular-nums", statusText), children: [
7703
+ summary.producedTons.toLocaleString(void 0, { maximumFractionDigits: 1 }),
7704
+ " t"
7705
+ ] })
7706
+ ] }),
7707
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
7708
+ /* @__PURE__ */ jsx(Truck, { className: "h-3 w-3 text-muted-foreground" }),
7709
+ /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-muted-foreground tabular-nums", children: [
7710
+ summary.sentDeliveries,
7711
+ "/",
7712
+ summary.plannedDeliveries,
7713
+ " sent"
7714
+ ] })
7715
+ ] })
7716
+ ] })
7383
7717
  },
7384
- header.id
7718
+ summary.weekKey
7385
7719
  );
7386
7720
  })
7387
- },
7388
- headerGroup.id
7389
- )) }),
7721
+ ] })
7722
+ ] }),
7390
7723
  /* @__PURE__ */ jsx("tbody", { className: "bg-background", children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(
7391
7724
  "tr",
7392
7725
  {
@@ -7534,10 +7867,10 @@ function DeliveryCommentPopover({
7534
7867
  onAddComment,
7535
7868
  deliveryLabel
7536
7869
  }) {
7537
- const [open, setOpen] = React29.useState(false);
7538
- const [newCommentText, setNewCommentText] = React29.useState("");
7539
- const [viewCommentsOpen, setViewCommentsOpen] = React29.useState(true);
7540
- const [showAddForm, setShowAddForm] = React29.useState(false);
7870
+ const [open, setOpen] = React27.useState(false);
7871
+ const [newCommentText, setNewCommentText] = React27.useState("");
7872
+ const [viewCommentsOpen, setViewCommentsOpen] = React27.useState(true);
7873
+ const [showAddForm, setShowAddForm] = React27.useState(false);
7541
7874
  const handleSubmit = () => {
7542
7875
  if (newCommentText.trim() && onAddComment) {
7543
7876
  onAddComment(newCommentText.trim());
@@ -7564,8 +7897,8 @@ function DeliveryCommentPopover({
7564
7897
  minute: "2-digit"
7565
7898
  }).format(date);
7566
7899
  };
7567
- const prevOpenRef = React29.useRef(open);
7568
- React29.useEffect(() => {
7900
+ const prevOpenRef = React27.useRef(open);
7901
+ React27.useEffect(() => {
7569
7902
  const wasOpen = prevOpenRef.current;
7570
7903
  prevOpenRef.current = open;
7571
7904
  if (wasOpen && !open) {
@@ -7677,8 +8010,8 @@ function ProductionCommentSection({
7677
8010
  comments = [],
7678
8011
  onAddComment
7679
8012
  }) {
7680
- const [showAddForm, setShowAddForm] = React29.useState(false);
7681
- const [newComment, setNewComment] = React29.useState("");
8013
+ const [showAddForm, setShowAddForm] = React27.useState(false);
8014
+ const [newComment, setNewComment] = React27.useState("");
7682
8015
  const handleSubmit = () => {
7683
8016
  if (newComment.trim() && onAddComment) {
7684
8017
  onAddComment(newComment.trim());
@@ -7777,43 +8110,65 @@ function DeliveryListItem({
7777
8110
  }) {
7778
8111
  const hasComments = (delivery.comments?.length ?? 0) > 0;
7779
8112
  const isComplete = (delivery.progress ?? 0) >= 100;
7780
- const getIconStyles = () => {
8113
+ const getCardStyles3 = () => {
7781
8114
  if (delivery.status === "critical") {
7782
- return { bg: "bg-red-100 dark:bg-red-950/50", icon: "text-red-600 dark:text-red-400" };
8115
+ return {
8116
+ card: "border-l-[3px] border-l-red-500 bg-red-50/50 dark:bg-red-950/30",
8117
+ icon: "text-red-600 dark:text-red-400",
8118
+ title: "text-foreground",
8119
+ subtitle: "text-red-700/70 dark:text-red-300/70",
8120
+ chevron: "text-red-600/60 dark:text-red-400/60"
8121
+ };
7783
8122
  }
7784
8123
  if (delivery.status === "delayed") {
7785
- return { bg: "bg-amber-100 dark:bg-amber-950/50", icon: "text-amber-600 dark:text-amber-400" };
8124
+ return {
8125
+ card: "border-l-[3px] border-l-amber-500 bg-amber-50/50 dark:bg-amber-950/30",
8126
+ icon: "text-amber-600 dark:text-amber-400",
8127
+ title: "text-foreground",
8128
+ subtitle: "text-amber-700/70 dark:text-amber-300/70",
8129
+ chevron: "text-amber-600/60 dark:text-amber-400/60"
8130
+ };
7786
8131
  }
7787
8132
  if (isComplete) {
7788
- return { bg: "bg-green-100 dark:bg-green-950/50", icon: "text-green-600 dark:text-green-400" };
8133
+ return {
8134
+ card: "border-l-[3px] border-l-green-500 bg-green-50/50 dark:bg-green-950/30",
8135
+ icon: "text-green-600 dark:text-green-400",
8136
+ title: "text-foreground",
8137
+ subtitle: "text-green-700/70 dark:text-green-300/70",
8138
+ chevron: "text-green-600/60 dark:text-green-400/60"
8139
+ };
7789
8140
  }
7790
- return { bg: "bg-muted", icon: "text-muted-foreground" };
8141
+ return {
8142
+ card: "border-l-[3px] border-l-muted-foreground/40 bg-muted/30 dark:bg-muted/20",
8143
+ icon: "text-muted-foreground",
8144
+ title: "text-foreground",
8145
+ subtitle: "text-muted-foreground",
8146
+ chevron: "text-muted-foreground/60"
8147
+ };
7791
8148
  };
7792
- const iconStyles = getIconStyles();
8149
+ const styles = getCardStyles3();
7793
8150
  return /* @__PURE__ */ jsxs(
7794
8151
  "button",
7795
8152
  {
7796
8153
  onClick,
7797
8154
  className: cn(
7798
8155
  "w-full flex items-center justify-between p-3 rounded-lg",
7799
- "bg-card border hover:bg-muted/50 transition-colors cursor-pointer",
7800
- "text-left"
8156
+ "transition-all duration-200 ease-out cursor-pointer text-left",
8157
+ "hover:-translate-y-0.5 hover:shadow-[var(--j3m-shadow-md)]",
8158
+ styles.card
7801
8159
  ),
7802
8160
  children: [
7803
8161
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
7804
- /* @__PURE__ */ jsx("div", { className: cn(
7805
- "flex items-center justify-center h-8 w-8 rounded-lg",
7806
- iconStyles.bg
7807
- ), children: /* @__PURE__ */ jsx(Truck, { className: cn("h-4 w-4", iconStyles.icon) }) }),
8162
+ /* @__PURE__ */ jsx(Truck, { className: cn("h-5 w-5 shrink-0", styles.icon) }),
7808
8163
  /* @__PURE__ */ jsxs("div", { children: [
7809
8164
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
7810
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: delivery.label || `Delivery ${index + 1}` }),
8165
+ /* @__PURE__ */ jsx("span", { className: cn("text-sm font-medium", styles.title), children: delivery.label || `Delivery ${index + 1}` }),
7811
8166
  hasComments && /* @__PURE__ */ jsxs("div", { className: "relative", children: [
7812
8167
  /* @__PURE__ */ jsx(MessageSquare, { className: "h-3 w-3 text-muted-foreground" }),
7813
8168
  /* @__PURE__ */ jsx("span", { className: "absolute -top-0.5 -right-0.5 h-1.5 w-1.5 rounded-full bg-primary" })
7814
8169
  ] })
7815
8170
  ] }),
7816
- delivery.destination && /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground", children: [
8171
+ delivery.destination && /* @__PURE__ */ jsxs("div", { className: cn("text-xs", styles.subtitle), children: [
7817
8172
  "\u2192 ",
7818
8173
  delivery.destination
7819
8174
  ] })
@@ -7828,7 +8183,7 @@ function DeliveryListItem({
7828
8183
  children: getStatusLabel(delivery.status, isComplete)
7829
8184
  }
7830
8185
  ),
7831
- /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
8186
+ /* @__PURE__ */ jsx(ChevronRight, { className: cn("h-4 w-4", styles.chevron) })
7832
8187
  ] })
7833
8188
  ]
7834
8189
  }
@@ -7841,7 +8196,7 @@ function DeliveryDetailsView({
7841
8196
  onAddComment
7842
8197
  }) {
7843
8198
  const elements = delivery.elements ?? [];
7844
- const categorizedElements = React29.useMemo(() => {
8199
+ const categorizedElements = React27.useMemo(() => {
7845
8200
  const sent = [];
7846
8201
  const notSent = [];
7847
8202
  const moved = [];
@@ -8209,15 +8564,15 @@ function WeekDetailDialog({
8209
8564
  }) {
8210
8565
  const production = data?.production;
8211
8566
  const initialProduced = production?.produced ?? 0;
8212
- const [producedValue, setProducedValue] = React29.useState(initialProduced.toString());
8213
- const [hasChanges, setHasChanges] = React29.useState(false);
8214
- const [selectedDelivery, setSelectedDelivery] = React29.useState(null);
8215
- React29.useEffect(() => {
8567
+ const [producedValue, setProducedValue] = React27.useState(initialProduced.toString());
8568
+ const [hasChanges, setHasChanges] = React27.useState(false);
8569
+ const [selectedDelivery, setSelectedDelivery] = React27.useState(null);
8570
+ React27.useEffect(() => {
8216
8571
  const newProduced = data?.production?.produced ?? 0;
8217
8572
  setProducedValue(newProduced.toString());
8218
8573
  setHasChanges(false);
8219
8574
  }, [data]);
8220
- React29.useEffect(() => {
8575
+ React27.useEffect(() => {
8221
8576
  if (!open) {
8222
8577
  setSelectedDelivery(null);
8223
8578
  }
@@ -8348,24 +8703,24 @@ function ElementProductionDialog({
8348
8703
  elements,
8349
8704
  onSave
8350
8705
  }) {
8351
- const [searchQuery, setSearchQuery] = React29.useState("");
8352
- const [selectedIds, setSelectedIds] = React29.useState(
8706
+ const [searchQuery, setSearchQuery] = React27.useState("");
8707
+ const [selectedIds, setSelectedIds] = React27.useState(
8353
8708
  new Set(elements.filter((e) => e.isProduced).map((e) => e.id))
8354
8709
  );
8355
- React29.useEffect(() => {
8710
+ React27.useEffect(() => {
8356
8711
  if (open) {
8357
8712
  setSelectedIds(new Set(elements.filter((e) => e.isProduced).map((e) => e.id)));
8358
8713
  setSearchQuery("");
8359
8714
  }
8360
8715
  }, [open, elements]);
8361
- const filteredElements = React29.useMemo(() => {
8716
+ const filteredElements = React27.useMemo(() => {
8362
8717
  if (!searchQuery.trim()) return elements;
8363
8718
  const query = searchQuery.toLowerCase();
8364
8719
  return elements.filter(
8365
8720
  (e) => e.name.toLowerCase().includes(query) || e.prefix?.toLowerCase().includes(query) || e.type?.toLowerCase().includes(query)
8366
8721
  );
8367
8722
  }, [elements, searchQuery]);
8368
- React29.useMemo(() => {
8723
+ React27.useMemo(() => {
8369
8724
  const prefixes = /* @__PURE__ */ new Set();
8370
8725
  elements.forEach((e) => {
8371
8726
  if (e.prefix) prefixes.add(e.prefix);
@@ -8551,10 +8906,10 @@ function DeliveryCommentPopover2({
8551
8906
  onAddComment,
8552
8907
  deliveryLabel
8553
8908
  }) {
8554
- const [open, setOpen] = React29.useState(false);
8555
- const [newCommentText, setNewCommentText] = React29.useState("");
8556
- const [viewCommentsOpen, setViewCommentsOpen] = React29.useState(true);
8557
- const [showAddForm, setShowAddForm] = React29.useState(false);
8909
+ const [open, setOpen] = React27.useState(false);
8910
+ const [newCommentText, setNewCommentText] = React27.useState("");
8911
+ const [viewCommentsOpen, setViewCommentsOpen] = React27.useState(true);
8912
+ const [showAddForm, setShowAddForm] = React27.useState(false);
8558
8913
  const handleSubmit = () => {
8559
8914
  if (newCommentText.trim() && onAddComment) {
8560
8915
  onAddComment(newCommentText.trim());
@@ -8581,7 +8936,7 @@ function DeliveryCommentPopover2({
8581
8936
  minute: "2-digit"
8582
8937
  }).format(date);
8583
8938
  };
8584
- React29.useEffect(() => {
8939
+ React27.useEffect(() => {
8585
8940
  if (!open) {
8586
8941
  setShowAddForm(false);
8587
8942
  setNewCommentText("");
@@ -8691,8 +9046,8 @@ function ProductionCommentSection2({
8691
9046
  comments = [],
8692
9047
  onAddComment
8693
9048
  }) {
8694
- const [showAddForm, setShowAddForm] = React29.useState(false);
8695
- const [newComment, setNewComment] = React29.useState("");
9049
+ const [showAddForm, setShowAddForm] = React27.useState(false);
9050
+ const [newComment, setNewComment] = React27.useState("");
8696
9051
  const handleSubmit = () => {
8697
9052
  if (newComment.trim() && onAddComment) {
8698
9053
  onAddComment(newComment.trim());
@@ -8791,43 +9146,65 @@ function DeliveryListItem2({
8791
9146
  }) {
8792
9147
  const hasComments = (delivery.comments?.length ?? 0) > 0;
8793
9148
  const isComplete = (delivery.progress ?? 0) >= 100;
8794
- const getIconStyles = () => {
9149
+ const getCardStyles3 = () => {
8795
9150
  if (delivery.status === "critical") {
8796
- return { bg: "bg-red-100 dark:bg-red-950/50", icon: "text-red-600 dark:text-red-400" };
9151
+ return {
9152
+ card: "border-l-[3px] border-l-red-500 bg-red-50/50 dark:bg-red-950/30",
9153
+ icon: "text-red-600 dark:text-red-400",
9154
+ title: "text-foreground",
9155
+ subtitle: "text-red-700/70 dark:text-red-300/70",
9156
+ chevron: "text-red-600/60 dark:text-red-400/60"
9157
+ };
8797
9158
  }
8798
9159
  if (delivery.status === "delayed") {
8799
- return { bg: "bg-amber-100 dark:bg-amber-950/50", icon: "text-amber-600 dark:text-amber-400" };
9160
+ return {
9161
+ card: "border-l-[3px] border-l-amber-500 bg-amber-50/50 dark:bg-amber-950/30",
9162
+ icon: "text-amber-600 dark:text-amber-400",
9163
+ title: "text-foreground",
9164
+ subtitle: "text-amber-700/70 dark:text-amber-300/70",
9165
+ chevron: "text-amber-600/60 dark:text-amber-400/60"
9166
+ };
8800
9167
  }
8801
9168
  if (isComplete) {
8802
- return { bg: "bg-green-100 dark:bg-green-950/50", icon: "text-green-600 dark:text-green-400" };
9169
+ return {
9170
+ card: "border-l-[3px] border-l-green-500 bg-green-50/50 dark:bg-green-950/30",
9171
+ icon: "text-green-600 dark:text-green-400",
9172
+ title: "text-foreground",
9173
+ subtitle: "text-green-700/70 dark:text-green-300/70",
9174
+ chevron: "text-green-600/60 dark:text-green-400/60"
9175
+ };
8803
9176
  }
8804
- return { bg: "bg-muted", icon: "text-muted-foreground" };
9177
+ return {
9178
+ card: "border-l-[3px] border-l-muted-foreground/40 bg-muted/30 dark:bg-muted/20",
9179
+ icon: "text-muted-foreground",
9180
+ title: "text-foreground",
9181
+ subtitle: "text-muted-foreground",
9182
+ chevron: "text-muted-foreground/60"
9183
+ };
8805
9184
  };
8806
- const iconStyles = getIconStyles();
9185
+ const styles = getCardStyles3();
8807
9186
  return /* @__PURE__ */ jsxs(
8808
9187
  "button",
8809
9188
  {
8810
9189
  onClick,
8811
9190
  className: cn(
8812
9191
  "w-full flex items-center justify-between p-3 rounded-lg",
8813
- "bg-card border hover:bg-muted/50 transition-colors cursor-pointer",
8814
- "text-left"
9192
+ "transition-all duration-200 ease-out cursor-pointer text-left",
9193
+ "hover:-translate-y-0.5 hover:shadow-[var(--j3m-shadow-md)]",
9194
+ styles.card
8815
9195
  ),
8816
9196
  children: [
8817
9197
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
8818
- /* @__PURE__ */ jsx("div", { className: cn(
8819
- "flex items-center justify-center h-8 w-8 rounded-lg",
8820
- iconStyles.bg
8821
- ), children: /* @__PURE__ */ jsx(Truck, { className: cn("h-4 w-4", iconStyles.icon) }) }),
9198
+ /* @__PURE__ */ jsx(Truck, { className: cn("h-5 w-5 shrink-0", styles.icon) }),
8822
9199
  /* @__PURE__ */ jsxs("div", { children: [
8823
9200
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
8824
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: delivery.label || `Delivery ${index + 1}` }),
9201
+ /* @__PURE__ */ jsx("span", { className: cn("text-sm font-medium", styles.title), children: delivery.label || `Delivery ${index + 1}` }),
8825
9202
  hasComments && /* @__PURE__ */ jsxs("div", { className: "relative", children: [
8826
9203
  /* @__PURE__ */ jsx(MessageSquare, { className: "h-3 w-3 text-muted-foreground" }),
8827
9204
  /* @__PURE__ */ jsx("span", { className: "absolute -top-0.5 -right-0.5 h-1.5 w-1.5 rounded-full bg-primary" })
8828
9205
  ] })
8829
9206
  ] }),
8830
- delivery.destination && /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground", children: [
9207
+ delivery.destination && /* @__PURE__ */ jsxs("div", { className: cn("text-xs", styles.subtitle), children: [
8831
9208
  "\u2192 ",
8832
9209
  delivery.destination
8833
9210
  ] })
@@ -8842,7 +9219,7 @@ function DeliveryListItem2({
8842
9219
  children: getStatusLabel2(delivery.status, isComplete)
8843
9220
  }
8844
9221
  ),
8845
- /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
9222
+ /* @__PURE__ */ jsx(ChevronRight, { className: cn("h-4 w-4", styles.chevron) })
8846
9223
  ] })
8847
9224
  ]
8848
9225
  }
@@ -8855,7 +9232,7 @@ function DeliveryDetailsView2({
8855
9232
  onAddComment
8856
9233
  }) {
8857
9234
  const elements = delivery.elements ?? [];
8858
- const categorizedElements = React29.useMemo(() => {
9235
+ const categorizedElements = React27.useMemo(() => {
8859
9236
  const sent = [];
8860
9237
  const notSent = [];
8861
9238
  const moved = [];
@@ -9189,10 +9566,10 @@ function WeekDetailSheet({
9189
9566
  onAddProductionComment,
9190
9567
  onAddDeliveryComment
9191
9568
  }) {
9192
- const [selectedDelivery, setSelectedDelivery] = React29.useState(null);
9193
- const [productionDialogOpen, setProductionDialogOpen] = React29.useState(false);
9194
- const [previousProducedCount, setPreviousProducedCount] = React29.useState(void 0);
9195
- const productionElements = React29.useMemo(() => {
9569
+ const [selectedDelivery, setSelectedDelivery] = React27.useState(null);
9570
+ const [productionDialogOpen, setProductionDialogOpen] = React27.useState(false);
9571
+ const [previousProducedCount, setPreviousProducedCount] = React27.useState(void 0);
9572
+ const productionElements = React27.useMemo(() => {
9196
9573
  if (!data?.deliveries) return [];
9197
9574
  const elements = [];
9198
9575
  const seenIds = /* @__PURE__ */ new Set();
@@ -9216,12 +9593,12 @@ function WeekDetailSheet({
9216
9593
  return elements;
9217
9594
  }, [data?.deliveries]);
9218
9595
  const currentProducedCount = productionElements.filter((e) => e.isProduced).length;
9219
- React29.useEffect(() => {
9596
+ React27.useEffect(() => {
9220
9597
  if (open && data?.deliveries) {
9221
9598
  setPreviousProducedCount(currentProducedCount);
9222
9599
  }
9223
9600
  }, [open]);
9224
- React29.useEffect(() => {
9601
+ React27.useEffect(() => {
9225
9602
  if (!open) {
9226
9603
  setSelectedDelivery(null);
9227
9604
  setProductionDialogOpen(false);
@@ -9454,13 +9831,13 @@ function CalibrationWeekCell({
9454
9831
  onAddClick,
9455
9832
  ...props
9456
9833
  }) {
9457
- const inputRef = React29.useRef(null);
9458
- const [localValue, setLocalValue] = React29.useState(
9834
+ const inputRef = React27.useRef(null);
9835
+ const [localValue, setLocalValue] = React27.useState(
9459
9836
  data.entered !== null ? String(data.entered) : ""
9460
9837
  );
9461
- const [isHovered, setIsHovered] = React29.useState(false);
9462
- const [isEditing, setIsEditing] = React29.useState(false);
9463
- React29.useEffect(() => {
9838
+ const [isHovered, setIsHovered] = React27.useState(false);
9839
+ const [isEditing, setIsEditing] = React27.useState(false);
9840
+ React27.useEffect(() => {
9464
9841
  setLocalValue(data.entered !== null ? String(data.entered) : "");
9465
9842
  }, [data.entered]);
9466
9843
  const unitLabel = formatCalibrationUnit(unit);
@@ -9646,11 +10023,11 @@ function CommentPopover({
9646
10023
  open,
9647
10024
  onOpenChange
9648
10025
  }) {
9649
- const [newCommentText, setNewCommentText] = React29.useState("");
9650
- const [selectedPrefixId, setSelectedPrefixId] = React29.useState("");
9651
- const [viewCommentsOpen, setViewCommentsOpen] = React29.useState(true);
9652
- const [showAddForm, setShowAddForm] = React29.useState(false);
9653
- const selectedPrefixName = React29.useMemo(() => {
10026
+ const [newCommentText, setNewCommentText] = React27.useState("");
10027
+ const [selectedPrefixId, setSelectedPrefixId] = React27.useState("");
10028
+ const [viewCommentsOpen, setViewCommentsOpen] = React27.useState(true);
10029
+ const [showAddForm, setShowAddForm] = React27.useState(false);
10030
+ const selectedPrefixName = React27.useMemo(() => {
9654
10031
  const prefix = availablePrefixes.find((p) => p.id === selectedPrefixId);
9655
10032
  return prefix?.name ?? "";
9656
10033
  }, [availablePrefixes, selectedPrefixId]);
@@ -9682,8 +10059,8 @@ function CommentPopover({
9682
10059
  minute: "2-digit"
9683
10060
  }).format(date);
9684
10061
  };
9685
- const prevOpenRef = React29.useRef(open);
9686
- React29.useEffect(() => {
10062
+ const prevOpenRef = React27.useRef(open);
10063
+ React27.useEffect(() => {
9687
10064
  const wasOpen = prevOpenRef.current;
9688
10065
  prevOpenRef.current = open;
9689
10066
  if (wasOpen && !open) {
@@ -9912,7 +10289,7 @@ function CalibrationTable({
9912
10289
  onAddComment,
9913
10290
  onAddEarlierWeek
9914
10291
  } = config;
9915
- const calculatedStartDate = React29.useMemo(() => {
10292
+ const calculatedStartDate = React27.useMemo(() => {
9916
10293
  if (startDate) return startDate;
9917
10294
  let earliest = null;
9918
10295
  for (const prefix of prefixes) {
@@ -9933,31 +10310,31 @@ function CalibrationTable({
9933
10310
  }
9934
10311
  return earliest ?? /* @__PURE__ */ new Date();
9935
10312
  }, [startDate, prefixes]);
9936
- const [additionalWeeks, setAdditionalWeeks] = React29.useState(0);
9937
- const weeks = React29.useMemo(() => {
10313
+ const [additionalWeeks, setAdditionalWeeks] = React27.useState(0);
10314
+ const weeks = React27.useMemo(() => {
9938
10315
  const start = new Date(calculatedStartDate);
9939
10316
  start.setDate(start.getDate() - additionalWeeks * 7);
9940
10317
  return generateWeeks(start, weekCount + additionalWeeks);
9941
10318
  }, [calculatedStartDate, weekCount, additionalWeeks]);
9942
- React29.useMemo(() => {
10319
+ React27.useMemo(() => {
9943
10320
  const currentWeek = weeks.find((w) => w.isCurrentWeek);
9944
10321
  return currentWeek ? getWeekKey(currentWeek.startDate) : null;
9945
10322
  }, [weeks]);
9946
- const [currentPage, setCurrentPage] = React29.useState(0);
9947
- const [pageSize, setPageSize] = React29.useState(defaultPageSize);
9948
- const [searchQuery, setSearchQuery] = React29.useState("");
9949
- const filteredPrefixes = React29.useMemo(() => {
10323
+ const [currentPage, setCurrentPage] = React27.useState(0);
10324
+ const [pageSize, setPageSize] = React27.useState(defaultPageSize);
10325
+ const [searchQuery, setSearchQuery] = React27.useState("");
10326
+ const filteredPrefixes = React27.useMemo(() => {
9950
10327
  if (!searchQuery) return prefixes;
9951
10328
  const query = searchQuery.toLowerCase();
9952
10329
  return prefixes.filter(
9953
10330
  (p) => p.name.toLowerCase().includes(query) || p.typeCode.toLowerCase().includes(query)
9954
10331
  );
9955
10332
  }, [prefixes, searchQuery]);
9956
- const paginatedPrefixes = React29.useMemo(() => {
10333
+ const paginatedPrefixes = React27.useMemo(() => {
9957
10334
  const start = currentPage * pageSize;
9958
10335
  return filteredPrefixes.slice(start, start + pageSize);
9959
10336
  }, [filteredPrefixes, currentPage, pageSize]);
9960
- React29.useMemo(
10337
+ React27.useMemo(
9961
10338
  () => canSubmitCalibration(prefixes),
9962
10339
  [prefixes]
9963
10340
  );
@@ -9981,10 +10358,88 @@ function CalibrationTable({
9981
10358
  }
9982
10359
  return allComments;
9983
10360
  };
9984
- const availablePrefixes = React29.useMemo(
10361
+ const availablePrefixes = React27.useMemo(
9985
10362
  () => prefixes.map((p) => ({ id: p.id, name: p.name })),
9986
10363
  [prefixes]
9987
10364
  );
10365
+ const insightMetrics = React27.useMemo(() => {
10366
+ let totalCalibrated = 0;
10367
+ let totalRequired = 0;
10368
+ for (const prefix of prefixes) {
10369
+ for (const weekKey in prefix.weeks) {
10370
+ const cell = prefix.weeks[weekKey];
10371
+ if (cell.planned > 0) {
10372
+ totalRequired += cell.planned;
10373
+ totalCalibrated += cell.entered ?? 0;
10374
+ }
10375
+ }
10376
+ }
10377
+ const completeness = totalRequired > 0 ? totalCalibrated / totalRequired * 100 : 0;
10378
+ const remaining = Math.max(0, totalRequired - totalCalibrated);
10379
+ return [
10380
+ {
10381
+ key: "calibrated",
10382
+ label: "calibrated",
10383
+ value: totalCalibrated,
10384
+ unit: "tons",
10385
+ icon: "factory",
10386
+ status: completeness >= 100 ? "success" : "normal"
10387
+ },
10388
+ {
10389
+ key: "remaining",
10390
+ label: "remaining",
10391
+ value: remaining,
10392
+ unit: "tons",
10393
+ icon: "factory",
10394
+ status: remaining > 0 ? "warning" : "success"
10395
+ },
10396
+ {
10397
+ key: "completeness",
10398
+ label: "complete",
10399
+ value: completeness,
10400
+ isPercentage: true,
10401
+ icon: "trending",
10402
+ status: completeness >= 100 ? "success" : completeness >= 50 ? "normal" : "warning"
10403
+ }
10404
+ ];
10405
+ }, [prefixes]);
10406
+ const columnSummaryData = React27.useMemo(() => {
10407
+ return weeks.map((week) => {
10408
+ const weekKey = getWeekKey(week.startDate);
10409
+ let calibratedTons = 0;
10410
+ let requiredTons = 0;
10411
+ let hasShortfall = false;
10412
+ let allValid = true;
10413
+ for (const prefix of prefixes) {
10414
+ const cell = prefix.weeks[weekKey];
10415
+ if (cell) {
10416
+ requiredTons += cell.planned;
10417
+ calibratedTons += cell.entered ?? 0;
10418
+ if (cell.status === "shortfall") hasShortfall = true;
10419
+ if (cell.status !== "valid" && cell.planned > 0) allValid = false;
10420
+ }
10421
+ }
10422
+ let status2 = "normal";
10423
+ if (hasShortfall) {
10424
+ status2 = "critical";
10425
+ } else if (allValid && requiredTons > 0) {
10426
+ status2 = "complete";
10427
+ }
10428
+ return {
10429
+ columnKey: weekKey,
10430
+ primary: {
10431
+ value: calibratedTons,
10432
+ unit: "t",
10433
+ icon: "factory"
10434
+ },
10435
+ secondary: {
10436
+ value: requiredTons,
10437
+ unit: "t req"
10438
+ },
10439
+ status: status2
10440
+ };
10441
+ });
10442
+ }, [weeks, prefixes]);
9988
10443
  return /* @__PURE__ */ jsxs(
9989
10444
  "div",
9990
10445
  {
@@ -9995,6 +10450,7 @@ function CalibrationTable({
9995
10450
  /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold tracking-tight", children: "Weekly Production Calibration" }),
9996
10451
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Review required weekly production and confirm achievable output at the selected checkpoint." })
9997
10452
  ] }) }),
10453
+ /* @__PURE__ */ jsx(InsightBar, { metrics: insightMetrics }),
9998
10454
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
9999
10455
  showToolbar && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
10000
10456
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(
@@ -10027,36 +10483,74 @@ function CalibrationTable({
10027
10483
  style: { maxHeight },
10028
10484
  children: [
10029
10485
  /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse", children: [
10030
- /* @__PURE__ */ jsx("thead", { className: "sticky top-0 z-20", children: /* @__PURE__ */ jsxs("tr", { children: [
10031
- /* @__PURE__ */ jsx("th", { className: cn(
10032
- "h-14 px-3 text-left align-middle font-semibold text-xs text-muted-foreground uppercase tracking-wide",
10033
- "border-r border-b border-border bg-sidebar",
10034
- stickyRowHeader && "sticky left-0 z-30 min-w-[200px]",
10035
- // Right shadow using Quantum token
10036
- stickyRowHeader && "shadow-[var(--j3m-shadow-sticky-edge)]"
10037
- ), children: "Supplier / Scope" }),
10038
- weeks.map((week) => {
10039
- const weekKey = getWeekKey(week.startDate);
10040
- const weekComments = getWeekComments(weekKey);
10041
- return /* @__PURE__ */ jsx(
10042
- "th",
10043
- {
10044
- className: "h-14 px-2 text-left align-middle border-r border-b border-border last:border-r-0 min-w-[220px] bg-sidebar",
10045
- children: /* @__PURE__ */ jsx(
10046
- CalibrationWeekHeader,
10047
- {
10048
- week,
10049
- comments: weekComments,
10050
- showCommentButton: true,
10051
- availablePrefixes,
10052
- onAddComment: (text, prefixId, prefixName) => handleAddWeekComment(weekKey, text, prefixId)
10053
- }
10054
- )
10055
- },
10056
- weekKey
10057
- );
10058
- })
10059
- ] }) }),
10486
+ /* @__PURE__ */ jsxs("thead", { className: "sticky top-0 z-20", children: [
10487
+ /* @__PURE__ */ jsxs("tr", { children: [
10488
+ /* @__PURE__ */ jsx("th", { className: cn(
10489
+ "h-14 px-3 text-left align-middle font-semibold text-xs text-muted-foreground uppercase tracking-wide",
10490
+ "border-r border-b border-border bg-sidebar",
10491
+ stickyRowHeader && "sticky left-0 z-30 min-w-[200px]",
10492
+ // Right shadow using Quantum token
10493
+ stickyRowHeader && "shadow-[var(--j3m-shadow-sticky-edge)]"
10494
+ ), children: "Supplier / Scope" }),
10495
+ weeks.map((week) => {
10496
+ const weekKey = getWeekKey(week.startDate);
10497
+ const weekComments = getWeekComments(weekKey);
10498
+ return /* @__PURE__ */ jsx(
10499
+ "th",
10500
+ {
10501
+ className: "h-14 px-2 text-left align-middle border-r border-b border-border last:border-r-0 min-w-[220px] bg-sidebar",
10502
+ children: /* @__PURE__ */ jsx(
10503
+ CalibrationWeekHeader,
10504
+ {
10505
+ week,
10506
+ comments: weekComments,
10507
+ showCommentButton: true,
10508
+ availablePrefixes,
10509
+ onAddComment: (text, prefixId, prefixName) => handleAddWeekComment(weekKey, text, prefixId)
10510
+ }
10511
+ )
10512
+ },
10513
+ weekKey
10514
+ );
10515
+ })
10516
+ ] }),
10517
+ /* @__PURE__ */ jsxs("tr", { children: [
10518
+ /* @__PURE__ */ jsx("th", { className: cn(
10519
+ "h-auto px-3 py-1.5 text-left align-middle",
10520
+ "border-r border-b border-border bg-muted/30",
10521
+ stickyRowHeader && "sticky left-0 z-30 min-w-[200px]",
10522
+ stickyRowHeader && "shadow-[var(--j3m-shadow-sticky-edge)]"
10523
+ ), children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wide", children: "Summary" }) }),
10524
+ columnSummaryData.map((summary) => {
10525
+ const statusBg = summary.status === "complete" ? "bg-green-50/50 dark:bg-green-950/30" : summary.status === "critical" ? "bg-red-50/50 dark:bg-red-950/30" : "bg-muted/30";
10526
+ const statusText = summary.status === "complete" ? "text-green-700 dark:text-green-300" : summary.status === "critical" ? "text-red-700 dark:text-red-300" : "text-muted-foreground";
10527
+ return /* @__PURE__ */ jsx(
10528
+ "th",
10529
+ {
10530
+ className: cn(
10531
+ "h-auto px-2 py-1.5 text-left align-middle",
10532
+ "border-r border-b border-border last:border-r-0 min-w-[220px]",
10533
+ statusBg
10534
+ ),
10535
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
10536
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
10537
+ /* @__PURE__ */ jsx(Factory, { className: cn("h-3 w-3", statusText) }),
10538
+ /* @__PURE__ */ jsxs("span", { className: cn("text-xs font-medium tabular-nums", statusText), children: [
10539
+ summary.primary?.value.toLocaleString(void 0, { maximumFractionDigits: 1 }),
10540
+ " t"
10541
+ ] })
10542
+ ] }),
10543
+ /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-muted-foreground tabular-nums", children: [
10544
+ summary.secondary?.value.toLocaleString(void 0, { maximumFractionDigits: 1 }),
10545
+ " t req"
10546
+ ] })
10547
+ ] })
10548
+ },
10549
+ summary.columnKey
10550
+ );
10551
+ })
10552
+ ] })
10553
+ ] }),
10060
10554
  /* @__PURE__ */ jsx("tbody", { className: "bg-background", children: paginatedPrefixes.length > 0 ? paginatedPrefixes.map((prefix) => {
10061
10555
  const sortedWeekKeys = weeks.map((w) => getWeekKey(w.startDate));
10062
10556
  let hasDeficit = false;
@@ -10218,14 +10712,14 @@ function CommentDialog({
10218
10712
  open,
10219
10713
  onOpenChange
10220
10714
  }) {
10221
- const [selectedPrefixId, setSelectedPrefixId] = React29.useState("");
10222
- const [selectedWeekKey, setSelectedWeekKey] = React29.useState("");
10223
- const [commentText, setCommentText] = React29.useState("");
10224
- const currentWeek = React29.useMemo(
10715
+ const [selectedPrefixId, setSelectedPrefixId] = React27.useState("");
10716
+ const [selectedWeekKey, setSelectedWeekKey] = React27.useState("");
10717
+ const [commentText, setCommentText] = React27.useState("");
10718
+ const currentWeek = React27.useMemo(
10225
10719
  () => weeks.find((w) => w.isCurrentWeek),
10226
10720
  [weeks]
10227
10721
  );
10228
- React29.useEffect(() => {
10722
+ React27.useEffect(() => {
10229
10723
  if (open) {
10230
10724
  setSelectedPrefixId(prefixes[0]?.id ?? "");
10231
10725
  setSelectedWeekKey(currentWeek ? getWeekKey(currentWeek.startDate) : weeks[0] ? getWeekKey(weeks[0].startDate) : "");
@@ -10555,35 +11049,39 @@ function groupDeliveriesByPrefixAndDay(deliveries) {
10555
11049
  }
10556
11050
  return grouped;
10557
11051
  }
10558
- function getCardStyles(state, hasRisk, isHovered) {
11052
+ function getCardStyles(state, hasRisk) {
10559
11053
  if (hasRisk) {
10560
11054
  return {
10561
- stroke: "border-l-[3px] border-l-red-500",
10562
- cardBg: "bg-background",
10563
- titleColor: "text-foreground",
11055
+ fill: statusCellFillClasses.risk.combined,
11056
+ titleColor: statusCellTextClasses.risk.title,
11057
+ subtitleColor: statusCellTextClasses.risk.subtitle,
11058
+ iconColor: statusCellTextClasses.risk.icon,
10564
11059
  opacity: ""
10565
11060
  };
10566
11061
  }
10567
11062
  switch (state) {
10568
11063
  case "sent":
10569
11064
  return {
10570
- stroke: "border-l-[3px] border-l-green-500/40",
10571
- cardBg: "bg-muted/40",
10572
- titleColor: "text-muted-foreground",
10573
- opacity: "opacity-60"
11065
+ fill: statusCellFillClasses.shipped.combined,
11066
+ titleColor: statusCellTextClasses.shipped.title,
11067
+ subtitleColor: statusCellTextClasses.shipped.subtitle,
11068
+ iconColor: statusCellTextClasses.shipped.icon,
11069
+ opacity: "opacity-75"
10574
11070
  };
10575
11071
  case "ready":
10576
11072
  return {
10577
- stroke: "border-l-[4px] border-l-green-500",
10578
- cardBg: "bg-background",
10579
- titleColor: "text-foreground",
11073
+ fill: statusCellFillClasses.ready.combined,
11074
+ titleColor: statusCellTextClasses.ready.title,
11075
+ subtitleColor: statusCellTextClasses.ready.subtitle,
11076
+ iconColor: statusCellTextClasses.ready.icon,
10580
11077
  opacity: ""
10581
11078
  };
10582
11079
  default:
10583
11080
  return {
10584
- stroke: isHovered ? "border-l-[3px] border-l-primary/50" : "border-l-[3px] border-l-border",
10585
- cardBg: "bg-background",
10586
- titleColor: "text-foreground",
11081
+ fill: statusCellFillClasses.normal.combined,
11082
+ titleColor: statusCellTextClasses.normal.title,
11083
+ subtitleColor: statusCellTextClasses.normal.subtitle,
11084
+ iconColor: statusCellTextClasses.normal.icon,
10587
11085
  opacity: ""
10588
11086
  };
10589
11087
  }
@@ -10594,10 +11092,9 @@ function DeliveryBadge({
10594
11092
  onCommentClick,
10595
11093
  className
10596
11094
  }) {
10597
- const [isHovered, setIsHovered] = React29.useState(false);
10598
11095
  const hasComments = delivery.comments.length > 0;
10599
11096
  const visualState = getDeliveryVisualState(delivery);
10600
- const styles = getCardStyles(visualState, delivery.hasProductionRisk ?? false, isHovered);
11097
+ const styles = getCardStyles(visualState, delivery.hasProductionRisk ?? false);
10601
11098
  const projectName = delivery.destination || delivery.label;
10602
11099
  const handleClick = (e) => {
10603
11100
  e.stopPropagation();
@@ -10620,16 +11117,14 @@ function DeliveryBadge({
10620
11117
  className: cn(
10621
11118
  // Position relative for comment button
10622
11119
  "relative",
10623
- // Full-width in cell, 90° corners (j3m.radius.none)
10624
- "w-full rounded-none",
11120
+ // Full-width in cell, small radius (matching planning cards)
11121
+ "w-full rounded-lg",
10625
11122
  // Compact sizing - min-h-[72px], p-4 (j3m.spacing.m)
10626
11123
  "min-h-[72px] p-4",
10627
- // Card base: dynamic background based on state
10628
- styles.cardBg,
10629
- "border border-border",
10630
- // Left stroke for status
10631
- styles.stroke,
10632
- // Opacity for shipped state only
11124
+ // FULL-CARD STATUS FILL - uses shared calibration/planning tokens
11125
+ // This is the key change: status fill on outermost container
11126
+ styles.fill,
11127
+ // Opacity for shipped state
10633
11128
  styles.opacity,
10634
11129
  // Interactive states (disabled hover lift for shipped)
10635
11130
  "transition-all duration-200 ease-out",
@@ -10648,6 +11143,8 @@ function DeliveryBadge({
10648
11143
  // 44px touch target for accessibility
10649
11144
  "h-11 w-11",
10650
11145
  "rounded-full",
11146
+ // Subtle background for visibility on colored fills
11147
+ "bg-background/50 hover:bg-background/80",
10651
11148
  hasComments && "text-primary"
10652
11149
  ),
10653
11150
  onClick: handleCommentClick,
@@ -10670,8 +11167,6 @@ function DeliveryBadge({
10670
11167
  type: "button",
10671
11168
  onClick: handleClick,
10672
11169
  onKeyDown: handleKeyDown,
10673
- onMouseEnter: () => setIsHovered(true),
10674
- onMouseLeave: () => setIsHovered(false),
10675
11170
  className: cn(
10676
11171
  // Full width, no background (inherits from parent)
10677
11172
  "w-full bg-transparent text-left",
@@ -10689,14 +11184,15 @@ function DeliveryBadge({
10689
11184
  "text-sm font-semibold leading-tight line-clamp-2",
10690
11185
  styles.titleColor
10691
11186
  ), children: projectName }),
10692
- delivery.hasProductionRisk && /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 text-red-500 shrink-0 mt-0.5" })
11187
+ delivery.hasProductionRisk && /* @__PURE__ */ jsx(AlertTriangle, { className: cn("h-4 w-4 shrink-0 mt-0.5", styles.iconColor) })
10693
11188
  ] }),
10694
11189
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 mt-2", children: [
10695
11190
  visualState === "sent" && /* @__PURE__ */ jsxs(Fragment, { children: [
10696
- /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 text-green-600 dark:text-green-400 shrink-0" }),
10697
- /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wide", children: "Shipped" })
11191
+ /* @__PURE__ */ jsx(Check, { className: cn("h-3.5 w-3.5 shrink-0", styles.iconColor) }),
11192
+ /* @__PURE__ */ jsx("span", { className: cn("text-[10px] font-medium uppercase tracking-wide", styles.subtitleColor), children: "Shipped" })
10698
11193
  ] }),
10699
- visualState === "ready" && /* @__PURE__ */ jsx("span", { className: "text-[10px] font-semibold text-green-600 dark:text-green-400 uppercase tracking-wide", children: "Ready" })
11194
+ visualState === "ready" && /* @__PURE__ */ jsx("span", { className: cn("text-[10px] font-semibold uppercase tracking-wide", styles.subtitleColor), children: "Ready" }),
11195
+ delivery.hasProductionRisk && visualState !== "sent" && /* @__PURE__ */ jsx("span", { className: cn("text-[10px] font-semibold uppercase tracking-wide", styles.subtitleColor), children: "At Risk" })
10700
11196
  ] })
10701
11197
  ]
10702
11198
  }
@@ -10770,7 +11266,7 @@ function WeeklyLoadingView({
10770
11266
  showNavigation = true,
10771
11267
  className
10772
11268
  }) {
10773
- const [shippedOpenState, setShippedOpenState] = React29.useState({
11269
+ const [shippedOpenState, setShippedOpenState] = React27.useState({
10774
11270
  1: false,
10775
11271
  // Monday
10776
11272
  2: false,
@@ -10788,7 +11284,7 @@ function WeeklyLoadingView({
10788
11284
  [dayOfWeek]: !prev[dayOfWeek]
10789
11285
  }));
10790
11286
  };
10791
- const weekDays = React29.useMemo(() => {
11287
+ const weekDays = React27.useMemo(() => {
10792
11288
  const days = [];
10793
11289
  for (let i = 0; i < 5; i++) {
10794
11290
  const date = addDays(week.startDate, i);
@@ -10800,7 +11296,7 @@ function WeeklyLoadingView({
10800
11296
  }
10801
11297
  return days;
10802
11298
  }, [week.startDate]);
10803
- const deliveriesByDay = React29.useMemo(() => {
11299
+ const deliveriesByDay = React27.useMemo(() => {
10804
11300
  const grouped = /* @__PURE__ */ new Map();
10805
11301
  for (let i = 1; i <= 5; i++) {
10806
11302
  grouped.set(i, { pending: [], shipped: [] });
@@ -10820,6 +11316,19 @@ function WeeklyLoadingView({
10820
11316
  }, [deliveries]);
10821
11317
  const totalPendingDeliveries = deliveries.filter((d) => !isShippedDelivery(d)).length;
10822
11318
  const totalShippedDeliveries = deliveries.filter((d) => isShippedDelivery(d)).length;
11319
+ const daySummaryData = React27.useMemo(() => {
11320
+ const summaries = /* @__PURE__ */ new Map();
11321
+ for (let i = 1; i <= 5; i++) {
11322
+ const dayData = deliveriesByDay.get(i) ?? { pending: [], shipped: [] };
11323
+ const allDayDeliveries = [...dayData.pending, ...dayData.shipped];
11324
+ summaries.set(i, {
11325
+ deliveries: allDayDeliveries.length,
11326
+ tonsRequired: allDayDeliveries.reduce((sum, d) => sum + (d.totalTons ?? 0), 0),
11327
+ tonsProduced: allDayDeliveries.reduce((sum, d) => sum + (d.producedTons ?? 0), 0)
11328
+ });
11329
+ }
11330
+ return summaries;
11331
+ }, [deliveriesByDay]);
10823
11332
  return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", className), children: [
10824
11333
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 border-b border-border p-4 lg:flex-row lg:items-center lg:justify-between", children: [
10825
11334
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
@@ -10904,6 +11413,42 @@ function WeeklyLoadingView({
10904
11413
  },
10905
11414
  dayOfWeek
10906
11415
  )) }),
11416
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-5 border-b border-border", children: weekDays.map(({ dayOfWeek, isToday: dayIsToday }) => {
11417
+ const summary = daySummaryData.get(dayOfWeek) ?? { deliveries: 0, tonsRequired: 0, tonsProduced: 0 };
11418
+ const productionComplete = summary.tonsRequired > 0 && summary.tonsProduced >= summary.tonsRequired;
11419
+ return /* @__PURE__ */ jsxs(
11420
+ "div",
11421
+ {
11422
+ className: cn(
11423
+ "flex flex-col gap-0.5 py-1.5 px-2",
11424
+ productionComplete ? "bg-green-50/50 dark:bg-green-950/30" : "bg-muted/20",
11425
+ dayIsToday && "bg-primary/5"
11426
+ ),
11427
+ children: [
11428
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11429
+ /* @__PURE__ */ jsx(Truck, { className: "h-3 w-3 text-muted-foreground" }),
11430
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-medium tabular-nums text-muted-foreground", children: summary.deliveries })
11431
+ ] }),
11432
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11433
+ /* @__PURE__ */ jsx(Factory, { className: cn(
11434
+ "h-3 w-3",
11435
+ productionComplete ? "text-green-600 dark:text-green-400" : "text-muted-foreground"
11436
+ ) }),
11437
+ /* @__PURE__ */ jsxs("span", { className: cn(
11438
+ "text-[10px] tabular-nums",
11439
+ productionComplete ? "text-green-700 dark:text-green-300" : "text-muted-foreground"
11440
+ ), children: [
11441
+ summary.tonsProduced.toLocaleString(void 0, { maximumFractionDigits: 1 }),
11442
+ "/",
11443
+ summary.tonsRequired.toLocaleString(void 0, { maximumFractionDigits: 1 }),
11444
+ " t"
11445
+ ] })
11446
+ ] })
11447
+ ]
11448
+ },
11449
+ dayOfWeek
11450
+ );
11451
+ }) }),
10907
11452
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-5", children: weekDays.map(({ dayOfWeek, isToday: dayIsToday }) => {
10908
11453
  const dayData = deliveriesByDay.get(dayOfWeek) ?? { pending: [], shipped: [] };
10909
11454
  const hasPending = dayData.pending.length > 0;
@@ -11125,7 +11670,7 @@ function DeliveryTimeline({ timelineState }) {
11125
11670
  const state = getStateForStep(step.id);
11126
11671
  const styles = getStepStyles(state);
11127
11672
  const isLast = index === TIMELINE_STEPS.length - 1;
11128
- return /* @__PURE__ */ jsxs(React29.Fragment, { children: [
11673
+ return /* @__PURE__ */ jsxs(React27.Fragment, { children: [
11129
11674
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
11130
11675
  /* @__PURE__ */ jsx(
11131
11676
  "div",
@@ -11260,7 +11805,7 @@ function AddCommentDialog({
11260
11805
  weekId,
11261
11806
  onAddComment
11262
11807
  }) {
11263
- const [commentText, setCommentText] = React29.useState("");
11808
+ const [commentText, setCommentText] = React27.useState("");
11264
11809
  const handleSubmit = () => {
11265
11810
  if (commentText.trim() && onAddComment) {
11266
11811
  onAddComment({
@@ -11285,7 +11830,7 @@ function AddCommentDialog({
11285
11830
  handleSubmit();
11286
11831
  }
11287
11832
  };
11288
- React29.useEffect(() => {
11833
+ React27.useEffect(() => {
11289
11834
  if (!open) {
11290
11835
  setCommentText("");
11291
11836
  }
@@ -11348,8 +11893,8 @@ function CommentsSection({
11348
11893
  weekId,
11349
11894
  onAddComment
11350
11895
  }) {
11351
- const [viewCommentsOpen, setViewCommentsOpen] = React29.useState(true);
11352
- const [addDialogOpen, setAddDialogOpen] = React29.useState(false);
11896
+ const [viewCommentsOpen, setViewCommentsOpen] = React27.useState(true);
11897
+ const [addDialogOpen, setAddDialogOpen] = React27.useState(false);
11353
11898
  const formatDate3 = (date) => {
11354
11899
  return new Intl.DateTimeFormat("en-US", {
11355
11900
  month: "short",
@@ -11423,7 +11968,7 @@ function DeliveryDetailPage({
11423
11968
  onConfirmLoad
11424
11969
  }) {
11425
11970
  const timelineState = getTimelineState(delivery);
11426
- const elementsByStatus = React29.useMemo(() => {
11971
+ const elementsByStatus = React27.useMemo(() => {
11427
11972
  const loaded = delivery.elements.filter((e) => e.status === "loaded");
11428
11973
  const missing = delivery.elements.filter((e) => e.status === "missing");
11429
11974
  const moved = delivery.elements.filter((e) => e.status === "moved");
@@ -11610,11 +12155,11 @@ function SupplierWeeklyLoading({
11610
12155
  bordered = true,
11611
12156
  className
11612
12157
  }) {
11613
- const [selectedDelivery, setSelectedDelivery] = React29.useState(null);
11614
- const [sheetOpen, setSheetOpen] = React29.useState(false);
11615
- const [commentDelivery, setCommentDelivery] = React29.useState(null);
11616
- const [commentDialogOpen, setCommentDialogOpen] = React29.useState(false);
11617
- const [commentText, setCommentText] = React29.useState("");
12158
+ const [selectedDelivery, setSelectedDelivery] = React27.useState(null);
12159
+ const [sheetOpen, setSheetOpen] = React27.useState(false);
12160
+ const [commentDelivery, setCommentDelivery] = React27.useState(null);
12161
+ const [commentDialogOpen, setCommentDialogOpen] = React27.useState(false);
12162
+ const [commentText, setCommentText] = React27.useState("");
11618
12163
  const handleDeliveryClick = (delivery) => {
11619
12164
  setSelectedDelivery(delivery);
11620
12165
  setSheetOpen(true);
@@ -11657,31 +12202,74 @@ function SupplierWeeklyLoading({
11657
12202
  handleCommentSubmit();
11658
12203
  }
11659
12204
  };
12205
+ const insightMetrics = React27.useMemo(() => {
12206
+ const totalDeliveries = deliveries.length;
12207
+ const readyDeliveries = deliveries.filter((d) => d.isReadyToUnload).length;
12208
+ deliveries.filter(
12209
+ (d) => d.status === "shipped" || d.status === "delivered"
12210
+ ).length;
12211
+ const totalTonsRequired = deliveries.reduce((sum, d) => sum + (d.totalTons ?? 0), 0);
12212
+ const producedTons = deliveries.reduce((sum, d) => sum + (d.producedTons ?? 0), 0);
12213
+ return [
12214
+ {
12215
+ key: "deliveries",
12216
+ label: "deliveries",
12217
+ value: totalDeliveries,
12218
+ icon: "truck",
12219
+ status: "normal"
12220
+ },
12221
+ {
12222
+ key: "ready",
12223
+ label: "ready",
12224
+ value: readyDeliveries,
12225
+ icon: "check",
12226
+ status: readyDeliveries > 0 ? "success" : "normal"
12227
+ },
12228
+ {
12229
+ key: "required",
12230
+ label: "tons required",
12231
+ value: totalTonsRequired,
12232
+ unit: "t",
12233
+ icon: "factory",
12234
+ status: "normal"
12235
+ },
12236
+ {
12237
+ key: "produced",
12238
+ label: "tons produced",
12239
+ value: producedTons,
12240
+ unit: "t",
12241
+ icon: "factory",
12242
+ status: producedTons >= totalTonsRequired ? "success" : producedTons >= totalTonsRequired * 0.5 ? "normal" : "warning"
12243
+ }
12244
+ ];
12245
+ }, [deliveries]);
11660
12246
  const Wrapper = bordered ? Card : "div";
11661
12247
  const Content14 = bordered ? CardContent : "div";
11662
12248
  return /* @__PURE__ */ jsxs(Fragment, { children: [
11663
- /* @__PURE__ */ jsx(
11664
- Wrapper,
11665
- {
11666
- className: cn(
11667
- "flex flex-col overflow-hidden",
11668
- // Removed fixed min-height - content-driven sizing
11669
- !bordered && "border border-border bg-card rounded-lg",
11670
- className
11671
- ),
11672
- children: /* @__PURE__ */ jsx(Content14, { className: cn("flex-1 overflow-hidden p-0", !bordered && ""), children: /* @__PURE__ */ jsx(
11673
- WeeklyLoadingView,
11674
- {
11675
- week,
11676
- deliveries,
11677
- onDeliveryClick: handleDeliveryClick,
11678
- onDeliveryCommentClick: handleDeliveryCommentClick,
11679
- onWeekChange,
11680
- showNavigation
11681
- }
11682
- ) })
11683
- }
11684
- ),
12249
+ /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-0", className), children: [
12250
+ /* @__PURE__ */ jsx(InsightBar, { metrics: insightMetrics, className: "rounded-t-lg border border-b-0" }),
12251
+ /* @__PURE__ */ jsx(
12252
+ Wrapper,
12253
+ {
12254
+ className: cn(
12255
+ "flex flex-col overflow-hidden rounded-t-none",
12256
+ // Removed fixed min-height - content-driven sizing
12257
+ !bordered && "border border-border bg-card rounded-lg rounded-t-none"
12258
+ ),
12259
+ children: /* @__PURE__ */ jsx(Content14, { className: cn("flex-1 overflow-hidden p-0", !bordered && ""), children: /* @__PURE__ */ jsx(
12260
+ WeeklyLoadingView,
12261
+ {
12262
+ week,
12263
+ deliveries,
12264
+ onDeliveryClick: handleDeliveryClick,
12265
+ onDeliveryCommentClick: handleDeliveryCommentClick,
12266
+ onWeekChange,
12267
+ showNavigation
12268
+ }
12269
+ ) })
12270
+ }
12271
+ )
12272
+ ] }),
11685
12273
  /* @__PURE__ */ jsx(Sheet, { open: sheetOpen, onOpenChange: (open) => !open && handleSheetClose(), children: /* @__PURE__ */ jsxs(
11686
12274
  SheetContent,
11687
12275
  {
@@ -11758,35 +12346,39 @@ function SupplierWeeklyLoading({
11758
12346
  ] }) })
11759
12347
  ] });
11760
12348
  }
11761
- function getCardStyles2(state, hasRisk, isHovered) {
12349
+ function getCardStyles2(state, hasRisk) {
11762
12350
  if (hasRisk) {
11763
12351
  return {
11764
- stroke: "border-l-[3px] border-l-red-500",
11765
- cardBg: "bg-background",
11766
- titleColor: "text-foreground",
12352
+ fill: statusCellFillClasses.risk.combined,
12353
+ titleColor: statusCellTextClasses.risk.title,
12354
+ subtitleColor: statusCellTextClasses.risk.subtitle,
12355
+ iconColor: statusCellTextClasses.risk.icon,
11767
12356
  opacity: ""
11768
12357
  };
11769
12358
  }
11770
12359
  switch (state) {
11771
12360
  case "sent":
11772
12361
  return {
11773
- stroke: "border-l-[3px] border-l-green-500/40",
11774
- cardBg: "bg-muted/40",
11775
- titleColor: "text-muted-foreground",
11776
- opacity: "opacity-60"
12362
+ fill: statusCellFillClasses.shipped.combined,
12363
+ titleColor: statusCellTextClasses.shipped.title,
12364
+ subtitleColor: statusCellTextClasses.shipped.subtitle,
12365
+ iconColor: statusCellTextClasses.shipped.icon,
12366
+ opacity: "opacity-75"
11777
12367
  };
11778
12368
  case "ready":
11779
12369
  return {
11780
- stroke: "border-l-[4px] border-l-green-500",
11781
- cardBg: "bg-background",
11782
- titleColor: "text-foreground",
12370
+ fill: statusCellFillClasses.ready.combined,
12371
+ titleColor: statusCellTextClasses.ready.title,
12372
+ subtitleColor: statusCellTextClasses.ready.subtitle,
12373
+ iconColor: statusCellTextClasses.ready.icon,
11783
12374
  opacity: ""
11784
12375
  };
11785
12376
  default:
11786
12377
  return {
11787
- stroke: isHovered ? "border-l-[3px] border-l-primary/50" : "border-l-[3px] border-l-border",
11788
- cardBg: "bg-background",
11789
- titleColor: "text-foreground",
12378
+ fill: statusCellFillClasses.normal.combined,
12379
+ titleColor: statusCellTextClasses.normal.title,
12380
+ subtitleColor: statusCellTextClasses.normal.subtitle,
12381
+ iconColor: statusCellTextClasses.normal.icon,
11790
12382
  opacity: ""
11791
12383
  };
11792
12384
  }
@@ -11796,10 +12388,9 @@ function DeliveryCard({
11796
12388
  onTap,
11797
12389
  className
11798
12390
  }) {
11799
- const [isHovered, setIsHovered] = React29.useState(false);
11800
12391
  const hasComments = delivery.comments.length > 0;
11801
12392
  const visualState = getDeliveryVisualState(delivery);
11802
- const styles = getCardStyles2(visualState, delivery.hasProductionRisk ?? false, isHovered);
12393
+ const styles = getCardStyles2(visualState, delivery.hasProductionRisk ?? false);
11803
12394
  const projectName = delivery.destination || delivery.label;
11804
12395
  const handleClick = () => {
11805
12396
  onTap?.();
@@ -11817,19 +12408,15 @@ function DeliveryCard({
11817
12408
  tabIndex: 0,
11818
12409
  onClick: handleClick,
11819
12410
  onKeyDown: handleKeyDown,
11820
- onMouseEnter: () => setIsHovered(true),
11821
- onMouseLeave: () => setIsHovered(false),
11822
12411
  className: cn(
11823
- // Full-width, 90° corners (j3m.radius.none)
11824
- "w-full rounded-none",
12412
+ // Full-width, small radius (matching planning table cards)
12413
+ "w-full rounded-lg",
11825
12414
  // Touch-friendly sizing - 56px min-height for iPad
11826
12415
  "min-h-[56px] p-4",
11827
- // Card styling: dynamic background based on state
11828
- styles.cardBg,
11829
- "border border-border",
11830
- // Left stroke for status
11831
- styles.stroke,
11832
- // Opacity for shipped state only
12416
+ // FULL-CARD STATUS FILL - uses shared calibration/planning tokens
12417
+ // This is the key change: status fill on outermost container
12418
+ styles.fill,
12419
+ // Opacity for shipped state
11833
12420
  styles.opacity,
11834
12421
  // Hover/tap state - lift effect (disabled for shipped)
11835
12422
  "cursor-pointer transition-all duration-200 ease-out",
@@ -11846,21 +12433,22 @@ function DeliveryCard({
11846
12433
  "text-sm font-semibold truncate",
11847
12434
  styles.titleColor
11848
12435
  ), children: projectName }),
11849
- delivery.hasProductionRisk && /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 text-red-500 shrink-0" }),
11850
- hasComments && /* @__PURE__ */ jsxs("div", { className: "relative shrink-0", children: [
12436
+ delivery.hasProductionRisk && /* @__PURE__ */ jsx(AlertTriangle, { className: cn("h-4 w-4 shrink-0", styles.iconColor) }),
12437
+ hasComments && /* @__PURE__ */ jsxs("div", { className: "relative shrink-0 p-0.5 rounded bg-background/50", children: [
11851
12438
  /* @__PURE__ */ jsx(MessageSquare, { className: "h-3.5 w-3.5 text-muted-foreground" }),
11852
12439
  /* @__PURE__ */ jsx("span", { className: "absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-primary" })
11853
12440
  ] })
11854
12441
  ] }),
11855
12442
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
11856
12443
  visualState === "sent" && /* @__PURE__ */ jsxs(Fragment, { children: [
11857
- /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 text-green-600 dark:text-green-400 shrink-0" }),
11858
- /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wide", children: "Shipped" })
12444
+ /* @__PURE__ */ jsx(Check, { className: cn("h-3.5 w-3.5 shrink-0", styles.iconColor) }),
12445
+ /* @__PURE__ */ jsx("span", { className: cn("text-[10px] font-medium uppercase tracking-wide", styles.subtitleColor), children: "Shipped" })
11859
12446
  ] }),
11860
- visualState === "ready" && /* @__PURE__ */ jsx("span", { className: "text-[10px] font-semibold text-green-600 dark:text-green-400 uppercase tracking-wide", children: "Ready" })
12447
+ visualState === "ready" && /* @__PURE__ */ jsx("span", { className: cn("text-[10px] font-semibold uppercase tracking-wide", styles.subtitleColor), children: "Ready" }),
12448
+ delivery.hasProductionRisk && visualState !== "sent" && /* @__PURE__ */ jsx("span", { className: cn("text-[10px] font-semibold uppercase tracking-wide", styles.subtitleColor), children: "At Risk" })
11861
12449
  ] })
11862
12450
  ] }),
11863
- /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-muted-foreground shrink-0" })
12451
+ /* @__PURE__ */ jsx(ChevronRight, { className: cn("h-4 w-4 shrink-0", styles.iconColor) })
11864
12452
  ] })
11865
12453
  }
11866
12454
  );
@@ -11928,7 +12516,7 @@ var BADGE_VARIANT_LABELS = {
11928
12516
  colored: "Colored",
11929
12517
  mixed: "Mixed"
11930
12518
  };
11931
- var CalendarContext = React29.createContext(null);
12519
+ var CalendarContext = React27.createContext(null);
11932
12520
  function EventCalendarProvider({
11933
12521
  children,
11934
12522
  events: initialEvents = [],
@@ -11943,38 +12531,38 @@ function EventCalendarProvider({
11943
12531
  onEventUpdate,
11944
12532
  onEventDelete
11945
12533
  }) {
11946
- const [selectedDate, setSelectedDate] = React29.useState(defaultDate);
11947
- const [selectedUserId, setSelectedUserId] = React29.useState(defaultUserId);
11948
- const [events, setEventsState] = React29.useState(initialEvents);
11949
- const [users] = React29.useState(initialUsers);
11950
- const [badgeVariant, setBadgeVariant] = React29.useState(defaultBadgeVariant);
11951
- const [view, setView] = React29.useState(defaultView);
11952
- const [workingHours, setWorkingHours] = React29.useState(defaultWorkingHours);
11953
- const [visibleHours, setVisibleHours] = React29.useState(defaultVisibleHours);
11954
- React29.useEffect(() => {
12534
+ const [selectedDate, setSelectedDate] = React27.useState(defaultDate);
12535
+ const [selectedUserId, setSelectedUserId] = React27.useState(defaultUserId);
12536
+ const [events, setEventsState] = React27.useState(initialEvents);
12537
+ const [users] = React27.useState(initialUsers);
12538
+ const [badgeVariant, setBadgeVariant] = React27.useState(defaultBadgeVariant);
12539
+ const [view, setView] = React27.useState(defaultView);
12540
+ const [workingHours, setWorkingHours] = React27.useState(defaultWorkingHours);
12541
+ const [visibleHours, setVisibleHours] = React27.useState(defaultVisibleHours);
12542
+ React27.useEffect(() => {
11955
12543
  setEventsState(initialEvents);
11956
12544
  }, [initialEvents]);
11957
- const setEvents = React29.useCallback((newEvents) => {
12545
+ const setEvents = React27.useCallback((newEvents) => {
11958
12546
  setEventsState(newEvents);
11959
12547
  }, []);
11960
- const addEvent = React29.useCallback((event) => {
12548
+ const addEvent = React27.useCallback((event) => {
11961
12549
  setEventsState((prev) => [...prev, event]);
11962
12550
  onEventAdd?.(event);
11963
12551
  }, [onEventAdd]);
11964
- const updateEvent = React29.useCallback((event) => {
12552
+ const updateEvent = React27.useCallback((event) => {
11965
12553
  setEventsState(
11966
12554
  (prev) => prev.map((e) => e.id === event.id ? event : e)
11967
12555
  );
11968
12556
  onEventUpdate?.(event);
11969
12557
  }, [onEventUpdate]);
11970
- const deleteEvent = React29.useCallback((eventId) => {
12558
+ const deleteEvent = React27.useCallback((eventId) => {
11971
12559
  setEventsState((prev) => prev.filter((e) => e.id !== eventId));
11972
12560
  onEventDelete?.(eventId);
11973
12561
  }, [onEventDelete]);
11974
- const goToToday = React29.useCallback(() => {
12562
+ const goToToday = React27.useCallback(() => {
11975
12563
  setSelectedDate(/* @__PURE__ */ new Date());
11976
12564
  }, []);
11977
- const goToPrevious = React29.useCallback(() => {
12565
+ const goToPrevious = React27.useCallback(() => {
11978
12566
  setSelectedDate((current) => {
11979
12567
  switch (view) {
11980
12568
  case "day":
@@ -11992,7 +12580,7 @@ function EventCalendarProvider({
11992
12580
  }
11993
12581
  });
11994
12582
  }, [view]);
11995
- const goToNext = React29.useCallback(() => {
12583
+ const goToNext = React27.useCallback(() => {
11996
12584
  setSelectedDate((current) => {
11997
12585
  switch (view) {
11998
12586
  case "day":
@@ -12010,7 +12598,7 @@ function EventCalendarProvider({
12010
12598
  }
12011
12599
  });
12012
12600
  }, [view]);
12013
- const contextValue = React29.useMemo(
12601
+ const contextValue = React27.useMemo(
12014
12602
  () => ({
12015
12603
  // State
12016
12604
  selectedDate,
@@ -12057,7 +12645,7 @@ function EventCalendarProvider({
12057
12645
  return /* @__PURE__ */ jsx(CalendarContext.Provider, { value: contextValue, children });
12058
12646
  }
12059
12647
  function useEventCalendar() {
12060
- const context = React29.useContext(CalendarContext);
12648
+ const context = React27.useContext(CalendarContext);
12061
12649
  if (!context) {
12062
12650
  throw new Error("useEventCalendar must be used within an EventCalendarProvider");
12063
12651
  }
@@ -12065,14 +12653,14 @@ function useEventCalendar() {
12065
12653
  }
12066
12654
  function useFilteredEvents() {
12067
12655
  const { events, selectedUserId } = useEventCalendar();
12068
- return React29.useMemo(() => {
12656
+ return React27.useMemo(() => {
12069
12657
  if (!selectedUserId) return events;
12070
12658
  return events.filter((event) => event.user.id === selectedUserId);
12071
12659
  }, [events, selectedUserId]);
12072
12660
  }
12073
12661
  function useEventsInRange(startDate, endDate) {
12074
12662
  const filteredEvents = useFilteredEvents();
12075
- return React29.useMemo(() => {
12663
+ return React27.useMemo(() => {
12076
12664
  return filteredEvents.filter((event) => {
12077
12665
  const eventStart = new Date(event.startDate);
12078
12666
  const eventEnd = new Date(event.endDate);
@@ -12630,8 +13218,8 @@ function MoreEvents({ count, onClick, className }) {
12630
13218
  );
12631
13219
  }
12632
13220
  function TimeIndicator({ className }) {
12633
- const [now, setNow] = React29.useState(/* @__PURE__ */ new Date());
12634
- React29.useEffect(() => {
13221
+ const [now, setNow] = React27.useState(/* @__PURE__ */ new Date());
13222
+ React27.useEffect(() => {
12635
13223
  const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
12636
13224
  return () => clearInterval(interval);
12637
13225
  }, []);
@@ -12668,24 +13256,24 @@ function DateBadge({ date, className }) {
12668
13256
  }
12669
13257
  );
12670
13258
  }
12671
- var DragContext = React29.createContext(null);
13259
+ var DragContext = React27.createContext(null);
12672
13260
  function DragProvider({
12673
13261
  children,
12674
13262
  snapMinutes = 15,
12675
13263
  onDragStart,
12676
13264
  onDragEnd
12677
13265
  }) {
12678
- const [draggedEvent, setDraggedEventState] = React29.useState(null);
12679
- const [isDragging, setIsDragging] = React29.useState(false);
13266
+ const [draggedEvent, setDraggedEventState] = React27.useState(null);
13267
+ const [isDragging, setIsDragging] = React27.useState(false);
12680
13268
  const { updateEvent } = useEventCalendar();
12681
- const setDraggedEvent = React29.useCallback((event) => {
13269
+ const setDraggedEvent = React27.useCallback((event) => {
12682
13270
  setDraggedEventState(event);
12683
13271
  setIsDragging(!!event);
12684
13272
  if (event) {
12685
13273
  onDragStart?.(event);
12686
13274
  }
12687
13275
  }, [onDragStart]);
12688
- const handleDrop = React29.useCallback((newStartDate) => {
13276
+ const handleDrop = React27.useCallback((newStartDate) => {
12689
13277
  if (!draggedEvent) return;
12690
13278
  const snappedDate = snapToInterval(newStartDate, snapMinutes);
12691
13279
  const { startDate, endDate } = calculateDropDates(draggedEvent, snappedDate);
@@ -12698,7 +13286,7 @@ function DragProvider({
12698
13286
  onDragEnd?.(updatedEvent, new Date(startDate), new Date(endDate));
12699
13287
  setDraggedEvent(null);
12700
13288
  }, [draggedEvent, snapMinutes, updateEvent, onDragEnd, setDraggedEvent]);
12701
- const contextValue = React29.useMemo(
13289
+ const contextValue = React27.useMemo(
12702
13290
  () => ({
12703
13291
  draggedEvent,
12704
13292
  setDraggedEvent,
@@ -12709,7 +13297,7 @@ function DragProvider({
12709
13297
  return /* @__PURE__ */ jsx(DragContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(DragDropHandler, { onDrop: handleDrop, children }) });
12710
13298
  }
12711
13299
  function useDrag() {
12712
- const context = React29.useContext(DragContext);
13300
+ const context = React27.useContext(DragContext);
12713
13301
  if (!context) {
12714
13302
  throw new Error("useDrag must be used within a DragProvider");
12715
13303
  }
@@ -12754,7 +13342,7 @@ function DroppableZone({
12754
13342
  }) {
12755
13343
  const { draggedEvent, setDraggedEvent } = useDrag();
12756
13344
  const { updateEvent } = useEventCalendar();
12757
- const [isOver, setIsOver] = React29.useState(false);
13345
+ const [isOver, setIsOver] = React27.useState(false);
12758
13346
  const handleDragOver = (e) => {
12759
13347
  e.preventDefault();
12760
13348
  e.dataTransfer.dropEffect = "move";
@@ -12792,23 +13380,23 @@ function DroppableZone({
12792
13380
  function useDroppable({ date, hour, minute = 0, onDrop }) {
12793
13381
  const { draggedEvent, setDraggedEvent } = useDrag();
12794
13382
  const { updateEvent } = useEventCalendar();
12795
- const [isOver, setIsOver] = React29.useState(false);
12796
- const dropTargetDate = React29.useMemo(() => {
13383
+ const [isOver, setIsOver] = React27.useState(false);
13384
+ const dropTargetDate = React27.useMemo(() => {
12797
13385
  const targetDate = new Date(date);
12798
13386
  if (hour !== void 0) {
12799
13387
  targetDate.setHours(hour, minute, 0, 0);
12800
13388
  }
12801
13389
  return targetDate;
12802
13390
  }, [date, hour, minute]);
12803
- const handleDragOver = React29.useCallback((e) => {
13391
+ const handleDragOver = React27.useCallback((e) => {
12804
13392
  e.preventDefault();
12805
13393
  e.dataTransfer.dropEffect = "move";
12806
13394
  if (!isOver) setIsOver(true);
12807
13395
  }, [isOver]);
12808
- const handleDragLeave = React29.useCallback(() => {
13396
+ const handleDragLeave = React27.useCallback(() => {
12809
13397
  setIsOver(false);
12810
13398
  }, []);
12811
- const handleDrop = React29.useCallback((e) => {
13399
+ const handleDrop = React27.useCallback((e) => {
12812
13400
  e.preventDefault();
12813
13401
  setIsOver(false);
12814
13402
  if (!draggedEvent) return;
@@ -12835,13 +13423,13 @@ function useDroppable({ date, hour, minute = 0, onDrop }) {
12835
13423
  function useDraggable(event, disabled = false) {
12836
13424
  const { setDraggedEvent, draggedEvent } = useDrag();
12837
13425
  const isDragged = draggedEvent?.id === event.id;
12838
- const handleDragStart = React29.useCallback((e) => {
13426
+ const handleDragStart = React27.useCallback((e) => {
12839
13427
  if (disabled) return;
12840
13428
  e.dataTransfer.effectAllowed = "move";
12841
13429
  e.dataTransfer.setData("text/plain", event.id);
12842
13430
  setDraggedEvent(event);
12843
13431
  }, [disabled, event, setDraggedEvent]);
12844
- const handleDragEnd = React29.useCallback(() => {
13432
+ const handleDragEnd = React27.useCallback(() => {
12845
13433
  setDraggedEvent(null);
12846
13434
  }, [setDraggedEvent]);
12847
13435
  return {
@@ -12882,15 +13470,15 @@ function MonthView({
12882
13470
  }) {
12883
13471
  const { selectedDate, badgeVariant, setSelectedDate, setView } = useEventCalendar();
12884
13472
  const filteredEvents = useFilteredEvents();
12885
- const { singleDayEvents, multiDayEvents } = React29.useMemo(
13473
+ const { singleDayEvents, multiDayEvents } = React27.useMemo(
12886
13474
  () => splitEventsByDuration(filteredEvents),
12887
13475
  [filteredEvents]
12888
13476
  );
12889
- const cells = React29.useMemo(
13477
+ const cells = React27.useMemo(
12890
13478
  () => getCalendarCells(selectedDate),
12891
13479
  [selectedDate]
12892
13480
  );
12893
- const eventPositions = React29.useMemo(
13481
+ const eventPositions = React27.useMemo(
12894
13482
  () => calculateMonthEventPositions(multiDayEvents, singleDayEvents, selectedDate),
12895
13483
  [multiDayEvents, singleDayEvents, selectedDate]
12896
13484
  );
@@ -13072,7 +13660,7 @@ function WeekView({
13072
13660
  visibleHours
13073
13661
  } = useEventCalendar();
13074
13662
  const filteredEvents = useFilteredEvents();
13075
- const { singleDayEvents, multiDayEvents } = React29.useMemo(
13663
+ const { singleDayEvents, multiDayEvents } = React27.useMemo(
13076
13664
  () => splitEventsByDuration(filteredEvents),
13077
13665
  [filteredEvents]
13078
13666
  );
@@ -13278,8 +13866,8 @@ function CalendarTimeline({
13278
13866
  firstVisibleHour,
13279
13867
  lastVisibleHour
13280
13868
  }) {
13281
- const [currentTime, setCurrentTime] = React29.useState(/* @__PURE__ */ new Date());
13282
- React29.useEffect(() => {
13869
+ const [currentTime, setCurrentTime] = React27.useState(/* @__PURE__ */ new Date());
13870
+ React27.useEffect(() => {
13283
13871
  const interval = setInterval(() => {
13284
13872
  setCurrentTime(/* @__PURE__ */ new Date());
13285
13873
  }, 6e4);
@@ -13362,7 +13950,7 @@ function DayView({
13362
13950
  visibleHours
13363
13951
  } = useEventCalendar();
13364
13952
  const filteredEvents = useFilteredEvents();
13365
- const { singleDayEvents, multiDayEvents } = React29.useMemo(
13953
+ const { singleDayEvents, multiDayEvents } = React27.useMemo(
13366
13954
  () => splitEventsByDuration(filteredEvents),
13367
13955
  [filteredEvents]
13368
13956
  );
@@ -13370,7 +13958,7 @@ function DayView({
13370
13958
  visibleHours,
13371
13959
  singleDayEvents
13372
13960
  );
13373
- const currentEvents = React29.useMemo(() => {
13961
+ const currentEvents = React27.useMemo(() => {
13374
13962
  if (!isToday(selectedDate)) return [];
13375
13963
  return getCurrentEvents(singleDayEvents);
13376
13964
  }, [singleDayEvents, selectedDate]);
@@ -13594,8 +14182,8 @@ function CalendarTimeline2({
13594
14182
  firstVisibleHour,
13595
14183
  lastVisibleHour
13596
14184
  }) {
13597
- const [currentTime, setCurrentTime] = React29.useState(/* @__PURE__ */ new Date());
13598
- React29.useEffect(() => {
14185
+ const [currentTime, setCurrentTime] = React27.useState(/* @__PURE__ */ new Date());
14186
+ React27.useEffect(() => {
13599
14187
  const interval = setInterval(() => {
13600
14188
  setCurrentTime(/* @__PURE__ */ new Date());
13601
14189
  }, 6e4);
@@ -13629,7 +14217,7 @@ function YearView({
13629
14217
  }) {
13630
14218
  const { selectedDate, setSelectedDate, setView } = useEventCalendar();
13631
14219
  const filteredEvents = useFilteredEvents();
13632
- const months = React29.useMemo(() => {
14220
+ const months = React27.useMemo(() => {
13633
14221
  const yearStart = startOfYear(selectedDate);
13634
14222
  return Array.from({ length: 12 }, (_, i) => addMonths(yearStart, i));
13635
14223
  }, [selectedDate]);
@@ -13752,11 +14340,11 @@ function AgendaView({
13752
14340
  }) {
13753
14341
  const { selectedDate, setSelectedDate, setView } = useEventCalendar();
13754
14342
  const filteredEvents = useFilteredEvents();
13755
- const { singleDayEvents, multiDayEvents } = React29.useMemo(
14343
+ const { singleDayEvents, multiDayEvents } = React27.useMemo(
13756
14344
  () => splitEventsByDuration(filteredEvents),
13757
14345
  [filteredEvents]
13758
14346
  );
13759
- const eventsByDay = React29.useMemo(() => {
14347
+ const eventsByDay = React27.useMemo(() => {
13760
14348
  const allDates = /* @__PURE__ */ new Map();
13761
14349
  singleDayEvents.forEach((event) => {
13762
14350
  const eventDate = parseISO(event.startDate);
@@ -14221,16 +14809,16 @@ function EventDialog({
14221
14809
  defaultUserId
14222
14810
  }) {
14223
14811
  const { addEvent, updateEvent, deleteEvent, users } = useEventCalendar();
14224
- const [title, setTitle] = React29.useState("");
14225
- const [description, setDescription] = React29.useState("");
14226
- const [startDate, setStartDate] = React29.useState("");
14227
- const [startTime, setStartTime] = React29.useState("");
14228
- const [endDate, setEndDate] = React29.useState("");
14229
- const [endTime, setEndTime] = React29.useState("");
14230
- const [color, setColor] = React29.useState("blue");
14231
- const [userId, setUserId] = React29.useState("");
14232
- const [isSubmitting, setIsSubmitting] = React29.useState(false);
14233
- React29.useEffect(() => {
14812
+ const [title, setTitle] = React27.useState("");
14813
+ const [description, setDescription] = React27.useState("");
14814
+ const [startDate, setStartDate] = React27.useState("");
14815
+ const [startTime, setStartTime] = React27.useState("");
14816
+ const [endDate, setEndDate] = React27.useState("");
14817
+ const [endTime, setEndTime] = React27.useState("");
14818
+ const [color, setColor] = React27.useState("blue");
14819
+ const [userId, setUserId] = React27.useState("");
14820
+ const [isSubmitting, setIsSubmitting] = React27.useState(false);
14821
+ React27.useEffect(() => {
14234
14822
  if (open) {
14235
14823
  if (mode === "edit" && event) {
14236
14824
  const start = parseISO(event.startDate);
@@ -14453,7 +15041,7 @@ function QuickAddEvent({
14453
15041
  onOpenDialog,
14454
15042
  onClose
14455
15043
  }) {
14456
- const [title, setTitle] = React29.useState("");
15044
+ const [title, setTitle] = React27.useState("");
14457
15045
  const { users } = useEventCalendar();
14458
15046
  const handleSubmit = (e) => {
14459
15047
  e.preventDefault();
@@ -14520,8 +15108,8 @@ var HOUR_OPTIONS = Array.from({ length: 25 }, (_, i) => {
14520
15108
  });
14521
15109
  function ChangeVisibleHoursInput() {
14522
15110
  const { visibleHours, setVisibleHours } = useEventCalendar();
14523
- const [from, setFrom] = React29.useState(visibleHours.from);
14524
- const [to, setTo] = React29.useState(visibleHours.to);
15111
+ const [from, setFrom] = React27.useState(visibleHours.from);
15112
+ const [to, setTo] = React27.useState(visibleHours.to);
14525
15113
  const handleApply = () => {
14526
15114
  const toHour = to === 0 ? 24 : to;
14527
15115
  setVisibleHours({ from, to: toHour });
@@ -14567,7 +15155,7 @@ var HOUR_OPTIONS2 = Array.from({ length: 25 }, (_, i) => {
14567
15155
  });
14568
15156
  function ChangeWorkingHoursInput() {
14569
15157
  const { workingHours, setWorkingHours } = useEventCalendar();
14570
- const [localWorkingHours, setLocalWorkingHours] = React29.useState({
15158
+ const [localWorkingHours, setLocalWorkingHours] = React27.useState({
14571
15159
  ...workingHours
14572
15160
  });
14573
15161
  const handleToggleDay = (dayId) => {
@@ -14716,8 +15304,8 @@ function CalendarSettingsButton({
14716
15304
  );
14717
15305
  }
14718
15306
  function useMediaQuery(query) {
14719
- const [matches, setMatches] = React29.useState(false);
14720
- React29.useEffect(() => {
15307
+ const [matches, setMatches] = React27.useState(false);
15308
+ React27.useEffect(() => {
14721
15309
  const media = window.matchMedia(query);
14722
15310
  setMatches(media.matches);
14723
15311
  const listener = (event) => {
@@ -14769,11 +15357,11 @@ function BigCalendarInner({
14769
15357
  maxEventsPerDay
14770
15358
  }) {
14771
15359
  const { view, setView } = useEventCalendar();
14772
- const [dialogOpen, setDialogOpen] = React29.useState(false);
14773
- const [settingsDialogOpen, setSettingsDialogOpen] = React29.useState(false);
14774
- const [selectedEvent, setSelectedEvent] = React29.useState(null);
14775
- const [dialogMode, setDialogMode] = React29.useState("add");
14776
- const [defaultDate, setDefaultDate] = React29.useState(/* @__PURE__ */ new Date());
15360
+ const [dialogOpen, setDialogOpen] = React27.useState(false);
15361
+ const [settingsDialogOpen, setSettingsDialogOpen] = React27.useState(false);
15362
+ const [selectedEvent, setSelectedEvent] = React27.useState(null);
15363
+ const [dialogMode, setDialogMode] = React27.useState("add");
15364
+ const [defaultDate, setDefaultDate] = React27.useState(/* @__PURE__ */ new Date());
14777
15365
  const isMobile = useMediaQuery("(max-width: 768px)");
14778
15366
  const isCompact = compact === "auto" ? isMobile : compact;
14779
15367
  const handleAddClick = () => {
@@ -16496,6 +17084,6 @@ var KanbanProvider = ({
16496
17084
  ) });
16497
17085
  };
16498
17086
 
16499
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgendaView, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, BADGE_VARIANT_LABELS, Badge, BigCalendar, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarContext, CalendarDayButton, CalendarHeader, CalendarHeaderCompact, CalendarSettingsButton, CalendarSettingsContent, CalendarSettingsDialog, CalibrationTable, CalibrationWeekCell, CalibrationWeekHeader, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChangeBadgeVariantInput, ChangeVisibleHoursInput, ChangeWorkingHoursInput, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CircularProgress, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommentButton, CommentDialog, CommentPopover, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DEFAULT_VISIBLE_HOURS, DEFAULT_WORKING_HOURS, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, DateBadge, DayView, DeliveryBadge, DeliveryCard, DeliveryDetailPage, DeliveryIndicator, DeliveryIndicators, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DragContext, DragProvider, DraggableEvent, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DroppableZone, EVENT_COLORS, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventBadge, EventCalendarProvider, EventDialog, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GanttAddFeatureHelper, GanttCollapsibleSidebarGroup, GanttCollapsibleTimelineGroup, GanttColumn, GanttColumns, GanttContentHeader, GanttCreateMarkerTrigger, GanttFeatureDragHelper, GanttFeatureItem, GanttFeatureItemCard, GanttFeatureList, GanttFeatureListGroup, GanttFeatureRow, GanttGridLines, GanttGroupSummaryBar, GanttHeader, GanttMarker, GanttProvider, GanttSidebar, GanttSidebarGroup, GanttSidebarHeader, GanttSidebarItem, GanttTimeline, GanttToday, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Item6 as Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, KanbanBoard, KanbanCard, KanbanCards, KanbanHeader, KanbanProvider, Kbd, KbdGroup, Label2 as Label, Map2 as Map, MapMarker, MapPopup, MapTileLayer, MapTooltip, MapZoomControl, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MonthView, MoreEvents, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavMain, NavProjects, NavSecondary, NavUser, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NetBadge, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PlanningTable, PlanningTableToolbar, PlanningWeekCommentPopover, PlayerCanvas, PlayerCanvasActionButton, PlayerCanvasControls, PlayerCanvasDivider, PlayerCanvasInfo, PlayerCanvasLabel, PlayerCanvasPlayButton, PlayerCanvasProgress, PlayerCanvasSkipButton, PlayerCanvasTitle, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, QuickAddEvent, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RowHeaderCell, ScrollArea, ScrollBar, SearchForm, SearchTrigger, Section, SectionContent, SectionDescription, SectionFooter, SectionHeader, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteHeader, Skeleton, Slider, Spinner, StatusProgress, SubmitCalibrationBar, SupplierCell, SupplierWeeklyLoading, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeSwitch, TimeIndicator, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToolBarCanvas, ToolBarCanvasButton, ToolBarCanvasDivider, ToolBarCanvasGroup, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserAvatarsDropdown, VIEW_LABELS, WeekCell, WeekDetailDialog, WeekDetailSheet, WeekHeader, WeekView, WeeklyLoadingView, YearView, badgeVariants, buttonGroupVariants, buttonVariants, calculateCalibrationCells, calculateDropDates, calculateMonthEventPositions, canSubmitCalibration, cardVariants, createDefaultEvent, deliveryIndicatorVariants, extractPrefixes, formatCalibrationUnit, formatDateRange2 as formatDateRange, formatProductionUnit, formatTime, generateColumns, generateEventId, generateLoadingWeek, generateLocationOptions, generateWeekColumns, generateWeeks, getCalendarCells, getCommentLocationLabel, getCurrentEvents, getDayHours, getDayLabel, getDeliveryVisualState, getElementShipmentStatus, getEventBlockStyle, getEventDuration, getEventDurationMinutes, getEventsCount, getEventsForDate, getEventsInRange, getHeaderLabel, getISOWeek, getLoadingDeliveryStatusLabel, getLoadingElementStatusLabel, getLoadingISOWeek, getLoadingWeekKey, getMonthCellEvents, getMonthDays, getShipmentStatusLabel, getShortDayLabel, getSupplierColumn, getTimeHeight, getTimePosition, getViewDateRange, getVisibleHours, getWeekDayNames, getWeekDays, getWeekKey, getYearMonths, groupDeliveriesByDay, groupDeliveriesByPrefixAndDay, groupEvents, isMultiDayEvent, isWorkingHour, navigateDate, navigationMenuTriggerStyle, playerCanvasPlayButtonVariants, playerCanvasSkipButtonVariants, rangeText, sectionVariants, snapToInterval, sortEvents, splitEventsByDuration, toggleVariants, toolBarCanvasButtonVariants, useDrag, useDraggable, useDroppable, useEventCalendar, useEventsInRange, useFilteredEvents, useFormField, useGanttDragging, useGanttScrollX, useIsMobile, useSearchShortcut, useSidebar };
17087
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgendaView, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, BADGE_VARIANT_LABELS, Badge, BigCalendar, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarContext, CalendarDayButton, CalendarHeader, CalendarHeaderCompact, CalendarSettingsButton, CalendarSettingsContent, CalendarSettingsDialog, CalibrationTable, CalibrationWeekCell, CalibrationWeekHeader, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChangeBadgeVariantInput, ChangeVisibleHoursInput, ChangeWorkingHoursInput, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CircularProgress, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColumnSummaryCell, ColumnSummaryStrip, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommentButton, CommentDialog, CommentPopover, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DEFAULT_VISIBLE_HOURS, DEFAULT_WORKING_HOURS, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, DateBadge, DayView, DeliveryBadge, DeliveryCard, DeliveryDetailPage, DeliveryIndicator, DeliveryIndicators, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DragContext, DragProvider, DraggableEvent, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DroppableZone, EVENT_COLORS, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventBadge, EventCalendarProvider, EventDialog, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GanttAddFeatureHelper, GanttCollapsibleSidebarGroup, GanttCollapsibleTimelineGroup, GanttColumn, GanttColumns, GanttContentHeader, GanttCreateMarkerTrigger, GanttFeatureDragHelper, GanttFeatureItem, GanttFeatureItemCard, GanttFeatureList, GanttFeatureListGroup, GanttFeatureRow, GanttGridLines, GanttGroupSummaryBar, GanttHeader, GanttMarker, GanttProvider, GanttSidebar, GanttSidebarGroup, GanttSidebarHeader, GanttSidebarItem, GanttTimeline, GanttToday, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InsightBar, Item6 as Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, KanbanBoard, KanbanCard, KanbanCards, KanbanHeader, KanbanProvider, Kbd, KbdGroup, Label2 as Label, Map2 as Map, MapMarker, MapPopup, MapTileLayer, MapTooltip, MapZoomControl, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MonthView, MoreEvents, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavMain, NavProjects, NavSecondary, NavUser, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NetBadge, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PlanningTable, PlanningTableToolbar, PlanningWeekCommentPopover, PlayerCanvas, PlayerCanvasActionButton, PlayerCanvasControls, PlayerCanvasDivider, PlayerCanvasInfo, PlayerCanvasLabel, PlayerCanvasPlayButton, PlayerCanvasProgress, PlayerCanvasSkipButton, PlayerCanvasTitle, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, QuickAddEvent, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RowHeaderCell, ScrollArea, ScrollBar, SearchForm, SearchTrigger, Section, SectionContent, SectionDescription, SectionFooter, SectionHeader, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteHeader, Skeleton, Slider, Spinner, StatusProgress, SubmitCalibrationBar, SupplierCell, SupplierWeeklyLoading, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeSwitch, TimeIndicator, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToolBarCanvas, ToolBarCanvasButton, ToolBarCanvasDivider, ToolBarCanvasGroup, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserAvatarsDropdown, VIEW_LABELS, WeekCell, WeekDetailDialog, WeekDetailSheet, WeekHeader, WeekView, WeeklyLoadingView, YearView, badgeVariants, buttonGroupVariants, buttonVariants, calculateCalibrationCells, calculateDropDates, calculateMonthEventPositions, canSubmitCalibration, cardVariants, createDefaultEvent, deliveryIndicatorVariants, extractPrefixes, formatCalibrationUnit, formatDateRange2 as formatDateRange, formatProductionUnit, formatTime, generateColumns, generateEventId, generateLoadingWeek, generateLocationOptions, generateWeekColumns, generateWeeks, getCalendarCells, getCommentLocationLabel, getCurrentEvents, getDayHours, getDayLabel, getDeliveryVisualState, getElementShipmentStatus, getEventBlockStyle, getEventDuration, getEventDurationMinutes, getEventsCount, getEventsForDate, getEventsInRange, getHeaderLabel, getISOWeek, getLoadingDeliveryStatusLabel, getLoadingElementStatusLabel, getLoadingISOWeek, getLoadingWeekKey, getMonthCellEvents, getMonthDays, getShipmentStatusLabel, getShortDayLabel, getSupplierColumn, getTimeHeight, getTimePosition, getViewDateRange, getVisibleHours, getWeekDayNames, getWeekDays, getWeekKey, getYearMonths, groupDeliveriesByDay, groupDeliveriesByPrefixAndDay, groupEvents, isMultiDayEvent, isWorkingHour, navigateDate, navigationMenuTriggerStyle, playerCanvasPlayButtonVariants, playerCanvasSkipButtonVariants, rangeText, sectionVariants, snapToInterval, sortEvents, splitEventsByDuration, toggleVariants, toolBarCanvasButtonVariants, useDrag, useDraggable, useDroppable, useEventCalendar, useEventsInRange, useFilteredEvents, useFormField, useGanttDragging, useGanttScrollX, useIsMobile, useSearchShortcut, useSidebar };
16500
17088
  //# sourceMappingURL=index.js.map
16501
17089
  //# sourceMappingURL=index.js.map