@orangecheck/app-design 1.5.0 → 1.6.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.
@@ -4,19 +4,22 @@ import { extendTailwindMerge } from 'tailwind-merge';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { cva } from 'class-variance-authority';
6
6
  import * as TabsPrimitive from '@radix-ui/react-tabs';
7
- import { ChevronDown, Check, Search, Copy, Lock, ArrowUpRight, ArrowRight, ChevronRight, CornerDownLeft, Download, FileText, Upload, ArrowLeft, CircleDashed, CircleMinus, CircleSlash, Clock, CircleX, CircleCheck } from 'lucide-react';
7
+ import { X, ChevronDown, Check, Search, Copy, Lock, Info, ArrowUpRight, ArrowRight, ChevronRight, CornerDownLeft, Download, FileText, Upload, ArrowLeft, Maximize2, CircleDashed, CircleMinus, CircleSlash, Clock, CircleX, CircleCheck } from 'lucide-react';
8
8
  import { Slot } from '@radix-ui/react-slot';
9
9
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
10
10
  import 'next-themes';
11
11
  import 'sonner';
12
12
  import Link from 'next/link';
13
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
14
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
15
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
16
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
13
17
  import { useRouter } from 'next/compat/router';
14
18
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
15
19
  import * as LabelPrimitive from '@radix-ui/react-label';
16
20
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
17
21
  import * as SelectPrimitive from '@radix-ui/react-select';
18
22
  import * as SwitchPrimitive from '@radix-ui/react-switch';
19
- import * as DialogPrimitive from '@radix-ui/react-dialog';
20
23
 
21
24
  var merge = extendTailwindMerge({
22
25
  extend: {
@@ -532,7 +535,7 @@ var JS_TAG = /<\/?(?=[A-Za-z])/y;
532
535
  var JS_TAG_NAME = /[A-Za-z][\w$.:-]*/y;
533
536
  var JS_PUNCT = /=>|\.\.\.|[{}()[\];,.<>=+\-*/%!?:&|^~#]/y;
534
537
  var JSX_BEFORE = /* @__PURE__ */ new Set(["(", ",", "=", "?", ":", "{", "[", ";", ">", "&&", "||", "=>", "return"]);
535
- function scanJs(src, emit, jsx36) {
538
+ function scanJs(src, emit, jsx38) {
536
539
  let i = 0;
537
540
  let prev = "";
538
541
  let tagDepth = 0;
@@ -558,7 +561,7 @@ function scanJs(src, emit, jsx36) {
558
561
  sig('"');
559
562
  continue;
560
563
  }
561
- if (jsx36 && tagDepth === 0 && (m = at(JS_TAG, src, i)) && (prev === "" || JSX_BEFORE.has(prev))) {
564
+ if (jsx38 && tagDepth === 0 && (m = at(JS_TAG, src, i)) && (prev === "" || JSX_BEFORE.has(prev))) {
562
565
  const name = at(JS_TAG_NAME, src, i + m.length);
563
566
  if (name) {
564
567
  emit(m);
@@ -570,7 +573,7 @@ function scanJs(src, emit, jsx36) {
570
573
  continue;
571
574
  }
572
575
  }
573
- if (jsx36 && tagDepth > 0 && braceInTag === 0) {
576
+ if (jsx38 && tagDepth > 0 && braceInTag === 0) {
574
577
  if (src.startsWith("/>", i) || src[i] === ">") {
575
578
  const close = src[i] === ">" ? ">" : "/>";
576
579
  emit(close);
@@ -590,7 +593,7 @@ function scanJs(src, emit, jsx36) {
590
593
  continue;
591
594
  }
592
595
  if (src[i] === "{") braceInTag = 1;
593
- } else if (jsx36 && tagDepth > 0 && braceInTag > 0) {
596
+ } else if (jsx38 && tagDepth > 0 && braceInTag > 0) {
594
597
  if (src[i] === "{") braceInTag++;
595
598
  else if (src[i] === "}") braceInTag--;
596
599
  }
@@ -1175,7 +1178,22 @@ function PageHeader({
1175
1178
  ] });
1176
1179
  }
1177
1180
  var InStatGrid = createContext(false);
1178
- function StatCard({ label, value, hint, size, className }) {
1181
+ function Delta({ value, suffix = "", good = "up", label }) {
1182
+ const dir = value > 0 ? "up" : value < 0 ? "down" : "flat";
1183
+ const tone = dir === "flat" ? "text-muted-foreground" : dir === good ? "text-success" : "text-destructive";
1184
+ const sign = value > 0 ? "+" : value < 0 ? "\u2212" : "";
1185
+ return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-baseline gap-1 text-[0.8125rem] font-normal tracking-normal oca-tabular", tone), children: [
1186
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: dir === "up" ? "\u2191" : dir === "down" ? "\u2193" : "\xB7" }),
1187
+ sign,
1188
+ Math.abs(value).toLocaleString("en-US", { maximumFractionDigits: 2 }),
1189
+ suffix,
1190
+ label ? /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
1191
+ " ",
1192
+ label
1193
+ ] }) : null
1194
+ ] });
1195
+ }
1196
+ function StatCard({ label, value, hint, size, delta, className }) {
1179
1197
  const inGrid = useContext(InStatGrid);
1180
1198
  const density = useDensity();
1181
1199
  const sm = (size ?? (density === "compact" ? "sm" : "md")) === "sm";
@@ -1193,15 +1211,19 @@ function StatCard({ label, value, hint, size, className }) {
1193
1211
  ),
1194
1212
  children: [
1195
1213
  /* @__PURE__ */ jsx("span", { className: cn("leading-snug text-muted-foreground", sm ? "text-[0.8125rem]" : "text-[0.875rem]"), children: label }),
1196
- /* @__PURE__ */ jsx(
1214
+ /* @__PURE__ */ jsxs(
1197
1215
  "span",
1198
1216
  {
1199
1217
  className: cn(
1200
1218
  "break-words oca-tabular leading-tight tracking-[-0.02em]",
1201
1219
  sm ? "text-[1.25rem]" : "text-[1.5rem] md:text-[1.75rem]",
1202
- inGrid && "self-end"
1220
+ inGrid && "self-end",
1221
+ delta && "flex flex-wrap items-baseline gap-x-2"
1203
1222
  ),
1204
- children: value
1223
+ children: [
1224
+ value,
1225
+ delta ? /* @__PURE__ */ jsx(Delta, { ...delta }) : null
1226
+ ]
1205
1227
  }
1206
1228
  ),
1207
1229
  hint ? /* @__PURE__ */ jsx("span", { className: "text-[0.8125rem] leading-snug text-muted-foreground", children: hint }) : inGrid ? /* @__PURE__ */ jsx("span", { "aria-hidden": true }) : null
@@ -1290,6 +1312,13 @@ function StatGrid({ columns, empty, isEmpty, className, children, ...props }) {
1290
1312
  }
1291
1313
  ) });
1292
1314
  }
1315
+ var TONE_TEXT = {
1316
+ good: "text-success",
1317
+ caution: "text-warning",
1318
+ bad: "text-destructive",
1319
+ brand: "text-oca-accent-ink",
1320
+ muted: "text-muted-foreground"
1321
+ };
1293
1322
  function KeyValueList({
1294
1323
  items,
1295
1324
  dense,
@@ -1308,15 +1337,19 @@ function KeyValueList({
1308
1337
  ),
1309
1338
  children: [
1310
1339
  /* @__PURE__ */ jsx("dt", { className: cn("shrink-0 text-muted-foreground", tight ? "text-[0.8125rem] @md:w-36" : "text-[0.875rem] @md:w-48"), children: it.label }),
1311
- /* @__PURE__ */ jsx(
1340
+ /* @__PURE__ */ jsxs(
1312
1341
  "dd",
1313
1342
  {
1314
1343
  className: cn(
1315
1344
  "min-w-0 break-words",
1316
1345
  tight ? "text-[0.875rem]" : "text-[0.9375rem]",
1317
- it.mono && (tight ? "font-mono text-[0.8125rem]" : "font-mono text-[0.875rem]")
1346
+ it.mono && (tight ? "font-mono text-[0.8125rem]" : "font-mono text-[0.875rem]"),
1347
+ it.tone && !it.note && TONE_TEXT[it.tone]
1318
1348
  ),
1319
- children: it.value
1349
+ children: [
1350
+ it.value,
1351
+ it.note ? /* @__PURE__ */ jsx("span", { className: cn("ml-2 font-sans text-[0.8125rem]", TONE_TEXT[it.tone ?? "muted"]), children: it.note }) : null
1352
+ ]
1320
1353
  }
1321
1354
  )
1322
1355
  ]
@@ -2599,6 +2632,335 @@ function LockedPreview({
2599
2632
  ] })
2600
2633
  ] });
2601
2634
  }
2635
+ var Dialog = DialogPrimitive.Root;
2636
+ var overlayClass = "oca-animate-fade fixed inset-0 z-50 bg-[rgb(10_10_10/0.38)] backdrop-blur-[2px] data-[state=closed]:opacity-0";
2637
+ var DialogContent = forwardRef(function DialogContent2({ className, children, hideClose, ...props }, ref) {
2638
+ return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
2639
+ /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: overlayClass }),
2640
+ /* @__PURE__ */ jsxs(
2641
+ DialogPrimitive.Content,
2642
+ {
2643
+ ref,
2644
+ className: cn(
2645
+ "oca-animate-rise fixed left-1/2 top-1/2 z-50 w-[min(92vw,34rem)] -translate-x-1/2 -translate-y-1/2",
2646
+ "max-h-[88vh] overflow-y-auto rounded-[1.5rem] border border-border bg-popover p-6 text-popover-foreground shadow-xl md:p-8",
2647
+ "outline-none",
2648
+ className
2649
+ ),
2650
+ ...props,
2651
+ children: [
2652
+ children,
2653
+ hideClose ? null : /* @__PURE__ */ jsx(
2654
+ DialogPrimitive.Close,
2655
+ {
2656
+ className: "absolute right-4 top-4 inline-flex size-9 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
2657
+ "aria-label": "Close",
2658
+ children: /* @__PURE__ */ jsx(X, { className: "size-4" })
2659
+ }
2660
+ )
2661
+ ]
2662
+ }
2663
+ )
2664
+ ] });
2665
+ });
2666
+ var DialogTitle = forwardRef(function DialogTitle2({ className, ...props }, ref) {
2667
+ return /* @__PURE__ */ jsx(
2668
+ DialogPrimitive.Title,
2669
+ {
2670
+ ref,
2671
+ className: cn("text-[1.5rem] font-normal leading-tight tracking-[-0.02em]", className),
2672
+ ...props
2673
+ }
2674
+ );
2675
+ });
2676
+ var DialogDescription = forwardRef(function DialogDescription2({ className, ...props }, ref) {
2677
+ return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ref, className: cn("oca-body", className), ...props });
2678
+ });
2679
+ var sheetSide = {
2680
+ right: "inset-y-0 right-0 h-full w-[min(88vw,24rem)] border-l",
2681
+ left: "inset-y-0 left-0 h-full w-[min(88vw,24rem)] border-r",
2682
+ bottom: "inset-x-0 bottom-0 max-h-[88vh] rounded-t-[1.5rem] border-t"
2683
+ };
2684
+ forwardRef(function SheetContent2({ className, children, side = "right", ...props }, ref) {
2685
+ return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
2686
+ /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: overlayClass }),
2687
+ /* @__PURE__ */ jsxs(
2688
+ DialogPrimitive.Content,
2689
+ {
2690
+ ref,
2691
+ className: cn(
2692
+ "oca-animate-fade fixed z-50 flex flex-col gap-4 overflow-y-auto border-border bg-popover p-6 text-popover-foreground shadow-xl outline-none",
2693
+ sheetSide[side],
2694
+ className
2695
+ ),
2696
+ ...props,
2697
+ children: [
2698
+ children,
2699
+ /* @__PURE__ */ jsx(
2700
+ DialogPrimitive.Close,
2701
+ {
2702
+ className: "absolute right-4 top-4 inline-flex size-9 items-center justify-center rounded-full text-muted-foreground hover:bg-accent hover:text-foreground",
2703
+ "aria-label": "Close",
2704
+ children: /* @__PURE__ */ jsx(X, { className: "size-4" })
2705
+ }
2706
+ )
2707
+ ]
2708
+ }
2709
+ )
2710
+ ] });
2711
+ });
2712
+ var Popover = PopoverPrimitive.Root;
2713
+ var PopoverTrigger = PopoverPrimitive.Trigger;
2714
+ var PopoverContent = forwardRef(function PopoverContent2({ className, align = "center", sideOffset = 8, ...props }, ref) {
2715
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
2716
+ PopoverPrimitive.Content,
2717
+ {
2718
+ ref,
2719
+ align,
2720
+ sideOffset,
2721
+ className: cn(
2722
+ "oca-animate-fade z-50 w-72 rounded-2xl border border-border bg-popover p-4 text-popover-foreground shadow-lg outline-none",
2723
+ className
2724
+ ),
2725
+ ...props
2726
+ }
2727
+ ) });
2728
+ });
2729
+ forwardRef(function TooltipContent2({ className, sideOffset = 6, ...props }, ref) {
2730
+ return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
2731
+ TooltipPrimitive.Content,
2732
+ {
2733
+ ref,
2734
+ sideOffset,
2735
+ className: cn(
2736
+ "oca-animate-fade z-50 max-w-xs rounded-lg bg-oca-ink px-2.5 py-1.5 text-[0.8125rem] leading-snug text-oca-ink-foreground",
2737
+ className
2738
+ ),
2739
+ ...props
2740
+ }
2741
+ ) });
2742
+ });
2743
+ forwardRef(function DropdownMenuContent2({ className, sideOffset = 8, ...props }, ref) {
2744
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
2745
+ DropdownMenuPrimitive.Content,
2746
+ {
2747
+ ref,
2748
+ sideOffset,
2749
+ className: cn(
2750
+ "oca-animate-fade z-50 min-w-56 overflow-hidden rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-lg",
2751
+ className
2752
+ ),
2753
+ ...props
2754
+ }
2755
+ ) });
2756
+ });
2757
+ forwardRef(function DropdownMenuItem2({ className, destructive, ...props }, ref) {
2758
+ return /* @__PURE__ */ jsx(
2759
+ DropdownMenuPrimitive.Item,
2760
+ {
2761
+ ref,
2762
+ className: cn(
2763
+ "flex h-10 cursor-default select-none items-center gap-2.5 rounded-xl px-3 text-[0.9375rem] outline-none",
2764
+ "data-[highlighted]:bg-accent data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:text-muted-foreground",
2765
+ destructive && "text-destructive [&_svg]:text-destructive",
2766
+ className
2767
+ ),
2768
+ ...props
2769
+ }
2770
+ );
2771
+ });
2772
+ forwardRef(function DropdownMenuLabel2({ className, ...props }, ref) {
2773
+ return /* @__PURE__ */ jsx(
2774
+ DropdownMenuPrimitive.Label,
2775
+ {
2776
+ ref,
2777
+ className: cn("px-3 pb-1.5 pt-2 text-[0.8125rem] text-muted-foreground", className),
2778
+ ...props
2779
+ }
2780
+ );
2781
+ });
2782
+ forwardRef(function DropdownMenuSeparator2({ className, ...props }, ref) {
2783
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, { ref, className: cn("my-1.5 h-px bg-border", className), ...props });
2784
+ });
2785
+ function chartColor(series) {
2786
+ if (typeof series === "string") return `var(--oca-chart-${series})`;
2787
+ const n = series >= 1 && series <= 4 && Number.isInteger(series) ? series : (series % 4 + 4) % 4 + 1;
2788
+ return `var(--oca-chart-${n})`;
2789
+ }
2790
+ function ChartFrame({
2791
+ legend,
2792
+ caption,
2793
+ children,
2794
+ className
2795
+ }) {
2796
+ return /* @__PURE__ */ jsxs("figure", { className: cn("oca-chart flex min-w-0 flex-col gap-3", className), children: [
2797
+ legend && legend.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "oca-chart-legend", "aria-label": "Legend", children: legend.map((l, i) => {
2798
+ const c = typeof l.color === "number" || ["neutral", "up", "down"].includes(String(l.color)) ? chartColor(l.color) : String(l.color);
2799
+ return /* @__PURE__ */ jsxs("li", { children: [
2800
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, "data-swatch": l.dashed ? "dashed" : "", style: { "--swatch": c } }),
2801
+ l.label
2802
+ ] }, i);
2803
+ }) }) : null,
2804
+ /* @__PURE__ */ jsx("div", { className: "relative min-w-0", children }),
2805
+ caption ? /* @__PURE__ */ jsx("figcaption", { className: "text-[0.8125rem] leading-snug text-muted-foreground", children: caption }) : null
2806
+ ] });
2807
+ }
2808
+ function Sparkline({
2809
+ values,
2810
+ label,
2811
+ tone = "ink",
2812
+ area = false,
2813
+ width = 96,
2814
+ height = 24,
2815
+ className
2816
+ }) {
2817
+ const gradient = useId().replace(/[^a-zA-Z0-9]/g, "");
2818
+ const pts = values.filter((v) => Number.isFinite(v));
2819
+ const lo = Math.min(...pts);
2820
+ const hi = Math.max(...pts);
2821
+ const span = hi - lo || 1;
2822
+ const pad3 = 1.5;
2823
+ const x = (i) => pts.length < 2 ? width / 2 : i / (pts.length - 1) * width;
2824
+ const y = (v) => pad3 + (1 - (v - lo) / span) * (height - pad3 * 2);
2825
+ const line = pts.map((v, i) => `${i === 0 ? "M" : "L"}${x(i).toFixed(2)},${y(v).toFixed(2)}`).join(" ");
2826
+ const color = tone === "ink" ? "var(--foreground)" : tone === "muted" ? "var(--muted-foreground)" : tone === "trend" ? chartColor(pts.length > 1 && pts[pts.length - 1] < pts[0] ? "down" : "up") : chartColor(tone);
2827
+ return /* @__PURE__ */ jsx(
2828
+ "svg",
2829
+ {
2830
+ role: "img",
2831
+ "aria-label": label,
2832
+ viewBox: `0 0 ${width} ${height}`,
2833
+ preserveAspectRatio: "none",
2834
+ width,
2835
+ height,
2836
+ className: cn("block overflow-visible", className),
2837
+ style: { color },
2838
+ children: pts.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
2839
+ area ? /* @__PURE__ */ jsxs(Fragment, { children: [
2840
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradient, x1: "0", y1: "0", x2: "0", y2: "1", children: [
2841
+ /* @__PURE__ */ jsx("stop", { offset: "0", stopColor: "currentColor", stopOpacity: 0.22 }),
2842
+ /* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "currentColor", stopOpacity: 0 })
2843
+ ] }) }),
2844
+ /* @__PURE__ */ jsx("path", { d: `${line} L${x(pts.length - 1).toFixed(2)},${height} L${x(0).toFixed(2)},${height} Z`, fill: `url(#${gradient})` })
2845
+ ] }) : null,
2846
+ /* @__PURE__ */ jsx("path", { d: line, fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinejoin: "round", strokeLinecap: "round", vectorEffect: "non-scaling-stroke" })
2847
+ ] }) : null
2848
+ }
2849
+ );
2850
+ }
2851
+ function SourceNote({ source, href, detail, updated, variant = "popover", className }) {
2852
+ const name = href ? /* @__PURE__ */ jsxs("a", { href, className: "text-foreground underline decoration-foreground/35 underline-offset-4 hover:decoration-foreground", rel: "noreferrer", target: "_blank", children: [
2853
+ source,
2854
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: " (opens in a new tab)" })
2855
+ ] }) : /* @__PURE__ */ jsx("span", { className: "text-foreground", children: source });
2856
+ if (variant === "line") {
2857
+ return /* @__PURE__ */ jsxs("p", { className: cn("text-[0.75rem] leading-snug text-muted-foreground", className), children: [
2858
+ "Source: ",
2859
+ name,
2860
+ updated ? /* @__PURE__ */ jsxs(Fragment, { children: [
2861
+ " \xB7 ",
2862
+ updated
2863
+ ] }) : null
2864
+ ] });
2865
+ }
2866
+ return /* @__PURE__ */ jsxs(Popover, { children: [
2867
+ /* @__PURE__ */ jsxs(
2868
+ PopoverTrigger,
2869
+ {
2870
+ className: cn(
2871
+ "inline-flex h-7 items-center gap-1 rounded-full px-2 text-[0.75rem] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
2872
+ className
2873
+ ),
2874
+ children: [
2875
+ /* @__PURE__ */ jsx(Info, { "aria-hidden": true, className: "size-3.5" }),
2876
+ "Source"
2877
+ ]
2878
+ }
2879
+ ),
2880
+ /* @__PURE__ */ jsxs(PopoverContent, { align: "start", className: "flex w-[min(calc(100vw-2rem),20rem)] flex-col gap-2 p-4 text-[0.875rem]", children: [
2881
+ /* @__PURE__ */ jsx("p", { className: "text-[0.75rem] text-muted-foreground", children: "Where this number comes from" }),
2882
+ /* @__PURE__ */ jsx("p", { className: "font-medium", children: name }),
2883
+ detail ? /* @__PURE__ */ jsx("div", { className: "text-[0.8125rem] leading-snug text-muted-foreground [&_code]:font-mono", children: detail }) : null,
2884
+ updated ? /* @__PURE__ */ jsx("p", { className: "text-[0.8125rem] text-muted-foreground", children: updated }) : null
2885
+ ] })
2886
+ ] });
2887
+ }
2888
+ function Panel({
2889
+ title,
2890
+ description,
2891
+ actions,
2892
+ source,
2893
+ expandable = false,
2894
+ children,
2895
+ className
2896
+ }) {
2897
+ const [open, setOpen] = useState(false);
2898
+ const body = (expanded) => typeof children === "function" ? children(expanded) : children;
2899
+ const head = (expanded) => /* @__PURE__ */ jsxs("header", { className: "flex flex-wrap items-start justify-between gap-x-4 gap-y-2", children: [
2900
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
2901
+ expanded ? /* @__PURE__ */ jsx(DialogTitle, { className: "text-[1.0625rem] font-medium leading-snug", children: title }) : /* @__PURE__ */ jsx("h3", { className: "text-[1rem] font-medium leading-snug", children: title }),
2902
+ description ? expanded ? /* @__PURE__ */ jsx(DialogDescription, { className: "text-[0.875rem] leading-snug text-muted-foreground", children: description }) : /* @__PURE__ */ jsx("p", { className: "text-[0.875rem] leading-snug text-muted-foreground", children: description }) : null
2903
+ ] }),
2904
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
2905
+ actions,
2906
+ expandable && !expanded ? /* @__PURE__ */ jsx(
2907
+ "button",
2908
+ {
2909
+ type: "button",
2910
+ onClick: () => setOpen(true),
2911
+ "aria-label": "Open full screen",
2912
+ className: "inline-flex size-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
2913
+ children: /* @__PURE__ */ jsx(Maximize2, { "aria-hidden": true, className: "size-4" })
2914
+ }
2915
+ ) : null
2916
+ ] })
2917
+ ] });
2918
+ return /* @__PURE__ */ jsxs("section", { className: cn("flex min-w-0 flex-col gap-4 rounded-[1.25rem] border border-border bg-card p-5 md:p-6", className), children: [
2919
+ head(false),
2920
+ /* @__PURE__ */ jsx("div", { className: "min-w-0", children: body(false) }),
2921
+ source ? /* @__PURE__ */ jsx("div", { className: "-mb-1 border-t border-border pt-3", children: source }) : null,
2922
+ expandable ? /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs(
2923
+ DialogContent,
2924
+ {
2925
+ ...description ? {} : { "aria-describedby": void 0 },
2926
+ className: "flex h-[min(92dvh,56rem)] w-[min(96vw,80rem)] max-w-none flex-col gap-4 overflow-y-auto",
2927
+ children: [
2928
+ head(true),
2929
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 min-w-0 flex-1", children: open ? body(true) : null }),
2930
+ source ? /* @__PURE__ */ jsx("div", { className: "border-t border-border pt-3", children: source }) : null
2931
+ ]
2932
+ }
2933
+ ) }) : null
2934
+ ] });
2935
+ }
2936
+ function HudCard({
2937
+ eyebrow,
2938
+ live = false,
2939
+ title,
2940
+ children,
2941
+ footer,
2942
+ className
2943
+ }) {
2944
+ return /* @__PURE__ */ jsxs(
2945
+ "div",
2946
+ {
2947
+ "data-oca-hud": "",
2948
+ className: cn(
2949
+ "flex w-60 max-w-[calc(100vw-2rem)] flex-col gap-2 rounded-xl border border-border bg-background/85 p-3 text-[0.8125rem] shadow-sm backdrop-blur-md",
2950
+ className
2951
+ ),
2952
+ children: [
2953
+ eyebrow ? /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-1.5 text-[0.75rem] text-muted-foreground", children: [
2954
+ live ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "size-1.5 rounded-full bg-oca-orange-deep motion-safe:animate-pulse" }) : null,
2955
+ eyebrow
2956
+ ] }) : null,
2957
+ title ? /* @__PURE__ */ jsx("p", { className: "text-[1.125rem] font-medium leading-tight oca-tabular", children: title }) : null,
2958
+ children,
2959
+ footer ? /* @__PURE__ */ jsx("div", { className: "border-t border-border pt-2", children: footer }) : null
2960
+ ]
2961
+ }
2962
+ );
2963
+ }
2602
2964
  function IsoCheck({ size = 360, settle = false, shadow = true, tilt = false, title, className }) {
2603
2965
  const ref = useRef(null);
2604
2966
  useEffect(() => {
@@ -3087,7 +3449,7 @@ var Textarea = forwardRef(
3087
3449
  );
3088
3450
  }
3089
3451
  );
3090
- var Label = forwardRef(function Label2({ className, ...props }, ref) {
3452
+ var Label2 = forwardRef(function Label3({ className, ...props }, ref) {
3091
3453
  return /* @__PURE__ */ jsx(
3092
3454
  LabelPrimitive.Root,
3093
3455
  {
@@ -3110,7 +3472,7 @@ function Field({ label, hint, optional, error, children, id: fixedId, className,
3110
3472
  const control = typeof children === "function" ? children(wiring) : isValidElement(children) ? cloneElement(children, { ...wiring }) : children;
3111
3473
  const hintNode = hint ? /* @__PURE__ */ jsx("p", { id: hintId, className: "text-[0.8125rem] leading-snug text-muted-foreground", children: hint }) : null;
3112
3474
  return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
3113
- /* @__PURE__ */ jsxs(Label, { htmlFor: id, className: hideLabel ? "sr-only" : "flex items-baseline gap-2", children: [
3475
+ /* @__PURE__ */ jsxs(Label2, { htmlFor: id, className: hideLabel ? "sr-only" : "flex items-baseline gap-2", children: [
3114
3476
  label,
3115
3477
  optional ? /* @__PURE__ */ jsx("span", { className: "text-[0.8125rem] font-normal text-muted-foreground", children: "Optional" }) : null
3116
3478
  ] }),
@@ -4858,6 +5220,6 @@ function ToolGrid({
4858
5220
  );
4859
5221
  }
4860
5222
 
4861
- export { Accent, ActivityList, AnchorStatus, ApiTable, AppCard, AppGrid, ArtifactView, BlockCountdown, BlockHeight, Breadcrumbs, BrowserFrame, Callout, CardGrid, Closing, CodeBlock, CodeTabs, CommandDialog, ComparisonTable, Container, CopyButton, CountdownRing, DataTable, Diagram, Display, DocHeader, DocLayout, DocsHeading, DocsPager, DropZone, EmptyLine, EmptyState, EndpointList, ErrorBoundary, ErrorPage, Eyebrow, FactBlock, FactRows, Faq, FilterChips, FloatChip, Footnote, FormSection, HashChip, InstallTabs, KeyValueList, Lead, LegalDocument, LinkCard, LoadingBlock, LockedPreview, MdxTable, Meter, Monogram, Notice, OnThisPage, PackageCard, PageHeader, PageHero, PhoneFrame, PlanCard, ProgressSteps, ProofStrip, Prose, ProtocolGrid, ProtocolHero, ProtocolNav, Reveal, Sats, SatsFigure, ScrollStory, SearchButton, SearchDialog, Section, SectionHeading, SectionIntro, SignMessage, SpecCard, SplitBar, StatCard, StatGrid, StateBadge, Step, StepGrid, Steps, TextLink, Ticker, ToolGrid, TruthTable, UsdApprox, VerifyBox, VerifyReport, createStateBadge, languageName, monogramGround, monogramLetter, satsText, sectionVariants, useActiveHeading, useCopy, useHeadings, useInView };
5223
+ export { Accent, ActivityList, AnchorStatus, ApiTable, AppCard, AppGrid, ArtifactView, BlockCountdown, BlockHeight, Breadcrumbs, BrowserFrame, Callout, CardGrid, ChartFrame, Closing, CodeBlock, CodeTabs, CommandDialog, ComparisonTable, Container, CopyButton, CountdownRing, DataTable, Diagram, Display, DocHeader, DocLayout, DocsHeading, DocsPager, DropZone, EmptyLine, EmptyState, EndpointList, ErrorBoundary, ErrorPage, Eyebrow, FactBlock, FactRows, Faq, FilterChips, FloatChip, Footnote, FormSection, HashChip, HudCard, InstallTabs, KeyValueList, Lead, LegalDocument, LinkCard, LoadingBlock, LockedPreview, MdxTable, Meter, Monogram, Notice, OnThisPage, PackageCard, PageHeader, PageHero, Panel, PhoneFrame, PlanCard, ProgressSteps, ProofStrip, Prose, ProtocolGrid, ProtocolHero, ProtocolNav, Reveal, Sats, SatsFigure, ScrollStory, SearchButton, SearchDialog, Section, SectionHeading, SectionIntro, SignMessage, SourceNote, Sparkline, SpecCard, SplitBar, StatCard, StatGrid, StateBadge, Step, StepGrid, Steps, TextLink, Ticker, ToolGrid, TruthTable, UsdApprox, VerifyBox, VerifyReport, chartColor, createStateBadge, languageName, monogramGround, monogramLetter, satsText, sectionVariants, useActiveHeading, useCopy, useHeadings, useInView };
4862
5224
  //# sourceMappingURL=components.mjs.map
4863
5225
  //# sourceMappingURL=components.mjs.map