@orangecheck/app-design 0.5.10 → 0.5.11

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.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { APP_ATTRIBUTE, APP_ID, appColors, appFonts } from './tokens.mjs';
2
2
  export { Badge, BadgeProps, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardNumeral, CardProps, CardTitle, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Field, FieldProps, Input, Kbd, Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollFade, ScrollFadeProps, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetTitle, SheetTrigger, Skeleton, Spinner, StatusDot, StatusPill, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cardVariants, cn, useTimedOut } from './primitives.mjs';
3
3
  export { AppIcon, AppIconProps, Crowd, CrowdProps, HalftoneCanvas, HalftoneCanvasProps, HalftoneSphere, HalftoneSphereProps, IsoCheck, IsoCheckProps, Lockup, LockupProps, MARK_FACES, Mark, MarkProps, SPHERE_GRADIENT, Tone, portraitTone } from './brand.mjs';
4
- export { Accent, ActivityItem, ActivityList, BrowserFrame, CodeBlock, Column, Container, CopyButton, DataTable, Display, DisplayProps, DocHeader, DocLayout, EmptyLine, EmptyState, Eyebrow, FloatChip, Footnote, HashChip, KeyValueItem, KeyValueList, Lead, LoadingBlock, Monogram, Notice, PackageCard, PackageItem, PageHeader, PageHero, PageHeroProps, PhoneFrame, ProgressStep, ProgressSteps, Prose, Reveal, Sats, SatsFigure, SatsProps, SatsTextOptions, ScrollStory, Section, SectionIntro, SectionProps, SplitBar, SplitSegment, StatCard, StatCardProps, StatGrid, StatGridProps, StepGrid, StepGridProps, StepItem, StepState, Ticker, TocItem, TruthRow, TruthStatus, TruthTable, UsdApprox, monogramGround, monogramLetter, satsText, sectionVariants, useCopy, useInView } from './components.mjs';
4
+ export { Accent, ActivityItem, ActivityList, BrowserFrame, CodeBlock, Column, Container, CopyButton, DataTable, Display, DisplayProps, DocHeader, DocLayout, EmptyLine, EmptyState, ErrorBoundary, Eyebrow, FloatChip, Footnote, HashChip, KeyValueItem, KeyValueList, Lead, LoadingBlock, Monogram, Notice, PackageCard, PackageItem, PageHeader, PageHero, PageHeroProps, PhoneFrame, ProgressStep, ProgressSteps, Prose, Reveal, Sats, SatsFigure, SatsProps, SatsTextOptions, ScrollStory, Section, SectionIntro, SectionProps, SplitBar, SplitSegment, StatCard, StatCardProps, StatGrid, StatGridProps, StepGrid, StepGridProps, StepItem, StepState, Ticker, TocItem, TruthRow, TruthStatus, TruthTable, UsdApprox, monogramGround, monogramLetter, satsText, sectionVariants, useCopy, useInView } from './components.mjs';
5
5
  export { AccountMenu, AccountMenuItem, AppShell, FooterColumn, NavItem, ShellContext, ShellNavGroup, ShellNavItem, ShellPlace, ShellSection, SiteFooter, SiteHeader, ThemeToggle, useShellPlace } from './chrome.mjs';
6
6
  export { toast } from 'sonner';
7
7
  import 'react';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { APP_ATTRIBUTE, APP_ID, appColors, appFonts } from './tokens.js';
2
2
  export { Badge, BadgeProps, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardNumeral, CardProps, CardTitle, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Field, FieldProps, Input, Kbd, Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollFade, ScrollFadeProps, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetTitle, SheetTrigger, Skeleton, Spinner, StatusDot, StatusPill, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cardVariants, cn, useTimedOut } from './primitives.js';
3
3
  export { AppIcon, AppIconProps, Crowd, CrowdProps, HalftoneCanvas, HalftoneCanvasProps, HalftoneSphere, HalftoneSphereProps, IsoCheck, IsoCheckProps, Lockup, LockupProps, MARK_FACES, Mark, MarkProps, SPHERE_GRADIENT, Tone, portraitTone } from './brand.js';
4
- export { Accent, ActivityItem, ActivityList, BrowserFrame, CodeBlock, Column, Container, CopyButton, DataTable, Display, DisplayProps, DocHeader, DocLayout, EmptyLine, EmptyState, Eyebrow, FloatChip, Footnote, HashChip, KeyValueItem, KeyValueList, Lead, LoadingBlock, Monogram, Notice, PackageCard, PackageItem, PageHeader, PageHero, PageHeroProps, PhoneFrame, ProgressStep, ProgressSteps, Prose, Reveal, Sats, SatsFigure, SatsProps, SatsTextOptions, ScrollStory, Section, SectionIntro, SectionProps, SplitBar, SplitSegment, StatCard, StatCardProps, StatGrid, StatGridProps, StepGrid, StepGridProps, StepItem, StepState, Ticker, TocItem, TruthRow, TruthStatus, TruthTable, UsdApprox, monogramGround, monogramLetter, satsText, sectionVariants, useCopy, useInView } from './components.js';
4
+ export { Accent, ActivityItem, ActivityList, BrowserFrame, CodeBlock, Column, Container, CopyButton, DataTable, Display, DisplayProps, DocHeader, DocLayout, EmptyLine, EmptyState, ErrorBoundary, Eyebrow, FloatChip, Footnote, HashChip, KeyValueItem, KeyValueList, Lead, LoadingBlock, Monogram, Notice, PackageCard, PackageItem, PageHeader, PageHero, PageHeroProps, PhoneFrame, ProgressStep, ProgressSteps, Prose, Reveal, Sats, SatsFigure, SatsProps, SatsTextOptions, ScrollStory, Section, SectionIntro, SectionProps, SplitBar, SplitSegment, StatCard, StatCardProps, StatGrid, StatGridProps, StepGrid, StepGridProps, StepItem, StepState, Ticker, TocItem, TruthRow, TruthStatus, TruthTable, UsdApprox, monogramGround, monogramLetter, satsText, sectionVariants, useCopy, useInView } from './components.js';
5
5
  export { AccountMenu, AccountMenuItem, AppShell, FooterColumn, NavItem, ShellContext, ShellNavGroup, ShellNavItem, ShellPlace, ShellSection, SiteFooter, SiteHeader, ThemeToggle, useShellPlace } from './chrome.js';
6
6
  export { toast } from 'sonner';
7
7
  import 'react';
package/dist/index.js CHANGED
@@ -707,7 +707,13 @@ var DropdownMenuLabel = react.forwardRef(function DropdownMenuLabel2({ className
707
707
  var DropdownMenuSeparator = react.forwardRef(function DropdownMenuSeparator2({ className, ...props }, ref) {
708
708
  return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Separator, { ref, className: cn("my-1.5 h-px bg-border", className), ...props });
709
709
  });
710
- function ScrollFade({ fade = "var(--card)", className, innerClassName, children, ...props }) {
710
+ function ScrollFade({
711
+ fade = "var(--card)",
712
+ className,
713
+ innerClassName,
714
+ children,
715
+ ...props
716
+ }) {
711
717
  const ref = react.useRef(null);
712
718
  const [edges, setEdges] = react.useState({ left: false, right: false });
713
719
  const measure = react.useCallback(() => {
@@ -715,7 +721,9 @@ function ScrollFade({ fade = "var(--card)", className, innerClassName, children,
715
721
  if (!el) return;
716
722
  const left = el.scrollLeft > 1;
717
723
  const right = el.scrollLeft + el.clientWidth < el.scrollWidth - 1;
718
- setEdges((e) => e.left === left && e.right === right ? e : { left, right });
724
+ setEdges(
725
+ (e) => e.left === left && e.right === right ? e : { left, right }
726
+ );
719
727
  }, []);
720
728
  react.useEffect(() => {
721
729
  const el = ref.current;
@@ -728,7 +736,19 @@ function ScrollFade({ fade = "var(--card)", className, innerClassName, children,
728
736
  return () => ro.disconnect();
729
737
  }, [measure]);
730
738
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative min-w-0", className), ...props, children: [
731
- /* @__PURE__ */ jsxRuntime.jsx("div", { ref, onScroll: measure, className: cn("overflow-x-auto overscroll-x-contain", innerClassName), children }),
739
+ /* @__PURE__ */ jsxRuntime.jsx(
740
+ "div",
741
+ {
742
+ ref,
743
+ onScroll: measure,
744
+ tabIndex: edges.left || edges.right ? 0 : void 0,
745
+ className: cn(
746
+ "overflow-x-auto overscroll-x-contain rounded-[inherit] outline-none focus-visible:ring-2 focus-visible:ring-ring",
747
+ innerClassName
748
+ ),
749
+ children
750
+ }
751
+ ),
732
752
  /* @__PURE__ */ jsxRuntime.jsx(
733
753
  "span",
734
754
  {
@@ -737,7 +757,9 @@ function ScrollFade({ fade = "var(--card)", className, innerClassName, children,
737
757
  "pointer-events-none absolute inset-y-0 left-0 w-8 transition-opacity duration-150",
738
758
  edges.left ? "opacity-100" : "opacity-0"
739
759
  ),
740
- style: { background: `linear-gradient(to right, ${fade}, transparent)` }
760
+ style: {
761
+ background: `linear-gradient(to right, ${fade}, transparent)`
762
+ }
741
763
  }
742
764
  ),
743
765
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -992,7 +1014,8 @@ function HalftoneCanvas({
992
1014
  raf = busy && visible && !document.hidden ? requestAnimationFrame(frame) : 0;
993
1015
  }
994
1016
  const kick = () => {
995
- if (!raf && visible && !document.hidden) raf = requestAnimationFrame(frame);
1017
+ if (!raf && visible && !document.hidden)
1018
+ raf = requestAnimationFrame(frame);
996
1019
  };
997
1020
  layout();
998
1021
  setLive(true);
@@ -1034,22 +1057,41 @@ function HalftoneCanvas({
1034
1057
  el.removeEventListener("pointerleave", leave);
1035
1058
  };
1036
1059
  }, [tone, density, lens, intro, breathe, ink]);
1037
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: wrap, className: cn("relative aspect-square w-full", className), style, "data-live": live || void 0, children: [
1038
- fallbackSrc ? (
1039
- // eslint-disable-next-line @next/next/no-img-element -- the still screen, until the live one draws
1040
- /* @__PURE__ */ jsxRuntime.jsx(
1041
- "img",
1042
- {
1043
- src: fallbackSrc,
1044
- alt: "",
1045
- "aria-hidden": true,
1046
- className: cn("absolute inset-0 size-full select-none transition-opacity duration-300", live && "opacity-0"),
1047
- draggable: false
1048
- }
1049
- )
1050
- ) : null,
1051
- /* @__PURE__ */ jsxRuntime.jsx("canvas", { ref: canvas, role: "img", "aria-label": alt, className: "absolute inset-0 size-full" })
1052
- ] });
1060
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1061
+ "div",
1062
+ {
1063
+ ref: wrap,
1064
+ className: cn("relative aspect-square w-full", className),
1065
+ style,
1066
+ "data-live": live || void 0,
1067
+ children: [
1068
+ fallbackSrc ? (
1069
+ // eslint-disable-next-line @next/next/no-img-element -- the still screen, until the live one draws
1070
+ /* @__PURE__ */ jsxRuntime.jsx(
1071
+ "img",
1072
+ {
1073
+ src: fallbackSrc,
1074
+ alt: "",
1075
+ "aria-hidden": true,
1076
+ className: cn(
1077
+ "absolute inset-0 size-full select-none transition-opacity duration-300",
1078
+ live && "opacity-0"
1079
+ ),
1080
+ draggable: false
1081
+ }
1082
+ )
1083
+ ) : null,
1084
+ /* @__PURE__ */ jsxRuntime.jsx(
1085
+ "canvas",
1086
+ {
1087
+ ref: canvas,
1088
+ ...alt ? { role: "img", "aria-label": alt } : { "aria-hidden": true },
1089
+ className: "absolute inset-0 size-full"
1090
+ }
1091
+ )
1092
+ ]
1093
+ }
1094
+ );
1053
1095
  }
1054
1096
  var SPHERE_GRADIENT = "radial-gradient(86% 86% at 36% 32%, #fff7f0 0%, #ffdec8 14%, #ffa069 34%, #ff7030 56%, #f65210 78%, #de4006 100%)";
1055
1097
  var SPHERE_DEPTH = "inset -14px -22px 44px rgb(150 40 0 / 0.16), 0 36px 70px -34px rgb(234 88 11 / 0.45)";
@@ -2397,7 +2439,49 @@ function Monogram({
2397
2439
  }
2398
2440
  );
2399
2441
  }
2400
- function NavLink({ item, className, onNavigate }) {
2442
+ var ErrorBoundary = class extends react.Component {
2443
+ constructor() {
2444
+ super(...arguments);
2445
+ this.state = { failed: false, key: this.props.resetKey };
2446
+ this.reset = () => this.setState({ failed: false });
2447
+ }
2448
+ static getDerivedStateFromError() {
2449
+ return { failed: true };
2450
+ }
2451
+ static getDerivedStateFromProps(props, state) {
2452
+ return props.resetKey === state.key ? null : { failed: false, key: props.resetKey };
2453
+ }
2454
+ componentDidCatch(error, info) {
2455
+ this.props.onError?.(error, info);
2456
+ }
2457
+ render() {
2458
+ if (!this.state.failed) return this.props.children;
2459
+ if (this.props.fallback) return this.props.fallback(this.reset);
2460
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oca-container py-16", children: /* @__PURE__ */ jsxRuntime.jsx(
2461
+ EmptyState,
2462
+ {
2463
+ title: "Something on this page broke.",
2464
+ action: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2465
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: this.reset, children: "Try again" }),
2466
+ /* @__PURE__ */ jsxRuntime.jsx(
2467
+ Button,
2468
+ {
2469
+ variant: "secondary",
2470
+ onClick: () => window.location.reload(),
2471
+ children: "Reload the page"
2472
+ }
2473
+ )
2474
+ ] }),
2475
+ children: "Nothing you saved is affected. If it keeps happening, tell us at hello@ochk.io."
2476
+ }
2477
+ ) });
2478
+ }
2479
+ };
2480
+ function NavLink({
2481
+ item,
2482
+ className,
2483
+ onNavigate
2484
+ }) {
2401
2485
  const cls = cn(
2402
2486
  "rounded-full px-3 py-2 text-[0.9375rem] transition-colors",
2403
2487
  item.active ? "text-foreground" : "text-muted-foreground hover:text-foreground",
@@ -2406,7 +2490,16 @@ function NavLink({ item, className, onNavigate }) {
2406
2490
  if (item.external) {
2407
2491
  return /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, className: cls, rel: "noreferrer", onClick: onNavigate, children: item.label });
2408
2492
  }
2409
- return /* @__PURE__ */ jsxRuntime.jsx(Link2__default.default, { href: item.href, className: cls, "aria-current": item.active ? "page" : void 0, onClick: onNavigate, children: item.label });
2493
+ return /* @__PURE__ */ jsxRuntime.jsx(
2494
+ Link2__default.default,
2495
+ {
2496
+ href: item.href,
2497
+ className: cls,
2498
+ "aria-current": item.active ? "page" : void 0,
2499
+ onClick: onNavigate,
2500
+ children: item.label
2501
+ }
2502
+ );
2410
2503
  }
2411
2504
  function SiteHeader({
2412
2505
  home = "/",
@@ -2424,7 +2517,10 @@ function SiteHeader({
2424
2517
  className
2425
2518
  ),
2426
2519
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oca-container flex h-16 items-center justify-between gap-4 md:h-[4.5rem]", children: [
2427
- /* @__PURE__ */ jsxRuntime.jsx(Link2__default.default, { href: home, className: "-ml-1 rounded-lg p-1", "aria-label": "Home", children: brand ?? /* @__PURE__ */ jsxRuntime.jsx(Lockup, { size: 28 }) }),
2520
+ /* @__PURE__ */ jsxRuntime.jsxs(Link2__default.default, { href: home, className: "-ml-1 rounded-lg p-1", children: [
2521
+ brand ?? /* @__PURE__ */ jsxRuntime.jsx(Lockup, { size: 28 }),
2522
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: " home" })
2523
+ ] }),
2428
2524
  nav.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Main", className: "hidden items-center gap-1 md:flex", children: nav.map((n) => /* @__PURE__ */ jsxRuntime.jsx(NavLink, { item: n }, n.href)) }) : null,
2429
2525
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2430
2526
  actions,
@@ -2473,27 +2569,46 @@ function SiteFooter({
2473
2569
  return /* @__PURE__ */ jsxRuntime.jsxs(
2474
2570
  "div",
2475
2571
  {
2476
- className: cn("flex min-w-0 flex-col gap-1", spans && "col-span-2 md:col-span-1"),
2572
+ className: cn(
2573
+ "flex min-w-0 flex-col gap-1",
2574
+ spans && "col-span-2 md:col-span-1"
2575
+ ),
2477
2576
  children: [
2478
2577
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-[0.875rem] font-medium", children: col.heading }),
2479
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col gap-1", spans && "grid grid-cols-2 gap-x-6 md:flex md:flex-col"), children: col.links.map((l) => /* @__PURE__ */ jsxRuntime.jsx(
2480
- NavLink,
2578
+ /* @__PURE__ */ jsxRuntime.jsx(
2579
+ "div",
2481
2580
  {
2482
- item: l,
2483
- className: "-mx-3 py-2.5 text-[0.9375rem] md:py-1.5"
2484
- },
2485
- l.href
2486
- )) })
2581
+ className: cn(
2582
+ "flex flex-col gap-1",
2583
+ spans && "grid grid-cols-2 gap-x-6 md:flex md:flex-col"
2584
+ ),
2585
+ children: col.links.map((l) => /* @__PURE__ */ jsxRuntime.jsx(
2586
+ NavLink,
2587
+ {
2588
+ item: l,
2589
+ className: "-mx-3 py-2.5 text-[0.9375rem] md:py-1.5"
2590
+ },
2591
+ l.href
2592
+ ))
2593
+ }
2594
+ )
2487
2595
  ]
2488
2596
  },
2489
2597
  col.heading
2490
2598
  );
2491
2599
  })
2492
2600
  ] }),
2493
- signature ? /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": true, className: "oca-container select-none overflow-hidden pb-8 md:pb-12", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-[0.18em] text-[clamp(3rem,11.5vw,10rem)] leading-[0.78] tracking-[-0.065em] [font-family:var(--oc-font-display)]", children: [
2494
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mb-[0.06em] inline-block w-[1.1em] shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Mark, { className: "block h-auto w-full" }) }),
2495
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "orangecheck" })
2496
- ] }) }) : null,
2601
+ signature ? /* @__PURE__ */ jsxRuntime.jsx(
2602
+ "div",
2603
+ {
2604
+ "aria-hidden": true,
2605
+ className: "oca-container select-none overflow-hidden pb-8 md:pb-12",
2606
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-[0.18em] text-[clamp(3rem,11.5vw,10rem)] leading-[0.78] tracking-[-0.065em] [font-family:var(--oc-font-display)]", children: [
2607
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mb-[0.06em] inline-block w-[1.1em] shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Mark, { className: "block h-auto w-full" }) }),
2608
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "orangecheck" })
2609
+ ] })
2610
+ }
2611
+ ) : null,
2497
2612
  meta ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oca-container", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border py-6 text-[0.875rem] text-muted-foreground", children: meta }) }) : null
2498
2613
  ] });
2499
2614
  }
@@ -2743,6 +2858,7 @@ exports.DropdownMenuSeparator = DropdownMenuSeparator;
2743
2858
  exports.DropdownMenuTrigger = DropdownMenuTrigger;
2744
2859
  exports.EmptyLine = EmptyLine;
2745
2860
  exports.EmptyState = EmptyState;
2861
+ exports.ErrorBoundary = ErrorBoundary;
2746
2862
  exports.Eyebrow = Eyebrow;
2747
2863
  exports.Field = Field;
2748
2864
  exports.FloatChip = FloatChip;