@orangecheck/design 0.29.1 → 0.30.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.
@@ -3,11 +3,11 @@ import { ChevronDown, Plus, HelpCircle, X, Check, Boxes, CornerDownLeft, Loader2
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,142 @@ 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) => /* @__PURE__ */ jsxs("li", { className: "px-4 py-2", children: [
209
+ ">> ",
210
+ a
211
+ ] }, a)) })
212
+ ] }),
213
+ /* @__PURE__ */ jsxs("div", { className: "mt-8 flex flex-wrap gap-3", children: [
214
+ /* @__PURE__ */ jsx(Button, { asChild: true, className: "font-mono", children: /* @__PURE__ */ jsx(Link7, { href: homeHref, children: /* @__PURE__ */ jsx("span", { className: "text-[11px] tracking-widest uppercase", children: "go home" }) }) }),
215
+ /* @__PURE__ */ jsx(
216
+ Button,
217
+ {
218
+ variant: "outline",
219
+ onClick: () => {
220
+ if (typeof window === "undefined") return;
221
+ if (isServerError) window.location.reload();
222
+ else window.history.back();
223
+ },
224
+ className: "font-mono",
225
+ children: /* @__PURE__ */ jsx("span", { className: "text-[11px] tracking-widest uppercase", children: isServerError ? "retry" : "go back" })
226
+ }
227
+ )
228
+ ] }),
229
+ children && /* @__PURE__ */ jsx("div", { className: "mt-6", children })
230
+ ] })
231
+ }
232
+ );
233
+ }
98
234
  var TONE_CLASS2 = {
99
235
  info: "border-primary/30 bg-primary/5",
100
236
  warning: "border-warning/40 bg-warning/5",
@@ -136,7 +272,7 @@ function CtaLink({
136
272
  if (external) {
137
273
  return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: "noreferrer", className: cls, children: text });
138
274
  }
139
- return /* @__PURE__ */ jsx(Link6, { href, className: cls, children: text });
275
+ return /* @__PURE__ */ jsx(Link7, { href, className: cls, children: text });
140
276
  }
141
277
  var TONE_CLASS3 = {
142
278
  default: "",
@@ -363,55 +499,6 @@ function MarketingHeading({
363
499
  )
364
500
  ] });
365
501
  }
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
502
  cva(
416
503
  "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
504
  {
@@ -1218,7 +1305,7 @@ function EcosystemSwitcher({
1218
1305
  /* @__PURE__ */ jsx("ul", { className: "py-1", children: [...ENTRIES, ...showOwnerEntries ? OWNER_ENTRIES : []].map((e) => {
1219
1306
  const isActive2 = e.slug === current;
1220
1307
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
1221
- Link6,
1308
+ Link7,
1222
1309
  {
1223
1310
  href: e.href,
1224
1311
  onClick: () => setOpen(false),
@@ -1239,7 +1326,7 @@ function EcosystemSwitcher({
1239
1326
  ) }, e.slug);
1240
1327
  }) }),
1241
1328
  /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2 font-mono text-[10px] tracking-widest uppercase", children: /* @__PURE__ */ jsx(
1242
- Link6,
1329
+ Link7,
1243
1330
  {
1244
1331
  href: "https://docs.ochk.io",
1245
1332
  onClick: () => setOpen(false),
@@ -1586,7 +1673,7 @@ function OcLogoDropdown({
1586
1673
  }
1587
1674
  ),
1588
1675
  /* @__PURE__ */ jsxs(
1589
- Link6,
1676
+ Link7,
1590
1677
  {
1591
1678
  href: homeHref,
1592
1679
  "aria-label": "go to " + homeHref + " (this site's home)",
@@ -1636,7 +1723,7 @@ function OcLogoDropdown({
1636
1723
  const isActive2 = e.slug === current;
1637
1724
  const href = isActive2 ? homeHref : e.origin;
1638
1725
  return /* @__PURE__ */ jsx("li", { role: "none", children: /* @__PURE__ */ jsxs(
1639
- Link6,
1726
+ Link7,
1640
1727
  {
1641
1728
  href,
1642
1729
  role: "menuitem",
@@ -1668,7 +1755,7 @@ function OcLogoDropdown({
1668
1755
  ] }, category);
1669
1756
  }) }),
1670
1757
  /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2 font-mono text-[10px] tracking-widest uppercase", children: /* @__PURE__ */ jsx(
1671
- Link6,
1758
+ Link7,
1672
1759
  {
1673
1760
  href: "https://docs.ochk.io",
1674
1761
  onClick: () => setOpen(false),
@@ -2098,7 +2185,7 @@ function MobileMenu({
2098
2185
  },
2099
2186
  l.href
2100
2187
  ) : /* @__PURE__ */ jsxs(
2101
- Link6,
2188
+ Link7,
2102
2189
  {
2103
2190
  href: l.href,
2104
2191
  role: "menuitem",
@@ -2333,7 +2420,7 @@ function OcAccountMenuView({
2333
2420
  },
2334
2421
  item.href
2335
2422
  ) : /* @__PURE__ */ jsx(
2336
- Link6,
2423
+ Link7,
2337
2424
  {
2338
2425
  href: item.href,
2339
2426
  onClick,
@@ -2554,7 +2641,7 @@ function PopoverSection({
2554
2641
  },
2555
2642
  item.href
2556
2643
  ) : /* @__PURE__ */ jsxs(
2557
- Link6,
2644
+ Link7,
2558
2645
  {
2559
2646
  href: item.href,
2560
2647
  onClick: onItemClick,
@@ -2657,7 +2744,7 @@ function OcPrimaryNav({
2657
2744
  },
2658
2745
  link.href
2659
2746
  ) : /* @__PURE__ */ jsx(
2660
- Link6,
2747
+ Link7,
2661
2748
  {
2662
2749
  href: link.href,
2663
2750
  "aria-current": active ? "page" : void 0,
@@ -2732,7 +2819,7 @@ function OcDashboardShell({
2732
2819
  }
2733
2820
  ),
2734
2821
  /* @__PURE__ */ jsx(
2735
- Link6,
2822
+ Link7,
2736
2823
  {
2737
2824
  href: rootHref,
2738
2825
  className: "text-primary font-mono text-[11px] tracking-widest uppercase",
@@ -2804,7 +2891,7 @@ function Sidebar({
2804
2891
  /* @__PURE__ */ jsxs("div", { className: "border-b px-4 py-3", children: [
2805
2892
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2806
2893
  /* @__PURE__ */ jsx(
2807
- Link6,
2894
+ Link7,
2808
2895
  {
2809
2896
  href: rootHref,
2810
2897
  onClick: onClose,
@@ -2864,7 +2951,7 @@ function Sidebar({
2864
2951
  children: content
2865
2952
  }
2866
2953
  ) : /* @__PURE__ */ jsx(
2867
- Link6,
2954
+ Link7,
2868
2955
  {
2869
2956
  href: tool.href,
2870
2957
  onClick: onClose,
@@ -2926,7 +3013,7 @@ function OcDashboardHub({ tools, className }) {
2926
3013
  className: cls,
2927
3014
  children: content
2928
3015
  }
2929
- ) : /* @__PURE__ */ jsx(Link6, { href: tool.href, className: cls, children: content }) }, tool.id);
3016
+ ) : /* @__PURE__ */ jsx(Link7, { href: tool.href, className: cls, children: content }) }, tool.id);
2930
3017
  })
2931
3018
  }
2932
3019
  );
@@ -3028,7 +3115,7 @@ function FooterLinkItem({ link }) {
3028
3115
  " \u2197"
3029
3116
  ] });
3030
3117
  }
3031
- return /* @__PURE__ */ jsxs(Link6, { href: link.href, className: LINK_CLS, children: [
3118
+ return /* @__PURE__ */ jsxs(Link7, { href: link.href, className: LINK_CLS, children: [
3032
3119
  "> ",
3033
3120
  link.label
3034
3121
  ] });
@@ -3115,6 +3202,6 @@ function OcFamilyFooter({
3115
3202
  ] }) });
3116
3203
  }
3117
3204
 
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 };
3205
+ 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
3206
  //# sourceMappingURL=components.mjs.map
3120
3207
  //# sourceMappingURL=components.mjs.map