@orangecheck/design 0.19.0 → 0.20.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.
@@ -1,14 +1,27 @@
1
1
  import * as Popover from '@radix-ui/react-popover';
2
- import { HelpCircle, Boxes, ChevronDown, Check, CornerDownLeft, Plus, Loader2, Copy, X, Menu, Sun, Moon, Monitor } from 'lucide-react';
2
+ import { ChevronDown, Plus, HelpCircle, X, Check, Boxes, CornerDownLeft, Loader2, Copy, Menu, Sun, Moon, Monitor } from 'lucide-react';
3
3
  import { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
- import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
5
+ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
6
6
  import Link6 from 'next/link';
7
- import * as React from 'react';
7
+ import * as React2 from 'react';
8
8
  import { createContext, Fragment, useState, useRef, useEffect, useId, useContext } from 'react';
9
+ import { Slot } from '@radix-ui/react-slot';
10
+ import { cva } from 'class-variance-authority';
11
+ import '@radix-ui/react-label';
12
+ import '@radix-ui/react-checkbox';
13
+ import '@radix-ui/react-radio-group';
14
+ import '@radix-ui/react-switch';
15
+ import { useTheme } from 'next-themes';
16
+ import '@radix-ui/react-separator';
17
+ import '@radix-ui/react-dialog';
18
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
19
+ import '@radix-ui/react-select';
20
+ import 'sonner';
21
+ import '@radix-ui/react-tabs';
22
+ import 'qrcode';
9
23
  import { useRouter } from 'next/router';
10
24
  import { useOcSession, fetchOcLinkedIdentities } from '@orangecheck/auth-client';
11
- import { useTheme } from 'next-themes';
12
25
 
13
26
  // src/composites/help-hint.tsx
14
27
  function cn(...inputs) {
@@ -165,7 +178,7 @@ function StatTile({ children, ...item }) {
165
178
  function StatBlock({ label, value, sub, delta, tone = "default", className }) {
166
179
  const toneClass = tone === "success" ? "text-success" : tone === "warning" ? "text-warning" : tone === "destructive" ? "text-destructive" : "text-foreground";
167
180
  return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
168
- /* @__PURE__ */ jsx("span", { className: "label-mono text-[10px]", children: label }),
181
+ /* @__PURE__ */ jsx("span", { className: "label-mono text-muted-foreground text-[10px]", children: label }),
169
182
  /* @__PURE__ */ jsx(
170
183
  "span",
171
184
  {
@@ -263,6 +276,749 @@ function DataRow({ children, meta, action, as, className }) {
263
276
  }
264
277
  );
265
278
  }
279
+ function TwoToneHeading({
280
+ lead,
281
+ muted,
282
+ as,
283
+ tone = "default",
284
+ className
285
+ }) {
286
+ const Tag = as ?? "h2";
287
+ const leadColor = tone === "onBrand" ? "text-primary-foreground" : "text-foreground";
288
+ const mutedColor = tone === "onBrand" ? "text-primary-foreground/60" : "text-foreground/40";
289
+ return /* @__PURE__ */ jsxs(
290
+ Tag,
291
+ {
292
+ className: cn(
293
+ "font-extrabold tracking-[-0.02em] leading-[1.0] text-balance",
294
+ "text-3xl sm:text-4xl md:text-5xl",
295
+ leadColor,
296
+ className
297
+ ),
298
+ children: [
299
+ /* @__PURE__ */ jsx("span", { children: lead }),
300
+ muted ? /* @__PURE__ */ jsxs("span", { className: mutedColor, children: [
301
+ " ",
302
+ muted
303
+ ] }) : null
304
+ ]
305
+ }
306
+ );
307
+ }
308
+ function MarketingHeading({
309
+ eyebrow,
310
+ lead,
311
+ muted,
312
+ body,
313
+ align = "start",
314
+ tone = "default",
315
+ as,
316
+ className
317
+ }) {
318
+ const centered = align === "center";
319
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", centered && "items-center text-center", className), children: [
320
+ eyebrow && /* @__PURE__ */ jsx(
321
+ "p",
322
+ {
323
+ className: cn(
324
+ "label-mono mb-3",
325
+ tone === "onBrand" ? "text-primary-foreground/80" : "text-primary"
326
+ ),
327
+ children: eyebrow
328
+ }
329
+ ),
330
+ /* @__PURE__ */ jsx(
331
+ TwoToneHeading,
332
+ {
333
+ lead,
334
+ muted,
335
+ as,
336
+ tone,
337
+ className: cn("max-w-4xl", centered && "mx-auto")
338
+ }
339
+ ),
340
+ body && /* @__PURE__ */ jsx(
341
+ "p",
342
+ {
343
+ className: cn(
344
+ "mt-4 max-w-2xl text-base sm:text-lg",
345
+ tone === "onBrand" ? "text-primary-foreground/80" : "text-muted-foreground",
346
+ centered && "mx-auto"
347
+ ),
348
+ children: body
349
+ }
350
+ )
351
+ ] });
352
+ }
353
+ var buttonVariants = cva(
354
+ "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
355
+ {
356
+ variants: {
357
+ variant: {
358
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
359
+ destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
360
+ outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
361
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
362
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
363
+ link: "text-primary underline-offset-4 hover:underline",
364
+ // For CTAs placed ON a saturated brand band or a dark section
365
+ // (e.g. a terracotta hero / footer / a forced-dark block) where
366
+ // the surface is dark+light-text in either mode. A neutral white
367
+ // pill + a translucent-white ghost read on any such surface;
368
+ // hardcoded white is deliberate (cf. destructive's text-white).
369
+ onBrand: "bg-white text-neutral-900 shadow-sm hover:bg-white/90",
370
+ onBrandOutline: "border border-white/40 bg-transparent text-white hover:bg-white/10"
371
+ },
372
+ size: {
373
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
374
+ sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
375
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
376
+ icon: "size-9"
377
+ }
378
+ },
379
+ defaultVariants: {
380
+ variant: "default",
381
+ size: "default"
382
+ }
383
+ }
384
+ );
385
+ function Button({
386
+ className,
387
+ variant,
388
+ size,
389
+ asChild = false,
390
+ ...props
391
+ }) {
392
+ const Comp = asChild ? Slot : "button";
393
+ return /* @__PURE__ */ jsx(
394
+ Comp,
395
+ {
396
+ "data-slot": "button",
397
+ className: cn(buttonVariants({ variant, size, className })),
398
+ ...props
399
+ }
400
+ );
401
+ }
402
+ cva(
403
+ "focus-visible:border-ring focus-visible:ring-ring/50 inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",
404
+ {
405
+ variants: {
406
+ variant: {
407
+ default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",
408
+ secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",
409
+ destructive: "bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 border-transparent",
410
+ warning: "bg-warning text-warning-foreground [a&]:hover:bg-warning/90 border-transparent",
411
+ success: "bg-success text-success-foreground [a&]:hover:bg-success/90 border-transparent",
412
+ info: "bg-info text-info-foreground [a&]:hover:bg-info/90 border-transparent",
413
+ brand: "bg-brand-soft text-accent-foreground border-transparent",
414
+ neutral: "bg-foreground text-background [a&]:hover:bg-foreground/90 border-transparent",
415
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
416
+ }
417
+ },
418
+ defaultVariants: { variant: "default" }
419
+ }
420
+ );
421
+ function Input({ className, type, ...props }) {
422
+ return /* @__PURE__ */ jsx(
423
+ "input",
424
+ {
425
+ type,
426
+ "data-slot": "input",
427
+ className: cn(
428
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input bg-input/30 hover:bg-input/50 dark:bg-input/30 dark:hover:bg-input/50 h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base shadow-xs transition-[color,box-shadow,background-color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
429
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
430
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
431
+ className
432
+ ),
433
+ ...props
434
+ }
435
+ );
436
+ }
437
+ cva(
438
+ "relative grid w-full grid-cols-[0_1fr] items-start gap-x-0 gap-y-0.5 rounded-md border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
439
+ {
440
+ variants: {
441
+ variant: {
442
+ default: "bg-card text-card-foreground",
443
+ destructive: "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
444
+ success: "text-success bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-success/90",
445
+ warning: "text-warning bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-warning/90"
446
+ }
447
+ },
448
+ defaultVariants: { variant: "default" }
449
+ }
450
+ );
451
+ globalThis.process?.env?.NODE_ENV;
452
+ globalThis.process?.env?.NODE_ENV;
453
+ var TOOLTIP_SURFACE_CLASS = "bg-popover text-popover-foreground border-border rounded-md border p-2.5 shadow-md";
454
+ var TOOLTIP_MOTION_CLASS = "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 origin-(--radix-popover-content-transform-origin) duration-150 ease-out";
455
+ function compose(theirs, ours) {
456
+ return (e) => {
457
+ theirs?.(e);
458
+ ours(e);
459
+ };
460
+ }
461
+ var lastInputWasKeyboard = false;
462
+ var modalityInstalled = false;
463
+ function installModalityTracking() {
464
+ if (modalityInstalled || typeof window === "undefined") return;
465
+ modalityInstalled = true;
466
+ window.addEventListener("keydown", () => lastInputWasKeyboard = true, true);
467
+ window.addEventListener("pointerdown", () => lastInputWasKeyboard = false, true);
468
+ }
469
+ function Tooltip({
470
+ content,
471
+ children,
472
+ side = "bottom",
473
+ align = "start",
474
+ sideOffset = 8,
475
+ collisionPadding = 12,
476
+ openDelay = 300,
477
+ closeDelay = 90,
478
+ disabled = false,
479
+ portal = true,
480
+ zIndexClassName = "z-50",
481
+ contentClassName
482
+ }) {
483
+ const [hovering, setHovering] = React2.useState(false);
484
+ const [focusing, setFocusing] = React2.useState(false);
485
+ const [isFinePointer, setIsFinePointer] = React2.useState(false);
486
+ const openTimer = React2.useRef(null);
487
+ const closeTimer = React2.useRef(null);
488
+ React2.useEffect(() => {
489
+ installModalityTracking();
490
+ const mq = window.matchMedia("(hover: hover) and (pointer: fine)");
491
+ const apply = () => setIsFinePointer(mq.matches);
492
+ apply();
493
+ mq.addEventListener("change", apply);
494
+ return () => mq.removeEventListener("change", apply);
495
+ }, []);
496
+ const clearTimers = React2.useCallback(() => {
497
+ if (openTimer.current) clearTimeout(openTimer.current);
498
+ if (closeTimer.current) clearTimeout(closeTimer.current);
499
+ }, []);
500
+ React2.useEffect(() => clearTimers, [clearTimers]);
501
+ React2.useEffect(() => {
502
+ if (disabled) {
503
+ clearTimers();
504
+ setHovering(false);
505
+ }
506
+ }, [disabled, clearTimers]);
507
+ const handlePointerEnter = () => {
508
+ if (!isFinePointer) return;
509
+ if (closeTimer.current) clearTimeout(closeTimer.current);
510
+ openTimer.current = setTimeout(() => setHovering(true), openDelay);
511
+ };
512
+ const handlePointerLeave = () => {
513
+ if (openTimer.current) clearTimeout(openTimer.current);
514
+ closeTimer.current = setTimeout(() => setHovering(false), closeDelay);
515
+ };
516
+ const handlePointerDown = () => {
517
+ clearTimers();
518
+ setHovering(false);
519
+ setFocusing(false);
520
+ };
521
+ const handleFocus = () => {
522
+ if (lastInputWasKeyboard) {
523
+ clearTimers();
524
+ setFocusing(true);
525
+ }
526
+ };
527
+ const handleBlur = () => {
528
+ clearTimers();
529
+ setFocusing(false);
530
+ };
531
+ const handleKeyDown = (e) => {
532
+ if (e.key === "Escape") {
533
+ clearTimers();
534
+ setHovering(false);
535
+ setFocusing(false);
536
+ }
537
+ };
538
+ const effectiveOpen = !disabled && (isFinePointer && hovering || focusing);
539
+ const extra = {};
540
+ const childProps = children.props;
541
+ extra.onPointerEnter = compose(childProps.onPointerEnter, handlePointerEnter);
542
+ extra.onPointerLeave = compose(childProps.onPointerLeave, handlePointerLeave);
543
+ extra.onPointerDown = compose(childProps.onPointerDown, handlePointerDown);
544
+ extra.onFocus = compose(childProps.onFocus, handleFocus);
545
+ extra.onBlur = compose(childProps.onBlur, handleBlur);
546
+ extra.onKeyDown = compose(childProps.onKeyDown, handleKeyDown);
547
+ const trigger = React2.cloneElement(children, extra);
548
+ const contentEl = /* @__PURE__ */ jsx(
549
+ Popover.Content,
550
+ {
551
+ side,
552
+ align,
553
+ sideOffset,
554
+ collisionPadding,
555
+ "aria-hidden": true,
556
+ onOpenAutoFocus: (e) => e.preventDefault(),
557
+ onCloseAutoFocus: (e) => e.preventDefault(),
558
+ onFocusOutside: (e) => e.preventDefault(),
559
+ className: cn(
560
+ TOOLTIP_SURFACE_CLASS,
561
+ TOOLTIP_MOTION_CLASS,
562
+ "pointer-events-none",
563
+ zIndexClassName,
564
+ contentClassName
565
+ ),
566
+ children: content
567
+ }
568
+ );
569
+ return /* @__PURE__ */ jsxs(
570
+ Popover.Root,
571
+ {
572
+ open: effectiveOpen,
573
+ onOpenChange: (o) => {
574
+ if (!o) {
575
+ clearTimers();
576
+ setHovering(false);
577
+ setFocusing(false);
578
+ }
579
+ },
580
+ modal: false,
581
+ children: [
582
+ /* @__PURE__ */ jsx(Popover.Anchor, { asChild: true, children: trigger }),
583
+ portal ? /* @__PURE__ */ jsx(Popover.Portal, { children: contentEl }) : contentEl
584
+ ]
585
+ }
586
+ );
587
+ }
588
+ var Accordion = AccordionPrimitive.Root;
589
+ var AccordionItem = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Item, { ref, className: cn("border-b", className), ...props }));
590
+ AccordionItem.displayName = "AccordionItem";
591
+ var AccordionTrigger = React2.forwardRef(({ className, children, icon = "chevron", ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
592
+ AccordionPrimitive.Trigger,
593
+ {
594
+ ref,
595
+ className: cn(
596
+ "flex flex-1 items-center justify-between gap-4 py-4 text-left font-medium transition-all hover:underline",
597
+ icon === "chevron" ? "[&[data-state=open]>svg]:rotate-180" : "[&[data-state=open]>svg]:rotate-45",
598
+ className
599
+ ),
600
+ ...props,
601
+ children: [
602
+ children,
603
+ icon === "chevron" ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-200" }) : /* @__PURE__ */ jsx(Plus, { className: "text-primary h-5 w-5 shrink-0 transition-transform duration-200" })
604
+ ]
605
+ }
606
+ ) }));
607
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
608
+ var AccordionContent = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
609
+ AccordionPrimitive.Content,
610
+ {
611
+ ref,
612
+ className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm transition-all",
613
+ ...props,
614
+ children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4", className), children })
615
+ }
616
+ ));
617
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName;
618
+ var surfaceVariants = cva("rounded-xl transition-colors", {
619
+ variants: {
620
+ tone: {
621
+ /* Crisp panel floating on the page — the default soft card. */
622
+ default: "bg-card text-card-foreground",
623
+ /* Warm-gray recessed panel. */
624
+ muted: "bg-muted text-foreground",
625
+ /* Solid brand fill — small terracotta panel; inverts child text. */
626
+ brand: "bg-brand text-brand-foreground",
627
+ /* High-contrast neutral panel (near-black in light, near-white in dark). */
628
+ contrast: "bg-foreground text-background",
629
+ /* Translucent lightened tile for cards sitting ON a brand band. */
630
+ onBrand: "text-brand-foreground [background:color-mix(in_oklch,white_16%,var(--brand))] [border-color:color-mix(in_oklch,white_24%,transparent)]",
631
+ /* Frame only, transparent fill. */
632
+ outline: "bg-transparent text-foreground"
633
+ },
634
+ elevation: {
635
+ none: "shadow-none",
636
+ sm: "shadow-sm",
637
+ md: "shadow-md",
638
+ lg: "shadow-lg",
639
+ xl: "shadow-xl"
640
+ },
641
+ bordered: {
642
+ true: "border",
643
+ false: ""
644
+ },
645
+ pad: {
646
+ none: "p-0",
647
+ sm: "p-4",
648
+ md: "p-5 sm:p-6",
649
+ lg: "p-6 sm:p-8"
650
+ }
651
+ },
652
+ defaultVariants: {
653
+ tone: "default",
654
+ elevation: "sm",
655
+ bordered: true,
656
+ pad: "md"
657
+ }
658
+ });
659
+ function Surface({
660
+ className,
661
+ tone,
662
+ elevation,
663
+ bordered,
664
+ pad,
665
+ ...props
666
+ }) {
667
+ return /* @__PURE__ */ jsx(
668
+ "div",
669
+ {
670
+ "data-slot": "surface",
671
+ className: cn(surfaceVariants({ tone, elevation, bordered, pad }), className),
672
+ ...props
673
+ }
674
+ );
675
+ }
676
+ var iconBadgeVariants = cva(
677
+ "inline-flex shrink-0 items-center justify-center rounded-md font-semibold [&_svg]:pointer-events-none",
678
+ {
679
+ variants: {
680
+ tone: {
681
+ /* The signature peach tile — soft accent fill, terracotta glyph.
682
+ Auto-swaps to warm-dark + light-peach in dark mode via tokens. */
683
+ peach: "bg-accent text-accent-foreground",
684
+ /* Inverted near-black tile, light glyph ("never do" promises). */
685
+ dark: "bg-foreground text-background",
686
+ /* Solid brand tile. */
687
+ brand: "bg-primary text-primary-foreground",
688
+ /* White tile on a brand band, terracotta glyph (numbered steps). */
689
+ onBrand: "bg-brand-foreground text-primary",
690
+ /* Quiet neutral tile. */
691
+ muted: "bg-muted text-foreground",
692
+ /* Crisp white (card-colored) tile with a terracotta glyph and a
693
+ soft lift — the elevated icon chip on muted/colored cards. */
694
+ surface: "bg-card text-primary shadow-sm"
695
+ },
696
+ size: {
697
+ sm: "size-9 text-xs [&_svg]:size-4",
698
+ md: "size-11 text-sm [&_svg]:size-5",
699
+ lg: "size-12 text-base [&_svg]:size-6",
700
+ xl: "size-14 text-lg [&_svg]:size-7"
701
+ }
702
+ },
703
+ defaultVariants: { tone: "peach", size: "md" }
704
+ }
705
+ );
706
+ function IconBadge({ className, tone, size, children, ...props }) {
707
+ return /* @__PURE__ */ jsx(
708
+ "span",
709
+ {
710
+ "data-slot": "icon-badge",
711
+ className: cn(iconBadgeVariants({ tone, size }), className),
712
+ ...props,
713
+ children
714
+ }
715
+ );
716
+ }
717
+ function FeatureCard({
718
+ icon,
719
+ iconTone = "peach",
720
+ title,
721
+ children,
722
+ orientation = "vertical",
723
+ align = "start",
724
+ tone = "default",
725
+ elevation = "sm",
726
+ className
727
+ }) {
728
+ const horizontal = orientation === "horizontal";
729
+ const centered = !horizontal && align === "center";
730
+ return /* @__PURE__ */ jsxs(
731
+ Surface,
732
+ {
733
+ tone,
734
+ elevation,
735
+ pad: horizontal ? "md" : "lg",
736
+ className: cn(
737
+ "flex h-full",
738
+ horizontal ? "flex-row gap-4" : "flex-col",
739
+ centered && "items-center text-center",
740
+ className
741
+ ),
742
+ children: [
743
+ icon && /* @__PURE__ */ jsx(
744
+ IconBadge,
745
+ {
746
+ tone: iconTone,
747
+ size: "lg",
748
+ className: cn(horizontal ? "shrink-0" : "mb-4"),
749
+ children: icon
750
+ }
751
+ ),
752
+ /* @__PURE__ */ jsxs("div", { className: cn(horizontal && "min-w-0"), children: [
753
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: title }),
754
+ children && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1.5 text-sm leading-relaxed", children })
755
+ ] })
756
+ ]
757
+ }
758
+ );
759
+ }
760
+ var TONE = {
761
+ default: "bg-background text-foreground",
762
+ muted: "bg-muted text-foreground",
763
+ brand: "bg-brand text-brand-foreground",
764
+ // `dark` activates the .dark variant locally so descendant package
765
+ // components render their dark arm even on an otherwise light page.
766
+ dark: "dark bg-background text-foreground"
767
+ };
768
+ var WIDTH = {
769
+ default: "container",
770
+ wide: "mx-auto w-full max-w-screen-2xl px-4 sm:px-6 lg:px-8",
771
+ full: ""
772
+ };
773
+ function Section({
774
+ tone = "default",
775
+ width = "default",
776
+ diagonal,
777
+ id,
778
+ className,
779
+ innerClassName,
780
+ children
781
+ }) {
782
+ const showDiagonal = diagonal ?? tone === "brand";
783
+ return /* @__PURE__ */ jsx(
784
+ "div",
785
+ {
786
+ id,
787
+ className: cn("w-full", TONE[tone], showDiagonal && "oc-diagonal", className),
788
+ children: /* @__PURE__ */ jsx("div", { className: cn("py-16 sm:py-20 md:py-24", WIDTH[width], innerClassName), children })
789
+ }
790
+ );
791
+ }
792
+ function BrandBand(props) {
793
+ return /* @__PURE__ */ jsx(Section, { tone: "brand", ...props });
794
+ }
795
+ function ComparisonTable({ rows, columns, className }) {
796
+ const cols = { feature: "", theirs: "A normal login", ours: "OrangeCheck", ...columns };
797
+ return /* @__PURE__ */ jsx("div", { className: cn("overflow-hidden rounded-xl border", className), children: /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("div", { className: "min-w-[32rem]", children: [
798
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[1.4fr_1fr_1fr]", children: [
799
+ /* @__PURE__ */ jsx("div", { className: "label-mono text-muted-foreground px-4 py-3.5 sm:px-6", children: cols.feature }),
800
+ /* @__PURE__ */ jsx("div", { className: "px-4 py-3.5 font-semibold text-foreground sm:px-6", children: cols.theirs }),
801
+ /* @__PURE__ */ jsx("div", { className: "bg-accent/60 border-border/60 border-l px-4 py-3.5 font-semibold text-primary sm:px-6", children: cols.ours })
802
+ ] }),
803
+ rows.map((row, i) => /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[1.4fr_1fr_1fr] border-t", children: [
804
+ /* @__PURE__ */ jsx("div", { className: "px-4 py-3.5 font-medium text-foreground sm:px-6", children: row.label }),
805
+ /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground flex items-center gap-2 px-4 py-3.5 sm:px-6", children: [
806
+ /* @__PURE__ */ jsx(X, { className: "text-muted-foreground/70 size-4" }),
807
+ /* @__PURE__ */ jsx("span", { children: row.theirs })
808
+ ] }),
809
+ /* @__PURE__ */ jsxs("div", { className: "bg-accent/40 border-border/60 flex items-center gap-2 border-l px-4 py-3.5 text-foreground sm:px-6", children: [
810
+ /* @__PURE__ */ jsx(Check, { className: "size-4 text-primary" }),
811
+ /* @__PURE__ */ jsx("span", { children: row.ours })
812
+ ] })
813
+ ] }, i))
814
+ ] }) }) });
815
+ }
816
+ function NumberedStep({
817
+ n,
818
+ title,
819
+ children,
820
+ tone = "default",
821
+ card = false,
822
+ className
823
+ }) {
824
+ const onBrand = tone === "onBrand";
825
+ const body = /* @__PURE__ */ jsxs("div", { className: cn(!card && className), children: [
826
+ /* @__PURE__ */ jsx(IconBadge, { tone: onBrand ? "onBrand" : "peach", size: "sm", children: n }),
827
+ /* @__PURE__ */ jsx("div", { className: "mt-4 text-lg font-semibold", children: title }),
828
+ children && /* @__PURE__ */ jsx(
829
+ "div",
830
+ {
831
+ className: cn(
832
+ "mt-1.5 text-sm leading-relaxed",
833
+ onBrand ? "text-brand-foreground/80" : "text-muted-foreground"
834
+ ),
835
+ children
836
+ }
837
+ )
838
+ ] });
839
+ if (!card) return body;
840
+ return /* @__PURE__ */ jsx(
841
+ Surface,
842
+ {
843
+ tone: onBrand ? "onBrand" : "default",
844
+ elevation: onBrand ? "none" : "sm",
845
+ pad: "md",
846
+ className,
847
+ children: body
848
+ }
849
+ );
850
+ }
851
+ var COLUMNS = {
852
+ 2: "md:grid-cols-2",
853
+ 3: "md:grid-cols-3",
854
+ 4: "md:grid-cols-4"
855
+ };
856
+ function StepList({
857
+ steps,
858
+ variant = "bare",
859
+ tone = "default",
860
+ columns = 3,
861
+ className
862
+ }) {
863
+ return /* @__PURE__ */ jsx("div", { className: cn("grid gap-6 sm:grid-cols-2 sm:gap-8", COLUMNS[columns], className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
864
+ NumberedStep,
865
+ {
866
+ n: index + 1,
867
+ title: step.title,
868
+ tone,
869
+ card: variant === "card",
870
+ children: step.children
871
+ },
872
+ index
873
+ )) });
874
+ }
875
+ function Faq({ items, defaultOpen, className }) {
876
+ return /* @__PURE__ */ jsx(
877
+ Accordion,
878
+ {
879
+ type: "single",
880
+ collapsible: true,
881
+ defaultValue: defaultOpen != null ? String(defaultOpen) : void 0,
882
+ className: cn("w-full", className),
883
+ children: items.map((item, i) => /* @__PURE__ */ jsxs(AccordionItem, { value: String(i), children: [
884
+ /* @__PURE__ */ jsx(
885
+ AccordionTrigger,
886
+ {
887
+ icon: "plusMinus",
888
+ className: "text-foreground text-base font-semibold",
889
+ children: item.q
890
+ }
891
+ ),
892
+ /* @__PURE__ */ jsx(AccordionContent, { className: "text-muted-foreground leading-relaxed", children: item.a })
893
+ ] }, i))
894
+ }
895
+ );
896
+ }
897
+ function EmailCapture({
898
+ action,
899
+ method,
900
+ onSubmit,
901
+ name = "email",
902
+ placeholder = "you@email.com",
903
+ cta = "Join the waitlist",
904
+ note,
905
+ tone = "default",
906
+ className
907
+ }) {
908
+ const onBrand = tone === "onBrand";
909
+ return /* @__PURE__ */ jsxs("form", { action, method, onSubmit, className: cn(className), children: [
910
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center", children: [
911
+ /* @__PURE__ */ jsx(
912
+ Input,
913
+ {
914
+ type: "email",
915
+ name,
916
+ required: true,
917
+ placeholder,
918
+ className: cn(
919
+ "rounded-full text-base md:text-sm",
920
+ onBrand && "[background:color-mix(in_oklch,white_18%,transparent)] placeholder:text-primary-foreground/60 border-transparent text-primary-foreground"
921
+ )
922
+ }
923
+ ),
924
+ /* @__PURE__ */ jsx(Button, { type: "submit", variant: onBrand ? "onBrand" : "default", className: "rounded-full", children: cta })
925
+ ] }),
926
+ note && /* @__PURE__ */ jsx(
927
+ "p",
928
+ {
929
+ className: cn(
930
+ "mt-3 text-sm",
931
+ onBrand ? "text-primary-foreground/70" : "text-muted-foreground"
932
+ ),
933
+ children: note
934
+ }
935
+ )
936
+ ] });
937
+ }
938
+ function CheckList({
939
+ items,
940
+ orientation = "horizontal",
941
+ tone = "default",
942
+ className
943
+ }) {
944
+ const glyph = tone === "onBrand" ? "text-brand-foreground" : "text-primary";
945
+ const label = tone === "onBrand" ? "text-brand-foreground/90" : "text-foreground";
946
+ return /* @__PURE__ */ jsx(
947
+ "ul",
948
+ {
949
+ className: cn(
950
+ orientation === "horizontal" ? "flex flex-wrap gap-x-6 gap-y-2 text-sm" : "flex flex-col gap-2 text-sm",
951
+ className
952
+ ),
953
+ children: items.map((item, i) => /* @__PURE__ */ jsxs("li", { className: cn("inline-flex items-center gap-2", label), children: [
954
+ /* @__PURE__ */ jsx(Check, { className: cn("size-4 shrink-0", glyph) }),
955
+ item
956
+ ] }, i))
957
+ }
958
+ );
959
+ }
960
+ function AccentNote({ lead, children, tone = "default", className }) {
961
+ const onBrand = tone === "onBrand";
962
+ return /* @__PURE__ */ jsxs(
963
+ "div",
964
+ {
965
+ className: cn(
966
+ "border-l-2 pl-4 text-sm leading-relaxed",
967
+ onBrand ? "border-primary-foreground/60 text-primary-foreground/80" : "border-primary text-muted-foreground",
968
+ className
969
+ ),
970
+ children: [
971
+ lead && /* @__PURE__ */ jsx(
972
+ "strong",
973
+ {
974
+ className: cn(
975
+ "mr-1.5 font-semibold",
976
+ onBrand ? "text-primary-foreground" : "text-foreground"
977
+ ),
978
+ children: lead
979
+ }
980
+ ),
981
+ children
982
+ ]
983
+ }
984
+ );
985
+ }
986
+ function AccentList({ items, className }) {
987
+ return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col", className), children: items.map((item, i) => /* @__PURE__ */ jsxs(
988
+ "div",
989
+ {
990
+ className: cn("border-l-2 py-2 pl-5", item.active ? "border-primary" : "border-border"),
991
+ children: [
992
+ /* @__PURE__ */ jsx(
993
+ "div",
994
+ {
995
+ className: cn(
996
+ "font-semibold",
997
+ item.active ? "text-foreground" : "text-muted-foreground"
998
+ ),
999
+ children: item.title
1000
+ }
1001
+ ),
1002
+ item.active && item.children && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground mt-1 text-sm leading-relaxed", children: item.children })
1003
+ ]
1004
+ },
1005
+ i
1006
+ )) });
1007
+ }
1008
+ function VerifiedChip({ icon, iconTone = "peach", label, className }) {
1009
+ return /* @__PURE__ */ jsxs(
1010
+ Surface,
1011
+ {
1012
+ elevation: "lg",
1013
+ pad: "none",
1014
+ className: cn("inline-flex items-center gap-3 rounded-full px-3 py-2", className),
1015
+ children: [
1016
+ /* @__PURE__ */ jsx(IconBadge, { tone: iconTone, size: "sm", children: icon ?? /* @__PURE__ */ jsx(Check, {}) }),
1017
+ /* @__PURE__ */ jsx("span", { className: "pr-2 text-sm font-semibold text-foreground", children: label })
1018
+ ]
1019
+ }
1020
+ );
1021
+ }
266
1022
  var ENTRIES = [
267
1023
  {
268
1024
  slug: "home",
@@ -469,141 +1225,6 @@ function EcosystemSwitcher({
469
1225
  )
470
1226
  ] });
471
1227
  }
472
- var TOOLTIP_SURFACE_CLASS = "bg-popover text-popover-foreground border-border rounded-md border p-2.5 shadow-md";
473
- var TOOLTIP_MOTION_CLASS = "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 origin-(--radix-popover-content-transform-origin) duration-150 ease-out";
474
- function compose(theirs, ours) {
475
- return (e) => {
476
- theirs?.(e);
477
- ours(e);
478
- };
479
- }
480
- var lastInputWasKeyboard = false;
481
- var modalityInstalled = false;
482
- function installModalityTracking() {
483
- if (modalityInstalled || typeof window === "undefined") return;
484
- modalityInstalled = true;
485
- window.addEventListener("keydown", () => lastInputWasKeyboard = true, true);
486
- window.addEventListener("pointerdown", () => lastInputWasKeyboard = false, true);
487
- }
488
- function Tooltip({
489
- content,
490
- children,
491
- side = "bottom",
492
- align = "start",
493
- sideOffset = 8,
494
- collisionPadding = 12,
495
- openDelay = 300,
496
- closeDelay = 90,
497
- disabled = false,
498
- portal = true,
499
- zIndexClassName = "z-50",
500
- contentClassName
501
- }) {
502
- const [hovering, setHovering] = React.useState(false);
503
- const [focusing, setFocusing] = React.useState(false);
504
- const [isFinePointer, setIsFinePointer] = React.useState(false);
505
- const openTimer = React.useRef(null);
506
- const closeTimer = React.useRef(null);
507
- React.useEffect(() => {
508
- installModalityTracking();
509
- const mq = window.matchMedia("(hover: hover) and (pointer: fine)");
510
- const apply = () => setIsFinePointer(mq.matches);
511
- apply();
512
- mq.addEventListener("change", apply);
513
- return () => mq.removeEventListener("change", apply);
514
- }, []);
515
- const clearTimers = React.useCallback(() => {
516
- if (openTimer.current) clearTimeout(openTimer.current);
517
- if (closeTimer.current) clearTimeout(closeTimer.current);
518
- }, []);
519
- React.useEffect(() => clearTimers, [clearTimers]);
520
- React.useEffect(() => {
521
- if (disabled) {
522
- clearTimers();
523
- setHovering(false);
524
- }
525
- }, [disabled, clearTimers]);
526
- const handlePointerEnter = () => {
527
- if (!isFinePointer) return;
528
- if (closeTimer.current) clearTimeout(closeTimer.current);
529
- openTimer.current = setTimeout(() => setHovering(true), openDelay);
530
- };
531
- const handlePointerLeave = () => {
532
- if (openTimer.current) clearTimeout(openTimer.current);
533
- closeTimer.current = setTimeout(() => setHovering(false), closeDelay);
534
- };
535
- const handlePointerDown = () => {
536
- clearTimers();
537
- setHovering(false);
538
- setFocusing(false);
539
- };
540
- const handleFocus = () => {
541
- if (lastInputWasKeyboard) {
542
- clearTimers();
543
- setFocusing(true);
544
- }
545
- };
546
- const handleBlur = () => {
547
- clearTimers();
548
- setFocusing(false);
549
- };
550
- const handleKeyDown = (e) => {
551
- if (e.key === "Escape") {
552
- clearTimers();
553
- setHovering(false);
554
- setFocusing(false);
555
- }
556
- };
557
- const effectiveOpen = !disabled && (isFinePointer && hovering || focusing);
558
- const extra = {};
559
- const childProps = children.props;
560
- extra.onPointerEnter = compose(childProps.onPointerEnter, handlePointerEnter);
561
- extra.onPointerLeave = compose(childProps.onPointerLeave, handlePointerLeave);
562
- extra.onPointerDown = compose(childProps.onPointerDown, handlePointerDown);
563
- extra.onFocus = compose(childProps.onFocus, handleFocus);
564
- extra.onBlur = compose(childProps.onBlur, handleBlur);
565
- extra.onKeyDown = compose(childProps.onKeyDown, handleKeyDown);
566
- const trigger = React.cloneElement(children, extra);
567
- const contentEl = /* @__PURE__ */ jsx(
568
- Popover.Content,
569
- {
570
- side,
571
- align,
572
- sideOffset,
573
- collisionPadding,
574
- "aria-hidden": true,
575
- onOpenAutoFocus: (e) => e.preventDefault(),
576
- onCloseAutoFocus: (e) => e.preventDefault(),
577
- onFocusOutside: (e) => e.preventDefault(),
578
- className: cn(
579
- TOOLTIP_SURFACE_CLASS,
580
- TOOLTIP_MOTION_CLASS,
581
- "pointer-events-none",
582
- zIndexClassName,
583
- contentClassName
584
- ),
585
- children: content
586
- }
587
- );
588
- return /* @__PURE__ */ jsxs(
589
- Popover.Root,
590
- {
591
- open: effectiveOpen,
592
- onOpenChange: (o) => {
593
- if (!o) {
594
- clearTimers();
595
- setHovering(false);
596
- setFocusing(false);
597
- }
598
- },
599
- modal: false,
600
- children: [
601
- /* @__PURE__ */ jsx(Popover.Anchor, { asChild: true, children: trigger }),
602
- portal ? /* @__PURE__ */ jsx(Popover.Portal, { children: contentEl }) : contentEl
603
- ]
604
- }
605
- );
606
- }
607
1228
 
608
1229
  // src/chrome/family-properties.ts
609
1230
  var FAMILY_PROPERTIES = [
@@ -1038,7 +1659,7 @@ function AppearanceControls({ className }) {
1038
1659
  const activeMode = mounted ? theme ?? "system" : null;
1039
1660
  return /* @__PURE__ */ jsxs("div", { className, children: [
1040
1661
  /* @__PURE__ */ jsx("div", { className: "label-mono text-muted-foreground px-3 pt-3 pb-2", children: "mode" }),
1041
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 px-2 pb-2", children: MODES.map(({ id, label, Icon }) => {
1662
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 px-2 pb-2", children: MODES.map(({ id, label, Icon: Icon2 }) => {
1042
1663
  const active = activeMode === id;
1043
1664
  return /* @__PURE__ */ jsxs(
1044
1665
  "button",
@@ -1052,7 +1673,7 @@ function AppearanceControls({ className }) {
1052
1673
  active ? "border-primary text-foreground bg-accent" : "border-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground"
1053
1674
  ),
1054
1675
  children: [
1055
- /* @__PURE__ */ jsx(Icon, { className: "size-4", "aria-hidden": true }),
1676
+ /* @__PURE__ */ jsx(Icon2, { className: "size-4", "aria-hidden": true }),
1056
1677
  label
1057
1678
  ]
1058
1679
  },
@@ -2311,6 +2932,6 @@ function OcAppBar({
2311
2932
  );
2312
2933
  }
2313
2934
 
2314
- export { AppShell, Callout, DataRow, DefinitionList, EcosystemSwitcher, EmptyState, FAMILY_PROPERTIES, HelpHint, LayoutSubHeader, OcAccountMenu, OcAccountMenuView, OcAppBar, OcDashboardHub, OcDashboardShell, OcLogoDropdown, OcPrimaryNav, SITE_STATE_LABEL, SectionHeader, StatCard, StatGrid, StatTile, findFamilyProperty };
2935
+ export { AccentList, AccentNote, AppShell, BrandBand, Callout, CheckList, ComparisonTable, DataRow, DefinitionList, EcosystemSwitcher, EmailCapture, EmptyState, FAMILY_PROPERTIES, Faq, FeatureCard, HelpHint, LayoutSubHeader, MarketingHeading, NumberedStep, OcAccountMenu, OcAccountMenuView, OcAppBar, OcDashboardHub, OcDashboardShell, OcLogoDropdown, OcPrimaryNav, SITE_STATE_LABEL, Section, SectionHeader, StatCard, StatGrid, StatTile, StepList, TwoToneHeading, VerifiedChip, findFamilyProperty };
2315
2936
  //# sourceMappingURL=components.mjs.map
2316
2937
  //# sourceMappingURL=components.mjs.map