@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.
@@ -14,6 +14,19 @@ interface SectionHeaderProps {
14
14
  }
15
15
  declare function SectionHeader({ label, meta, hint, tone, className, }: SectionHeaderProps): react_jsx_runtime.JSX.Element;
16
16
 
17
+ type OcErrorVariant = 'not-found' | 'server-error';
18
+ interface OcErrorPageProps {
19
+ variant?: OcErrorVariant;
20
+ code?: number | string;
21
+ title?: string;
22
+ detail?: string;
23
+ actions?: string[];
24
+ homeHref?: string;
25
+ children?: ReactNode;
26
+ className?: string;
27
+ }
28
+ declare function OcErrorPage({ variant, code, title, detail, actions, homeHref, children, className, }: OcErrorPageProps): react_jsx_runtime.JSX.Element;
29
+
17
30
  interface EmptyStateCta {
18
31
  label: string;
19
32
  href: string;
@@ -252,4 +265,4 @@ interface VerifiedChipProps {
252
265
  }
253
266
  declare function VerifiedChip({ icon, iconTone, label, className }: VerifiedChipProps): react_jsx_runtime.JSX.Element;
254
267
 
255
- export { AccentList, type AccentListItem, type AccentListProps, AccentNote, type AccentNoteProps, BrandBand, Callout, type CalloutProps, type CalloutTone, CheckList, type CheckListProps, type ComparisonRow, ComparisonTable, type ComparisonTableProps, DataRow, type DataRowProps, type DefinitionItem, DefinitionList, type DefinitionListProps, EmailCapture, type EmailCaptureProps, EmptyState, type EmptyStateCta, type EmptyStateProps, Faq, type FaqItem, type FaqProps, FeatureCard, type FeatureCardProps, HelpHint, type HelpHintProps, MarketingHeading, type MarketingHeadingProps, NumberedStep, type NumberedStepProps, Panel, type PanelProps, Section, SectionHeader, type SectionHeaderProps, type SectionProps, StatCard, type StatCardProps, StatGrid, type StatGridProps, type StatItem, StatTile, type Step, StepList, type StepListProps, TwoToneHeading, type TwoToneHeadingProps, VerifiedChip, type VerifiedChipProps };
268
+ export { AccentList, type AccentListItem, type AccentListProps, AccentNote, type AccentNoteProps, BrandBand, Callout, type CalloutProps, type CalloutTone, CheckList, type CheckListProps, type ComparisonRow, ComparisonTable, type ComparisonTableProps, DataRow, type DataRowProps, type DefinitionItem, DefinitionList, type DefinitionListProps, EmailCapture, type EmailCaptureProps, EmptyState, type EmptyStateCta, type EmptyStateProps, Faq, type FaqItem, type FaqProps, FeatureCard, type FeatureCardProps, HelpHint, type HelpHintProps, MarketingHeading, type MarketingHeadingProps, NumberedStep, type NumberedStepProps, OcErrorPage, type OcErrorPageProps, type OcErrorVariant, Panel, type PanelProps, Section, SectionHeader, type SectionHeaderProps, type SectionProps, StatCard, type StatCardProps, StatGrid, type StatGridProps, type StatItem, StatTile, type Step, StepList, type StepListProps, TwoToneHeading, type TwoToneHeadingProps, VerifiedChip, type VerifiedChipProps };
@@ -14,6 +14,19 @@ interface SectionHeaderProps {
14
14
  }
15
15
  declare function SectionHeader({ label, meta, hint, tone, className, }: SectionHeaderProps): react_jsx_runtime.JSX.Element;
16
16
 
17
+ type OcErrorVariant = 'not-found' | 'server-error';
18
+ interface OcErrorPageProps {
19
+ variant?: OcErrorVariant;
20
+ code?: number | string;
21
+ title?: string;
22
+ detail?: string;
23
+ actions?: string[];
24
+ homeHref?: string;
25
+ children?: ReactNode;
26
+ className?: string;
27
+ }
28
+ declare function OcErrorPage({ variant, code, title, detail, actions, homeHref, children, className, }: OcErrorPageProps): react_jsx_runtime.JSX.Element;
29
+
17
30
  interface EmptyStateCta {
18
31
  label: string;
19
32
  href: string;
@@ -252,4 +265,4 @@ interface VerifiedChipProps {
252
265
  }
253
266
  declare function VerifiedChip({ icon, iconTone, label, className }: VerifiedChipProps): react_jsx_runtime.JSX.Element;
254
267
 
255
- export { AccentList, type AccentListItem, type AccentListProps, AccentNote, type AccentNoteProps, BrandBand, Callout, type CalloutProps, type CalloutTone, CheckList, type CheckListProps, type ComparisonRow, ComparisonTable, type ComparisonTableProps, DataRow, type DataRowProps, type DefinitionItem, DefinitionList, type DefinitionListProps, EmailCapture, type EmailCaptureProps, EmptyState, type EmptyStateCta, type EmptyStateProps, Faq, type FaqItem, type FaqProps, FeatureCard, type FeatureCardProps, HelpHint, type HelpHintProps, MarketingHeading, type MarketingHeadingProps, NumberedStep, type NumberedStepProps, Panel, type PanelProps, Section, SectionHeader, type SectionHeaderProps, type SectionProps, StatCard, type StatCardProps, StatGrid, type StatGridProps, type StatItem, StatTile, type Step, StepList, type StepListProps, TwoToneHeading, type TwoToneHeadingProps, VerifiedChip, type VerifiedChipProps };
268
+ export { AccentList, type AccentListItem, type AccentListProps, AccentNote, type AccentNoteProps, BrandBand, Callout, type CalloutProps, type CalloutTone, CheckList, type CheckListProps, type ComparisonRow, ComparisonTable, type ComparisonTableProps, DataRow, type DataRowProps, type DefinitionItem, DefinitionList, type DefinitionListProps, EmailCapture, type EmailCaptureProps, EmptyState, type EmptyStateCta, type EmptyStateProps, Faq, type FaqItem, type FaqProps, FeatureCard, type FeatureCardProps, HelpHint, type HelpHintProps, MarketingHeading, type MarketingHeadingProps, NumberedStep, type NumberedStepProps, OcErrorPage, type OcErrorPageProps, type OcErrorVariant, Panel, type PanelProps, Section, SectionHeader, type SectionHeaderProps, type SectionProps, StatCard, type StatCardProps, StatGrid, type StatGridProps, type StatItem, StatTile, type Step, StepList, type StepListProps, TwoToneHeading, type TwoToneHeadingProps, VerifiedChip, type VerifiedChipProps };
@@ -6,9 +6,9 @@ var clsx = require('clsx');
6
6
  var tailwindMerge = require('tailwind-merge');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var Link = require('next/link');
9
- var React3 = require('react');
10
9
  var reactSlot = require('@radix-ui/react-slot');
11
10
  var classVarianceAuthority = require('class-variance-authority');
11
+ var React3 = require('react');
12
12
  require('@radix-ui/react-label');
13
13
  require('@radix-ui/react-checkbox');
14
14
  require('@radix-ui/react-radio-group');
@@ -119,6 +119,142 @@ function SectionHeader({
119
119
  meta && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/70 font-mono text-[10px] tracking-widest uppercase", children: meta })
120
120
  ] });
121
121
  }
122
+ var buttonVariants = classVarianceAuthority.cva(
123
+ "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",
124
+ {
125
+ variants: {
126
+ variant: {
127
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
128
+ destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
129
+ 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",
130
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
131
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
132
+ link: "text-primary underline-offset-4 hover:underline",
133
+ // For CTAs placed ON a saturated brand band or a dark section
134
+ // (e.g. a terracotta hero / footer / a forced-dark block) where
135
+ // the surface is dark+light-text in either mode. A neutral white
136
+ // pill + a translucent-white ghost read on any such surface;
137
+ // hardcoded white is deliberate (cf. destructive's text-white).
138
+ onBrand: "bg-white text-neutral-900 shadow-sm hover:bg-white/90",
139
+ onBrandOutline: "border border-white/40 bg-transparent text-white hover:bg-white/10"
140
+ },
141
+ size: {
142
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
143
+ sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
144
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
145
+ icon: "size-9"
146
+ }
147
+ },
148
+ defaultVariants: {
149
+ variant: "default",
150
+ size: "default"
151
+ }
152
+ }
153
+ );
154
+ function Button({
155
+ className,
156
+ variant,
157
+ size,
158
+ asChild = false,
159
+ ...props
160
+ }) {
161
+ const Comp = asChild ? reactSlot.Slot : "button";
162
+ return /* @__PURE__ */ jsxRuntime.jsx(
163
+ Comp,
164
+ {
165
+ "data-slot": "button",
166
+ className: cn(buttonVariants({ variant, size, className })),
167
+ ...props
168
+ }
169
+ );
170
+ }
171
+ var VARIANTS = {
172
+ "not-found": {
173
+ code: 404,
174
+ title: "no such route",
175
+ detail: "the page you're looking for doesn't exist, or has been moved.",
176
+ tone: "text-primary",
177
+ label: "not found",
178
+ actions: []
179
+ },
180
+ "server-error": {
181
+ code: 500,
182
+ title: "internal error",
183
+ detail: "something went wrong on our end.",
184
+ tone: "text-destructive",
185
+ label: "server error",
186
+ actions: [
187
+ "try refreshing the page",
188
+ "wait a few minutes, try again",
189
+ "return home and start over"
190
+ ]
191
+ }
192
+ };
193
+ function OcErrorPage({
194
+ variant = "not-found",
195
+ code,
196
+ title,
197
+ detail,
198
+ actions,
199
+ homeHref = "/",
200
+ children,
201
+ className = ""
202
+ }) {
203
+ const v = VARIANTS[variant];
204
+ const shownCode = code ?? v.code;
205
+ const shownActions = actions ?? [...v.actions];
206
+ const isServerError = variant === "server-error";
207
+ return /* @__PURE__ */ jsxRuntime.jsx(
208
+ "div",
209
+ {
210
+ className: `container flex min-h-[60vh] flex-col items-center justify-center ${className}`,
211
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full max-w-xl", children: [
212
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `label-mono mb-4 ${v.tone}`, children: [
213
+ "\xA7 ",
214
+ shownCode,
215
+ " // ",
216
+ v.label
217
+ ] }),
218
+ /* @__PURE__ */ jsxRuntime.jsx(
219
+ "h1",
220
+ {
221
+ className: `font-display text-7xl font-bold tracking-tight tabular-nums sm:text-8xl ${v.tone}`,
222
+ children: shownCode
223
+ }
224
+ ),
225
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-display mt-2 text-2xl font-bold tracking-tight sm:text-3xl", children: title ?? v.title }),
226
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground mt-3 font-mono text-xs", children: [
227
+ "// ",
228
+ detail ?? v.detail
229
+ ] }),
230
+ shownActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-8 border", children: [
231
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b px-4 py-2 font-mono text-[11px] tracking-widest uppercase", children: "what can you do" }),
232
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "divide-y font-mono text-xs", children: shownActions.map((a) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "px-4 py-2", children: [
233
+ ">> ",
234
+ a
235
+ ] }, a)) })
236
+ ] }),
237
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-8 flex flex-wrap gap-3", children: [
238
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { asChild: true, className: "font-mono", children: /* @__PURE__ */ jsxRuntime.jsx(Link__default.default, { href: homeHref, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] tracking-widest uppercase", children: "go home" }) }) }),
239
+ /* @__PURE__ */ jsxRuntime.jsx(
240
+ Button,
241
+ {
242
+ variant: "outline",
243
+ onClick: () => {
244
+ if (typeof window === "undefined") return;
245
+ if (isServerError) window.location.reload();
246
+ else window.history.back();
247
+ },
248
+ className: "font-mono",
249
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] tracking-widest uppercase", children: isServerError ? "retry" : "go back" })
250
+ }
251
+ )
252
+ ] }),
253
+ children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-6", children })
254
+ ] })
255
+ }
256
+ );
257
+ }
122
258
  var TONE_CLASS2 = {
123
259
  info: "border-primary/30 bg-primary/5",
124
260
  warning: "border-warning/40 bg-warning/5",
@@ -387,55 +523,6 @@ function MarketingHeading({
387
523
  )
388
524
  ] });
389
525
  }
390
- var buttonVariants = classVarianceAuthority.cva(
391
- "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",
392
- {
393
- variants: {
394
- variant: {
395
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
396
- destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
397
- 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",
398
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
399
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
400
- link: "text-primary underline-offset-4 hover:underline",
401
- // For CTAs placed ON a saturated brand band or a dark section
402
- // (e.g. a terracotta hero / footer / a forced-dark block) where
403
- // the surface is dark+light-text in either mode. A neutral white
404
- // pill + a translucent-white ghost read on any such surface;
405
- // hardcoded white is deliberate (cf. destructive's text-white).
406
- onBrand: "bg-white text-neutral-900 shadow-sm hover:bg-white/90",
407
- onBrandOutline: "border border-white/40 bg-transparent text-white hover:bg-white/10"
408
- },
409
- size: {
410
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
411
- sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
412
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
413
- icon: "size-9"
414
- }
415
- },
416
- defaultVariants: {
417
- variant: "default",
418
- size: "default"
419
- }
420
- }
421
- );
422
- function Button({
423
- className,
424
- variant,
425
- size,
426
- asChild = false,
427
- ...props
428
- }) {
429
- const Comp = asChild ? reactSlot.Slot : "button";
430
- return /* @__PURE__ */ jsxRuntime.jsx(
431
- Comp,
432
- {
433
- "data-slot": "button",
434
- className: cn(buttonVariants({ variant, size, className })),
435
- ...props
436
- }
437
- );
438
- }
439
526
  classVarianceAuthority.cva(
440
527
  "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",
441
528
  {
@@ -937,6 +1024,7 @@ exports.FeatureCard = FeatureCard;
937
1024
  exports.HelpHint = HelpHint;
938
1025
  exports.MarketingHeading = MarketingHeading;
939
1026
  exports.NumberedStep = NumberedStep;
1027
+ exports.OcErrorPage = OcErrorPage;
940
1028
  exports.Panel = Panel;
941
1029
  exports.Section = Section;
942
1030
  exports.SectionHeader = SectionHeader;