@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.
@@ -1,13 +1,13 @@
1
1
  import * as Popover from '@radix-ui/react-popover';
2
- import { ChevronDown, Plus, HelpCircle, X, Check, Boxes, CornerDownLeft, Loader2, Copy, Menu, Sun, Moon, Monitor, Waves, Pause } from 'lucide-react';
2
+ import { ChevronDown, Plus, HelpCircle, Home, RefreshCw, ArrowLeft, X, Check, Boxes, CornerDownLeft, Loader2, Copy, Menu, Sun, Moon, Monitor, Waves, Pause } from 'lucide-react';
3
3
  import { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
6
- import Link6 from 'next/link';
7
- import * as React2 from 'react';
8
- import { createContext, Fragment, useState, useRef, useEffect, useId, useContext } from 'react';
6
+ import Link7 from 'next/link';
9
7
  import { Slot } from '@radix-ui/react-slot';
10
8
  import { cva } from 'class-variance-authority';
9
+ import * as React2 from 'react';
10
+ import { createContext, Fragment, useState, useRef, useEffect, useId, useContext } from 'react';
11
11
  import '@radix-ui/react-label';
12
12
  import '@radix-ui/react-checkbox';
13
13
  import '@radix-ui/react-radio-group';
@@ -95,6 +95,153 @@ function SectionHeader({
95
95
  meta && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70 font-mono text-[10px] tracking-widest uppercase", children: meta })
96
96
  ] });
97
97
  }
98
+ var buttonVariants = cva(
99
+ "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",
100
+ {
101
+ variants: {
102
+ variant: {
103
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
104
+ destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
105
+ 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",
106
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
107
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
108
+ link: "text-primary underline-offset-4 hover:underline",
109
+ // For CTAs placed ON a saturated brand band or a dark section
110
+ // (e.g. a terracotta hero / footer / a forced-dark block) where
111
+ // the surface is dark+light-text in either mode. A neutral white
112
+ // pill + a translucent-white ghost read on any such surface;
113
+ // hardcoded white is deliberate (cf. destructive's text-white).
114
+ onBrand: "bg-white text-neutral-900 shadow-sm hover:bg-white/90",
115
+ onBrandOutline: "border border-white/40 bg-transparent text-white hover:bg-white/10"
116
+ },
117
+ size: {
118
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
119
+ sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
120
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
121
+ icon: "size-9"
122
+ }
123
+ },
124
+ defaultVariants: {
125
+ variant: "default",
126
+ size: "default"
127
+ }
128
+ }
129
+ );
130
+ function Button({
131
+ className,
132
+ variant,
133
+ size,
134
+ asChild = false,
135
+ ...props
136
+ }) {
137
+ const Comp = asChild ? Slot : "button";
138
+ return /* @__PURE__ */ jsx(
139
+ Comp,
140
+ {
141
+ "data-slot": "button",
142
+ className: cn(buttonVariants({ variant, size, className })),
143
+ ...props
144
+ }
145
+ );
146
+ }
147
+ var VARIANTS = {
148
+ "not-found": {
149
+ code: 404,
150
+ title: "no such route",
151
+ detail: "the page you're looking for doesn't exist, or has been moved.",
152
+ tone: "text-primary",
153
+ label: "not found",
154
+ actions: []
155
+ },
156
+ "server-error": {
157
+ code: 500,
158
+ title: "internal error",
159
+ detail: "something went wrong on our end.",
160
+ tone: "text-destructive",
161
+ label: "server error",
162
+ actions: [
163
+ "try refreshing the page",
164
+ "wait a few minutes, try again",
165
+ "return home and start over"
166
+ ]
167
+ }
168
+ };
169
+ function OcErrorPage({
170
+ variant = "not-found",
171
+ code,
172
+ title,
173
+ detail,
174
+ actions,
175
+ homeHref = "/",
176
+ children,
177
+ className = ""
178
+ }) {
179
+ const v = VARIANTS[variant];
180
+ const shownCode = code ?? v.code;
181
+ const shownActions = actions ?? [...v.actions];
182
+ const isServerError = variant === "server-error";
183
+ return /* @__PURE__ */ jsx(
184
+ "div",
185
+ {
186
+ className: `container flex min-h-[60vh] flex-col items-center justify-center ${className}`,
187
+ children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-xl", children: [
188
+ /* @__PURE__ */ jsxs("div", { className: `label-mono mb-4 ${v.tone}`, children: [
189
+ "\xA7 ",
190
+ shownCode,
191
+ " // ",
192
+ v.label
193
+ ] }),
194
+ /* @__PURE__ */ jsx(
195
+ "h1",
196
+ {
197
+ className: `font-display text-7xl font-bold tracking-tight tabular-nums sm:text-8xl ${v.tone}`,
198
+ children: shownCode
199
+ }
200
+ ),
201
+ /* @__PURE__ */ jsx("h2", { className: "font-display mt-2 text-2xl font-bold tracking-tight sm:text-3xl", children: title ?? v.title }),
202
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground mt-3 font-mono text-xs", children: [
203
+ "// ",
204
+ detail ?? v.detail
205
+ ] }),
206
+ shownActions.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-8 border", children: [
207
+ /* @__PURE__ */ jsx("div", { className: "border-b px-4 py-2 font-mono text-[11px] tracking-widest uppercase", children: "what can you do" }),
208
+ /* @__PURE__ */ jsx("ul", { className: "divide-y font-mono text-xs", children: shownActions.map((a, i) => (
209
+ // Index keys: items are nodes and the list is
210
+ // static per variant, so there is nothing
211
+ // better to key on and nothing reorders.
212
+ /* @__PURE__ */ jsxs("li", { className: "px-4 py-2", children: [
213
+ ">> ",
214
+ a
215
+ ] }, i)
216
+ )) })
217
+ ] }),
218
+ /* @__PURE__ */ jsxs("div", { className: "mt-8 flex flex-wrap gap-3", children: [
219
+ /* @__PURE__ */ jsx(Button, { asChild: true, className: "font-mono", children: /* @__PURE__ */ jsxs(Link7, { href: homeHref, children: [
220
+ /* @__PURE__ */ jsx(Home, { className: "mr-2 h-3 w-3" }),
221
+ /* @__PURE__ */ jsx("span", { className: "text-[11px] tracking-widest uppercase", children: "go home" })
222
+ ] }) }),
223
+ /* @__PURE__ */ jsxs(
224
+ Button,
225
+ {
226
+ variant: "outline",
227
+ onClick: () => {
228
+ if (typeof window === "undefined") return;
229
+ if (isServerError) window.location.reload();
230
+ else window.history.back();
231
+ },
232
+ className: "font-mono",
233
+ children: [
234
+ isServerError ? /* @__PURE__ */ jsx(RefreshCw, { className: "mr-2 h-3 w-3" }) : /* @__PURE__ */ jsx(ArrowLeft, { className: "mr-2 h-3 w-3" }),
235
+ /* @__PURE__ */ jsx("span", { className: "text-[11px] tracking-widest uppercase", children: isServerError ? "retry" : "go back" })
236
+ ]
237
+ }
238
+ )
239
+ ] }),
240
+ children && /* @__PURE__ */ jsx("div", { className: "mt-6", children })
241
+ ] })
242
+ }
243
+ );
244
+ }
98
245
  var TONE_CLASS2 = {
99
246
  info: "border-primary/30 bg-primary/5",
100
247
  warning: "border-warning/40 bg-warning/5",
@@ -136,7 +283,7 @@ function CtaLink({
136
283
  if (external) {
137
284
  return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: "noreferrer", className: cls, children: text });
138
285
  }
139
- return /* @__PURE__ */ jsx(Link6, { href, className: cls, children: text });
286
+ return /* @__PURE__ */ jsx(Link7, { href, className: cls, children: text });
140
287
  }
141
288
  var TONE_CLASS3 = {
142
289
  default: "",
@@ -363,55 +510,6 @@ function MarketingHeading({
363
510
  )
364
511
  ] });
365
512
  }
366
- var buttonVariants = cva(
367
- "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",
368
- {
369
- variants: {
370
- variant: {
371
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
372
- destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
373
- 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",
374
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
375
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
376
- link: "text-primary underline-offset-4 hover:underline",
377
- // For CTAs placed ON a saturated brand band or a dark section
378
- // (e.g. a terracotta hero / footer / a forced-dark block) where
379
- // the surface is dark+light-text in either mode. A neutral white
380
- // pill + a translucent-white ghost read on any such surface;
381
- // hardcoded white is deliberate (cf. destructive's text-white).
382
- onBrand: "bg-white text-neutral-900 shadow-sm hover:bg-white/90",
383
- onBrandOutline: "border border-white/40 bg-transparent text-white hover:bg-white/10"
384
- },
385
- size: {
386
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
387
- sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
388
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
389
- icon: "size-9"
390
- }
391
- },
392
- defaultVariants: {
393
- variant: "default",
394
- size: "default"
395
- }
396
- }
397
- );
398
- function Button({
399
- className,
400
- variant,
401
- size,
402
- asChild = false,
403
- ...props
404
- }) {
405
- const Comp = asChild ? Slot : "button";
406
- return /* @__PURE__ */ jsx(
407
- Comp,
408
- {
409
- "data-slot": "button",
410
- className: cn(buttonVariants({ variant, size, className })),
411
- ...props
412
- }
413
- );
414
- }
415
513
  cva(
416
514
  "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",
417
515
  {
@@ -1218,7 +1316,7 @@ function EcosystemSwitcher({
1218
1316
  /* @__PURE__ */ jsx("ul", { className: "py-1", children: [...ENTRIES, ...showOwnerEntries ? OWNER_ENTRIES : []].map((e) => {
1219
1317
  const isActive2 = e.slug === current;
1220
1318
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
1221
- Link6,
1319
+ Link7,
1222
1320
  {
1223
1321
  href: e.href,
1224
1322
  onClick: () => setOpen(false),
@@ -1239,7 +1337,7 @@ function EcosystemSwitcher({
1239
1337
  ) }, e.slug);
1240
1338
  }) }),
1241
1339
  /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2 font-mono text-[10px] tracking-widest uppercase", children: /* @__PURE__ */ jsx(
1242
- Link6,
1340
+ Link7,
1243
1341
  {
1244
1342
  href: "https://docs.ochk.io",
1245
1343
  onClick: () => setOpen(false),
@@ -1586,7 +1684,7 @@ function OcLogoDropdown({
1586
1684
  }
1587
1685
  ),
1588
1686
  /* @__PURE__ */ jsxs(
1589
- Link6,
1687
+ Link7,
1590
1688
  {
1591
1689
  href: homeHref,
1592
1690
  "aria-label": "go to " + homeHref + " (this site's home)",
@@ -1636,7 +1734,7 @@ function OcLogoDropdown({
1636
1734
  const isActive2 = e.slug === current;
1637
1735
  const href = isActive2 ? homeHref : e.origin;
1638
1736
  return /* @__PURE__ */ jsx("li", { role: "none", children: /* @__PURE__ */ jsxs(
1639
- Link6,
1737
+ Link7,
1640
1738
  {
1641
1739
  href,
1642
1740
  role: "menuitem",
@@ -1668,7 +1766,7 @@ function OcLogoDropdown({
1668
1766
  ] }, category);
1669
1767
  }) }),
1670
1768
  /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2 font-mono text-[10px] tracking-widest uppercase", children: /* @__PURE__ */ jsx(
1671
- Link6,
1769
+ Link7,
1672
1770
  {
1673
1771
  href: "https://docs.ochk.io",
1674
1772
  onClick: () => setOpen(false),
@@ -2098,7 +2196,7 @@ function MobileMenu({
2098
2196
  },
2099
2197
  l.href
2100
2198
  ) : /* @__PURE__ */ jsxs(
2101
- Link6,
2199
+ Link7,
2102
2200
  {
2103
2201
  href: l.href,
2104
2202
  role: "menuitem",
@@ -2333,7 +2431,7 @@ function OcAccountMenuView({
2333
2431
  },
2334
2432
  item.href
2335
2433
  ) : /* @__PURE__ */ jsx(
2336
- Link6,
2434
+ Link7,
2337
2435
  {
2338
2436
  href: item.href,
2339
2437
  onClick,
@@ -2554,7 +2652,7 @@ function PopoverSection({
2554
2652
  },
2555
2653
  item.href
2556
2654
  ) : /* @__PURE__ */ jsxs(
2557
- Link6,
2655
+ Link7,
2558
2656
  {
2559
2657
  href: item.href,
2560
2658
  onClick: onItemClick,
@@ -2657,7 +2755,7 @@ function OcPrimaryNav({
2657
2755
  },
2658
2756
  link.href
2659
2757
  ) : /* @__PURE__ */ jsx(
2660
- Link6,
2758
+ Link7,
2661
2759
  {
2662
2760
  href: link.href,
2663
2761
  "aria-current": active ? "page" : void 0,
@@ -2732,7 +2830,7 @@ function OcDashboardShell({
2732
2830
  }
2733
2831
  ),
2734
2832
  /* @__PURE__ */ jsx(
2735
- Link6,
2833
+ Link7,
2736
2834
  {
2737
2835
  href: rootHref,
2738
2836
  className: "text-primary font-mono text-[11px] tracking-widest uppercase",
@@ -2804,7 +2902,7 @@ function Sidebar({
2804
2902
  /* @__PURE__ */ jsxs("div", { className: "border-b px-4 py-3", children: [
2805
2903
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2806
2904
  /* @__PURE__ */ jsx(
2807
- Link6,
2905
+ Link7,
2808
2906
  {
2809
2907
  href: rootHref,
2810
2908
  onClick: onClose,
@@ -2864,7 +2962,7 @@ function Sidebar({
2864
2962
  children: content
2865
2963
  }
2866
2964
  ) : /* @__PURE__ */ jsx(
2867
- Link6,
2965
+ Link7,
2868
2966
  {
2869
2967
  href: tool.href,
2870
2968
  onClick: onClose,
@@ -2926,7 +3024,7 @@ function OcDashboardHub({ tools, className }) {
2926
3024
  className: cls,
2927
3025
  children: content
2928
3026
  }
2929
- ) : /* @__PURE__ */ jsx(Link6, { href: tool.href, className: cls, children: content }) }, tool.id);
3027
+ ) : /* @__PURE__ */ jsx(Link7, { href: tool.href, className: cls, children: content }) }, tool.id);
2930
3028
  })
2931
3029
  }
2932
3030
  );
@@ -3028,7 +3126,7 @@ function FooterLinkItem({ link }) {
3028
3126
  " \u2197"
3029
3127
  ] });
3030
3128
  }
3031
- return /* @__PURE__ */ jsxs(Link6, { href: link.href, className: LINK_CLS, children: [
3129
+ return /* @__PURE__ */ jsxs(Link7, { href: link.href, className: LINK_CLS, children: [
3032
3130
  "> ",
3033
3131
  link.label
3034
3132
  ] });
@@ -3115,6 +3213,6 @@ function OcFamilyFooter({
3115
3213
  ] }) });
3116
3214
  }
3117
3215
 
3118
- 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, OcFamilyFooter, OcLogoDropdown, OcPrimaryNav, Panel, SITE_STATE_LABEL, Section, SectionHeader, StatCard, StatGrid, StatTile, StepList, TwoToneHeading, VerifiedChip, findFamilyProperty };
3216
+ 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, OcErrorPage, OcFamilyFooter, OcLogoDropdown, OcPrimaryNav, Panel, SITE_STATE_LABEL, Section, SectionHeader, StatCard, StatGrid, StatTile, StepList, TwoToneHeading, VerifiedChip, findFamilyProperty };
3119
3217
  //# sourceMappingURL=components.mjs.map
3120
3218
  //# sourceMappingURL=components.mjs.map