@orangecheck/design 0.29.1 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import * as React2 from 'react';
4
4
  import { createContext, useRef, useEffect, useState, useCallback, useMemo, useContext, useId, Fragment as Fragment$1 } from 'react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
  import { useTheme } from 'next-themes';
7
- import { ChevronDown, Plus, Palette, Check, Sun, Moon, Monitor, Waves, Pause, CheckIcon, CircleIcon, X, XIcon, AlertTriangle, Pencil, ChevronLeft, ChevronRight, ChevronDownIcon, ChevronUpIcon, Maximize2, Copy, HelpCircle, Boxes, CornerDownLeft, Loader2, Menu } from 'lucide-react';
7
+ import { ChevronDown, Plus, Palette, Check, Sun, Moon, Monitor, Waves, Pause, CheckIcon, CircleIcon, X, XIcon, AlertTriangle, Pencil, ChevronLeft, ChevronRight, ChevronDownIcon, ChevronUpIcon, Maximize2, Copy, HelpCircle, Home, RefreshCw, ArrowLeft, Boxes, CornerDownLeft, Loader2, Menu } from 'lucide-react';
8
8
  import { Slot } from '@radix-ui/react-slot';
9
9
  import { cva } from 'class-variance-authority';
10
10
  import * as LabelPrimitive from '@radix-ui/react-label';
@@ -19,7 +19,7 @@ import * as SelectPrimitive from '@radix-ui/react-select';
19
19
  import { Toaster as Toaster$1 } from 'sonner';
20
20
  import * as TabsPrimitive from '@radix-ui/react-tabs';
21
21
  import QRCode from 'qrcode';
22
- import Link6 from 'next/link';
22
+ import Link7 from 'next/link';
23
23
  import { useRouter } from 'next/router';
24
24
  import { useOcSession, fetchOcLinkedIdentities } from '@orangecheck/auth-client';
25
25
 
@@ -3173,6 +3173,104 @@ function SectionHeader({
3173
3173
  meta && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70 font-mono text-[10px] tracking-widest uppercase", children: meta })
3174
3174
  ] });
3175
3175
  }
3176
+ var VARIANTS = {
3177
+ "not-found": {
3178
+ code: 404,
3179
+ title: "no such route",
3180
+ detail: "the page you're looking for doesn't exist, or has been moved.",
3181
+ tone: "text-primary",
3182
+ label: "not found",
3183
+ actions: []
3184
+ },
3185
+ "server-error": {
3186
+ code: 500,
3187
+ title: "internal error",
3188
+ detail: "something went wrong on our end.",
3189
+ tone: "text-destructive",
3190
+ label: "server error",
3191
+ actions: [
3192
+ "try refreshing the page",
3193
+ "wait a few minutes, try again",
3194
+ "return home and start over"
3195
+ ]
3196
+ }
3197
+ };
3198
+ function OcErrorPage({
3199
+ variant = "not-found",
3200
+ code,
3201
+ title,
3202
+ detail,
3203
+ actions,
3204
+ homeHref = "/",
3205
+ children,
3206
+ className = ""
3207
+ }) {
3208
+ const v = VARIANTS[variant];
3209
+ const shownCode = code ?? v.code;
3210
+ const shownActions = actions ?? [...v.actions];
3211
+ const isServerError = variant === "server-error";
3212
+ return /* @__PURE__ */ jsx(
3213
+ "div",
3214
+ {
3215
+ className: `container flex min-h-[60vh] flex-col items-center justify-center ${className}`,
3216
+ children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-xl", children: [
3217
+ /* @__PURE__ */ jsxs("div", { className: `label-mono mb-4 ${v.tone}`, children: [
3218
+ "\xA7 ",
3219
+ shownCode,
3220
+ " // ",
3221
+ v.label
3222
+ ] }),
3223
+ /* @__PURE__ */ jsx(
3224
+ "h1",
3225
+ {
3226
+ className: `font-display text-7xl font-bold tracking-tight tabular-nums sm:text-8xl ${v.tone}`,
3227
+ children: shownCode
3228
+ }
3229
+ ),
3230
+ /* @__PURE__ */ jsx("h2", { className: "font-display mt-2 text-2xl font-bold tracking-tight sm:text-3xl", children: title ?? v.title }),
3231
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground mt-3 font-mono text-xs", children: [
3232
+ "// ",
3233
+ detail ?? v.detail
3234
+ ] }),
3235
+ shownActions.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-8 border", children: [
3236
+ /* @__PURE__ */ jsx("div", { className: "border-b px-4 py-2 font-mono text-[11px] tracking-widest uppercase", children: "what can you do" }),
3237
+ /* @__PURE__ */ jsx("ul", { className: "divide-y font-mono text-xs", children: shownActions.map((a, i) => (
3238
+ // Index keys: items are nodes and the list is
3239
+ // static per variant, so there is nothing
3240
+ // better to key on and nothing reorders.
3241
+ /* @__PURE__ */ jsxs("li", { className: "px-4 py-2", children: [
3242
+ ">> ",
3243
+ a
3244
+ ] }, i)
3245
+ )) })
3246
+ ] }),
3247
+ /* @__PURE__ */ jsxs("div", { className: "mt-8 flex flex-wrap gap-3", children: [
3248
+ /* @__PURE__ */ jsx(Button, { asChild: true, className: "font-mono", children: /* @__PURE__ */ jsxs(Link7, { href: homeHref, children: [
3249
+ /* @__PURE__ */ jsx(Home, { className: "mr-2 h-3 w-3" }),
3250
+ /* @__PURE__ */ jsx("span", { className: "text-[11px] tracking-widest uppercase", children: "go home" })
3251
+ ] }) }),
3252
+ /* @__PURE__ */ jsxs(
3253
+ Button,
3254
+ {
3255
+ variant: "outline",
3256
+ onClick: () => {
3257
+ if (typeof window === "undefined") return;
3258
+ if (isServerError) window.location.reload();
3259
+ else window.history.back();
3260
+ },
3261
+ className: "font-mono",
3262
+ children: [
3263
+ isServerError ? /* @__PURE__ */ jsx(RefreshCw, { className: "mr-2 h-3 w-3" }) : /* @__PURE__ */ jsx(ArrowLeft, { className: "mr-2 h-3 w-3" }),
3264
+ /* @__PURE__ */ jsx("span", { className: "text-[11px] tracking-widest uppercase", children: isServerError ? "retry" : "go back" })
3265
+ ]
3266
+ }
3267
+ )
3268
+ ] }),
3269
+ children && /* @__PURE__ */ jsx("div", { className: "mt-6", children })
3270
+ ] })
3271
+ }
3272
+ );
3273
+ }
3176
3274
  var TONE_CLASS2 = {
3177
3275
  info: "border-primary/30 bg-primary/5",
3178
3276
  warning: "border-warning/40 bg-warning/5",
@@ -3214,7 +3312,7 @@ function CtaLink({
3214
3312
  if (external) {
3215
3313
  return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: "noreferrer", className: cls, children: text });
3216
3314
  }
3217
- return /* @__PURE__ */ jsx(Link6, { href, className: cls, children: text });
3315
+ return /* @__PURE__ */ jsx(Link7, { href, className: cls, children: text });
3218
3316
  }
3219
3317
  var TONE_CLASS3 = {
3220
3318
  default: "",
@@ -3898,7 +3996,7 @@ function EcosystemSwitcher({
3898
3996
  /* @__PURE__ */ jsx("ul", { className: "py-1", children: [...ENTRIES, ...showOwnerEntries ? OWNER_ENTRIES : []].map((e) => {
3899
3997
  const isActive2 = e.slug === current;
3900
3998
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
3901
- Link6,
3999
+ Link7,
3902
4000
  {
3903
4001
  href: e.href,
3904
4002
  onClick: () => setOpen(false),
@@ -3919,7 +4017,7 @@ function EcosystemSwitcher({
3919
4017
  ) }, e.slug);
3920
4018
  }) }),
3921
4019
  /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2 font-mono text-[10px] tracking-widest uppercase", children: /* @__PURE__ */ jsx(
3922
- Link6,
4020
+ Link7,
3923
4021
  {
3924
4022
  href: "https://docs.ochk.io",
3925
4023
  onClick: () => setOpen(false),
@@ -4266,7 +4364,7 @@ function OcLogoDropdown({
4266
4364
  }
4267
4365
  ),
4268
4366
  /* @__PURE__ */ jsxs(
4269
- Link6,
4367
+ Link7,
4270
4368
  {
4271
4369
  href: homeHref,
4272
4370
  "aria-label": "go to " + homeHref + " (this site's home)",
@@ -4316,7 +4414,7 @@ function OcLogoDropdown({
4316
4414
  const isActive2 = e.slug === current;
4317
4415
  const href = isActive2 ? homeHref : e.origin;
4318
4416
  return /* @__PURE__ */ jsx("li", { role: "none", children: /* @__PURE__ */ jsxs(
4319
- Link6,
4417
+ Link7,
4320
4418
  {
4321
4419
  href,
4322
4420
  role: "menuitem",
@@ -4348,7 +4446,7 @@ function OcLogoDropdown({
4348
4446
  ] }, category);
4349
4447
  }) }),
4350
4448
  /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2 font-mono text-[10px] tracking-widest uppercase", children: /* @__PURE__ */ jsx(
4351
- Link6,
4449
+ Link7,
4352
4450
  {
4353
4451
  href: "https://docs.ochk.io",
4354
4452
  onClick: () => setOpen(false),
@@ -4678,7 +4776,7 @@ function MobileMenu({
4678
4776
  },
4679
4777
  l.href
4680
4778
  ) : /* @__PURE__ */ jsxs(
4681
- Link6,
4779
+ Link7,
4682
4780
  {
4683
4781
  href: l.href,
4684
4782
  role: "menuitem",
@@ -4913,7 +5011,7 @@ function OcAccountMenuView({
4913
5011
  },
4914
5012
  item.href
4915
5013
  ) : /* @__PURE__ */ jsx(
4916
- Link6,
5014
+ Link7,
4917
5015
  {
4918
5016
  href: item.href,
4919
5017
  onClick,
@@ -5134,7 +5232,7 @@ function PopoverSection({
5134
5232
  },
5135
5233
  item.href
5136
5234
  ) : /* @__PURE__ */ jsxs(
5137
- Link6,
5235
+ Link7,
5138
5236
  {
5139
5237
  href: item.href,
5140
5238
  onClick: onItemClick,
@@ -5237,7 +5335,7 @@ function OcPrimaryNav({
5237
5335
  },
5238
5336
  link.href
5239
5337
  ) : /* @__PURE__ */ jsx(
5240
- Link6,
5338
+ Link7,
5241
5339
  {
5242
5340
  href: link.href,
5243
5341
  "aria-current": active ? "page" : void 0,
@@ -5312,7 +5410,7 @@ function OcDashboardShell({
5312
5410
  }
5313
5411
  ),
5314
5412
  /* @__PURE__ */ jsx(
5315
- Link6,
5413
+ Link7,
5316
5414
  {
5317
5415
  href: rootHref,
5318
5416
  className: "text-primary font-mono text-[11px] tracking-widest uppercase",
@@ -5384,7 +5482,7 @@ function Sidebar({
5384
5482
  /* @__PURE__ */ jsxs("div", { className: "border-b px-4 py-3", children: [
5385
5483
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
5386
5484
  /* @__PURE__ */ jsx(
5387
- Link6,
5485
+ Link7,
5388
5486
  {
5389
5487
  href: rootHref,
5390
5488
  onClick: onClose,
@@ -5444,7 +5542,7 @@ function Sidebar({
5444
5542
  children: content
5445
5543
  }
5446
5544
  ) : /* @__PURE__ */ jsx(
5447
- Link6,
5545
+ Link7,
5448
5546
  {
5449
5547
  href: tool.href,
5450
5548
  onClick: onClose,
@@ -5506,7 +5604,7 @@ function OcDashboardHub({ tools, className }) {
5506
5604
  className: cls,
5507
5605
  children: content
5508
5606
  }
5509
- ) : /* @__PURE__ */ jsx(Link6, { href: tool.href, className: cls, children: content }) }, tool.id);
5607
+ ) : /* @__PURE__ */ jsx(Link7, { href: tool.href, className: cls, children: content }) }, tool.id);
5510
5608
  })
5511
5609
  }
5512
5610
  );
@@ -5608,7 +5706,7 @@ function FooterLinkItem({ link }) {
5608
5706
  " \u2197"
5609
5707
  ] });
5610
5708
  }
5611
- return /* @__PURE__ */ jsxs(Link6, { href: link.href, className: LINK_CLS, children: [
5709
+ return /* @__PURE__ */ jsxs(Link7, { href: link.href, className: LINK_CLS, children: [
5612
5710
  "> ",
5613
5711
  link.label
5614
5712
  ] });
@@ -5695,6 +5793,6 @@ function OcFamilyFooter({
5695
5793
  ] }) });
5696
5794
  }
5697
5795
 
5698
- export { AccentList, AccentNote, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, AppShell, AppearanceControls, Badge, Bar, BitcoinAddress, BrandBand, Button, Callout, Card, CheckList, Checkbox, ComparisonTable, ConfirmHost, CopyButton, DEFAULT_OC_THEME, DataRow, DefinitionList, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EcosystemSwitcher, EmailCapture, EmptyState, ErrorBoundary, FAMILY_PROPERTIES, Faq, FeatureCard, HelpHint, IconBadge, Input, Label, LayoutSubHeader, MarketingHeading, Modal, NumberedStep, OC_DEFAULT_ACCENT, OC_GLYPHS, OC_GLYPH_CANVAS, OC_MOTION_COOKIE, OC_SKIN_COOKIE, OC_THEMES, OcAccountMenu, OcAccountMenuView, OcAppBar, OcAppearanceMenu, OcAurora, OcDashboardHub, OcDashboardShell, OcFamilyFooter, OcLogoDropdown, OcPrimaryNav, OcSigil, OcThemeBridge, OcThemePicker, OcThemeProvider, Pagination, Panel, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, REFERENCE_BTC_USD, RadioGroup, RadioGroupItem, SITE_STATE_LABEL, SatsAmount, Section, SectionHeader, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatCard, StatGrid, StatTile, StatusPill, StepList, Surface, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Tooltip, TwoToneHeading, VerifiedChip, Working, WorkingPanel, accentFor, asOf, badgeVariants, buttonVariants, cn, confirm, explorerUrl, findFamilyProperty, formatSats, formatSatsCompact, getOcThemeInitScript, iconBadgeVariants, isKnownTheme, makeStatusPill, normalizeHue, priceBoth, prompt, readOcSceneTokens, relativeTime, resolveTheme, satsToUsd, shortenAddress, subscribeOcTheme, surfaceVariants, usdToSats, useOcMotion, useOcSkin, useSpotPrice };
5796
+ export { AccentList, AccentNote, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, AppShell, AppearanceControls, Badge, Bar, BitcoinAddress, BrandBand, Button, Callout, Card, CheckList, Checkbox, ComparisonTable, ConfirmHost, CopyButton, DEFAULT_OC_THEME, DataRow, DefinitionList, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EcosystemSwitcher, EmailCapture, EmptyState, ErrorBoundary, FAMILY_PROPERTIES, Faq, FeatureCard, HelpHint, IconBadge, Input, Label, LayoutSubHeader, MarketingHeading, Modal, NumberedStep, OC_DEFAULT_ACCENT, OC_GLYPHS, OC_GLYPH_CANVAS, OC_MOTION_COOKIE, OC_SKIN_COOKIE, OC_THEMES, OcAccountMenu, OcAccountMenuView, OcAppBar, OcAppearanceMenu, OcAurora, OcDashboardHub, OcDashboardShell, OcErrorPage, OcFamilyFooter, OcLogoDropdown, OcPrimaryNav, OcSigil, OcThemeBridge, OcThemePicker, OcThemeProvider, Pagination, Panel, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, REFERENCE_BTC_USD, RadioGroup, RadioGroupItem, SITE_STATE_LABEL, SatsAmount, Section, SectionHeader, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatCard, StatGrid, StatTile, StatusPill, StepList, Surface, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Tooltip, TwoToneHeading, VerifiedChip, Working, WorkingPanel, accentFor, asOf, badgeVariants, buttonVariants, cn, confirm, explorerUrl, findFamilyProperty, formatSats, formatSatsCompact, getOcThemeInitScript, iconBadgeVariants, isKnownTheme, makeStatusPill, normalizeHue, priceBoth, prompt, readOcSceneTokens, relativeTime, resolveTheme, satsToUsd, shortenAddress, subscribeOcTheme, surfaceVariants, usdToSats, useOcMotion, useOcSkin, useSpotPrice };
5699
5797
  //# sourceMappingURL=index.mjs.map
5700
5798
  //# sourceMappingURL=index.mjs.map