@atelic-action/ui 7.2.0 → 8.1.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.
Files changed (131) hide show
  1. package/README.md +439 -132
  2. package/bin/atelic-check-sentry.ts +5 -0
  3. package/dist/gate/middleware.js +15 -1
  4. package/dist/monitoring/server.d.ts +72 -0
  5. package/dist/monitoring/server.js +201 -0
  6. package/dist/vite/index.d.ts +1 -1
  7. package/dist/vite/index.js +1 -1
  8. package/dist/vite/marketing-config.d.ts +28 -1
  9. package/dist/vite/marketing-config.js +62 -0
  10. package/package.json +23 -11
  11. package/src/app/ErrorFallback.tsx +6 -2
  12. package/src/app/context/AppContext.tsx +10 -1
  13. package/src/app/index.ts +0 -1
  14. package/src/app/layout/AppPage.tsx +36 -7
  15. package/src/app/layout/DesktopRail.tsx +15 -6
  16. package/src/app/layout/MobileMenu.tsx +14 -5
  17. package/src/app/layout/MobileTabBar.tsx +3 -2
  18. package/src/app/layout/PageError.tsx +7 -4
  19. package/src/app/layout/PageSkeleton.tsx +33 -26
  20. package/src/app/layout/SectionCards.tsx +7 -2
  21. package/src/app/layout/UserMenu.tsx +13 -7
  22. package/src/app/ui/alert.tsx +42 -12
  23. package/src/app/ui/badge.tsx +1 -1
  24. package/src/app/ui/button.tsx +2 -1
  25. package/src/app/ui/command.tsx +86 -21
  26. package/src/app/ui/country-dropdown.tsx +26 -47
  27. package/src/app/ui/form.tsx +48 -9
  28. package/src/app/ui/pagination.tsx +1 -1
  29. package/src/app/ui/progress.tsx +26 -12
  30. package/src/app/ui/search-input.tsx +16 -3
  31. package/src/app/ui/select.tsx +8 -3
  32. package/src/app/ui/slider.tsx +62 -15
  33. package/src/artifact/AppErrorBoundary.tsx +12 -7
  34. package/src/artifact/ArtifactShell.tsx +5 -1
  35. package/src/artifact/ErrorFallback.tsx +8 -1
  36. package/src/artifact/artifactConfig.ts +1 -1
  37. package/src/chrome/BrandLockup.tsx +102 -17
  38. package/src/chrome/ClosingBar.tsx +5 -3
  39. package/src/chrome/ContactDock.tsx +361 -0
  40. package/src/chrome/Footer.tsx +126 -31
  41. package/src/chrome/NavBadge.tsx +8 -0
  42. package/src/chrome/NavMegaPanel.tsx +399 -0
  43. package/src/chrome/SiteHeader.tsx +268 -23
  44. package/src/chrome/SiteMenu.tsx +200 -19
  45. package/src/chrome/SiteShell.tsx +151 -14
  46. package/src/chrome/StickyCTABar.tsx +60 -2
  47. package/src/chrome/brandMark.ts +56 -0
  48. package/src/chrome/icons.ts +58 -0
  49. package/src/chrome/index.ts +16 -0
  50. package/src/chrome/navSections.ts +55 -0
  51. package/src/components/ColumnChart.tsx +27 -2
  52. package/src/components/DataTable.tsx +104 -85
  53. package/src/components/Disclosure.tsx +3 -1
  54. package/src/components/Hint.tsx +3 -24
  55. package/src/components/NotFound.tsx +7 -3
  56. package/src/components/StarRating.tsx +45 -19
  57. package/src/components/ThresholdScale.tsx +36 -26
  58. package/src/email/atoms.tsx +13 -57
  59. package/src/email/frame.tsx +4 -6
  60. package/src/email/index.ts +4 -10
  61. package/src/email/scoreboard.tsx +107 -186
  62. package/src/email/text.ts +30 -0
  63. package/src/email/theme.tsx +76 -9
  64. package/src/gate/middleware.ts +15 -1
  65. package/src/hooks/useDismiss.ts +39 -0
  66. package/src/lib/emailText.tsx +26 -0
  67. package/src/lib/phoneText.tsx +40 -0
  68. package/src/lib/useScrollsSideways.ts +26 -0
  69. package/src/monitoring/ErrorCatcherScript.tsx +15 -0
  70. package/src/monitoring/catcher.ts +118 -0
  71. package/src/monitoring/index.ts +25 -0
  72. package/src/monitoring/sdk.ts +112 -0
  73. package/src/monitoring/server.ts +244 -0
  74. package/src/monitoring/start.ts +118 -0
  75. package/src/primitives/Button.tsx +5 -1
  76. package/src/primitives/Eyebrow.tsx +6 -2
  77. package/src/primitives/ProseBlocks.tsx +6 -1
  78. package/src/primitives/SectionHeading.tsx +3 -1
  79. package/src/primitives/StarRow.tsx +23 -8
  80. package/src/routing/index.ts +1 -0
  81. package/src/routing/miss.ts +32 -0
  82. package/src/scripts/check-sentry.ts +77 -0
  83. package/src/sections/BlogIndex.tsx +17 -3
  84. package/src/sections/BlogPost.tsx +10 -1
  85. package/src/sections/CTASection.tsx +2 -2
  86. package/src/sections/CalloutPanel.tsx +34 -0
  87. package/src/sections/ComparisonTable.tsx +23 -2
  88. package/src/sections/ContactForm.tsx +61 -17
  89. package/src/sections/FAQBrowser.tsx +11 -2
  90. package/src/sections/FeatureGrid.tsx +6 -2
  91. package/src/sections/FullBleedVideo.tsx +167 -0
  92. package/src/sections/Gallery.tsx +6 -4
  93. package/src/sections/Hero.tsx +70 -39
  94. package/src/sections/JumpRail.tsx +7 -0
  95. package/src/sections/LegalPage.tsx +10 -2
  96. package/src/sections/LinkColumns.tsx +80 -0
  97. package/src/sections/LocationSection.tsx +28 -5
  98. package/src/sections/Locations.tsx +18 -5
  99. package/src/sections/LogoMarquee.tsx +43 -11
  100. package/src/sections/MapEmbed.tsx +13 -9
  101. package/src/sections/PageHero.tsx +16 -2
  102. package/src/sections/ProcessSteps.tsx +27 -4
  103. package/src/sections/ProfileCards.tsx +12 -2
  104. package/src/sections/ProofStrip.tsx +44 -0
  105. package/src/sections/RevealSlider.tsx +28 -7
  106. package/src/sections/ReviewCarousel.tsx +17 -4
  107. package/src/sections/ReviewWall.tsx +2 -2
  108. package/src/sections/SplitSection.tsx +2 -1
  109. package/src/sections/index.ts +15 -6
  110. package/src/sections/siteConfig.ts +101 -8
  111. package/src/styles/app.css +33 -2
  112. package/src/styles/artifact.css +20 -8
  113. package/src/styles/base.css +68 -13
  114. package/src/styles/chrome.css +1134 -56
  115. package/src/styles/components.css +104 -65
  116. package/src/styles/defaults.css +140 -0
  117. package/src/styles/gate.css +21 -10
  118. package/src/styles/primitives.css +108 -39
  119. package/src/styles/sections.css +500 -437
  120. package/src/styles/star-rating.css +1 -4
  121. package/src/tokens/palettes.ts +24 -4
  122. package/src/types.ts +220 -3
  123. package/src/vite/index.ts +4 -0
  124. package/src/vite/marketing-config.ts +81 -1
  125. package/src/app/CardErrorBoundary.tsx +0 -39
  126. package/src/sections/CTABanner.tsx +0 -93
  127. package/src/sections/DeviceShowcase.tsx +0 -39
  128. package/src/sections/MediaBand.tsx +0 -20
  129. package/src/sections/MenuList.tsx +0 -44
  130. package/src/sections/PressQuotes.tsx +0 -51
  131. package/src/sections/SocialStrip.tsx +0 -83
@@ -48,14 +48,11 @@
48
48
  .star-rating-fill svg {
49
49
  fill: currentColor;
50
50
  }
51
+ /* A half star's hit area: a plain area the slider reads its rating from. */
51
52
  .star-rating-hit {
52
53
  position: absolute;
53
54
  inset-block: 0;
54
55
  width: 50%;
55
- margin: 0;
56
- padding: 0;
57
- border: 0;
58
- background: none;
59
56
  cursor: pointer;
60
57
  }
61
58
  .star-rating-hit.is-left {
@@ -2,7 +2,8 @@
2
2
  * The palette the runner emails are painted in, ported one to one from
3
3
  * homebase `runners/lib/email.jq` (the tokens section). Cream ground, paper
4
4
  * cards on a hairline, near black ink, the orange reserved for the one number
5
- * that matters on a row.
5
+ * that matters on a row. The bright orange marks (a rule, a dot, a link's
6
+ * underline) and never colors small words: those take the accent's ink.
6
7
  *
7
8
  * A client branded email passes its own Palette to EmailThemeProvider; the
8
9
  * values below are the default.
@@ -18,8 +19,19 @@ export type Palette = {
18
19
  dim: string;
19
20
  /** Eyebrows, captions, and anything deliberately quiet. */
20
21
  faint: string;
21
- /** The single accent. */
22
+ /**
23
+ * The single accent, as a mark: a rule, a dot, a link's underline, a
24
+ * callout's edge. Never the color of small words; see `accentInk`.
25
+ */
22
26
  accent: string;
27
+ /**
28
+ * The accent as the color of small words: the value on a title line, a
29
+ * short count, a group's name, a hot cell, a pill. It must read 4.5 to 1
30
+ * on both `paper` and `ground`. Optional (8.0.0): a palette without it
31
+ * gets one derived from `accent`, darkened toward black until it passes
32
+ * on both, which is the accent itself when that already passes.
33
+ */
34
+ accentInk?: string;
23
35
  /** A card's border and the heavier rule. */
24
36
  line: string;
25
37
  /** The lighter rule inside a card. */
@@ -44,13 +56,21 @@ export const atelicPalette: Palette = {
44
56
  paper: "#FDFBF6",
45
57
  ink: "#151515",
46
58
  dim: "#55503f",
47
- faint: "#8a8272",
59
+ // The brand kit's Faint, darkened from the jq's #8a8272 (3.38 to 1 on the
60
+ // ground, 3.68 on paper) to pass text contrast at the 11px a masthead's
61
+ // title and meta are set in: 4.99 to 1 on the ground, 5.43 on paper (8.0.0).
62
+ faint: "#6e6757",
63
+ // The mark. As words it reads 3.31 to 1 on paper and 3.04 on the ground.
48
64
  accent: "#FC4A1A",
65
+ // The brand kit's Orange Ink: 5.86 to 1 on paper, 5.38 on the ground (8.0.0).
66
+ accentInk: "#B8300B",
49
67
  line: "#E6DFD2",
50
68
  hair: "#F0EAE0",
51
69
  up: "#2F7A4B",
52
70
  down: "#B23A2E",
53
- warm: "#B7791F",
71
+ // Darkened from the jq's #B7791F (3.52 to 1 on paper) along the same hue:
72
+ // 4.96 on paper, 4.55 on the ground (8.0.0).
73
+ warm: "#966319",
54
74
  };
55
75
 
56
76
  /**
package/src/types.ts CHANGED
@@ -10,14 +10,28 @@
10
10
  * bearing the character in the brand's own webfont, which an SVG loaded
11
11
  * through an img cannot do). `wordmark` overrides the rendered text when it
12
12
  * should differ from the name, and `run` appends the trailing fade bar.
13
+ *
14
+ * A mark given as `onLight` and `onDark` is the brand's own artwork, cut
15
+ * once for each surface: `onLight` is drawn on a light bar, `onDark` on a
16
+ * dark bar, over a hero, and in the footer. The chrome never recolors either,
17
+ * and either alone serves every surface. A mark given as `src` alone is a
18
+ * light mark the header tints to ink on a light bar, as it always has. Every
19
+ * header mark stands at `--brand-mark-height` (30px unless the theme says
20
+ * otherwise), as wide as its own ratio makes it. `wordmark: false` drops the
21
+ * live name beside the mark, for artwork that already spells it.
13
22
  */
14
23
  export interface BrandLogo {
15
24
  src?: string;
16
- /** Alt text where the mark stands alone, as in the footer. */
25
+ /** Alt text where the mark stands alone: the footer's, when `wordmark` is false. */
17
26
  alt?: string;
18
27
  tile?: string;
19
- wordmark?: string;
28
+ /** The live name beside the mark; `false` leaves it out. Defaults to the brand's name. */
29
+ wordmark?: string | false;
20
30
  run?: boolean;
31
+ /** The mark drawn on a light bar, as given. */
32
+ onLight?: string;
33
+ /** The mark drawn on a dark bar, over a hero, and in the footer, as given. */
34
+ onDark?: string;
21
35
  }
22
36
 
23
37
  /**
@@ -42,10 +56,157 @@ export interface Brand {
42
56
  recipient?: BrandRecipient;
43
57
  }
44
58
 
45
- /** An entry in a site's primary nav. */
59
+ /**
60
+ * An entry in a site's primary nav: a plain link, or a group. A group is an
61
+ * entry with `columns`: on a desktop its label is a control that opens a
62
+ * mega menu panel holding its sections left to right (and the `feature` card
63
+ * at the right when it has one), and on a phone the menu opens it as an
64
+ * accordion. `href` is the group's own page, which `allLabel` links to from
65
+ * inside the group.
66
+ */
46
67
  export interface NavLink {
47
68
  label: string;
48
69
  href: string;
70
+ /**
71
+ * The group's panel, left to right: link columns, and the picture, icon
72
+ * row, and card sections beside them. An entry with none is a plain link.
73
+ */
74
+ columns?: NavPanelSection[];
75
+ /** A card at the panel's right on a desktop: a picture, a headline, ticked points, and a button. */
76
+ feature?: NavFeature;
77
+ /**
78
+ * The words of a link to the group's own page (`href`), set first in the
79
+ * group, e.g. "All services". Off unless given.
80
+ */
81
+ allLabel?: string;
82
+ }
83
+
84
+ /** A link indented under a column link, joined to it by an elbow. */
85
+ export interface NavGroupChildLink {
86
+ label: string;
87
+ href: string;
88
+ /** Opens in a new tab, except on mailto, tel, and sms links. */
89
+ external?: boolean;
90
+ /** A short word in a pill after the label, e.g. "Popular". */
91
+ badge?: string;
92
+ }
93
+
94
+ /** One link in a nav group's column, with a short line under it when it has one. */
95
+ export interface NavGroupLink extends NavGroupChildLink {
96
+ /** A short line under the link, e.g. what the page covers. */
97
+ description?: string;
98
+ /** Links drawn indented under this one on a desktop and a phone alike. */
99
+ children?: NavGroupChildLink[];
100
+ /**
101
+ * Sets the link in the panel's quieter words and regular weight, for a
102
+ * long list such as the towns under a region's heading. Off by default.
103
+ */
104
+ quiet?: boolean;
105
+ }
106
+
107
+ /**
108
+ * A link column of a nav group: a heading, itself a link when it has an
109
+ * `href`, over its links. `kind` may be left out; a section without one is
110
+ * a link column.
111
+ */
112
+ export interface NavGroupColumn {
113
+ kind?: "links";
114
+ heading: string;
115
+ href?: string;
116
+ links: NavGroupLink[];
117
+ }
118
+
119
+ /** A picture section of a nav group: one photo under its caption, the whole of it a link. */
120
+ export interface NavPictureSection {
121
+ kind: "picture";
122
+ /** The photo. Its alt defaults to empty, since the caption names the link. */
123
+ image: { src: string; alt?: string };
124
+ caption: string;
125
+ href: string;
126
+ external?: boolean;
127
+ }
128
+
129
+ /** The icons a nav row can lead with, each a lucide icon. */
130
+ export type NavIcon =
131
+ | "calculator"
132
+ | "calendar"
133
+ | "card"
134
+ | "chat"
135
+ | "document"
136
+ | "help"
137
+ | "home"
138
+ | "mail"
139
+ | "map"
140
+ | "phone"
141
+ | "pin"
142
+ | "play"
143
+ | "shield"
144
+ | "star"
145
+ | "tool"
146
+ | "truck"
147
+ | "users";
148
+
149
+ /** One icon row: an icon, a label, and a short line, the whole row a link. */
150
+ export interface NavIconRow {
151
+ label: string;
152
+ description?: string;
153
+ icon: NavIcon;
154
+ href: string;
155
+ external?: boolean;
156
+ /** Sets the row on the primary field, as the way most people should take. One per section. */
157
+ highlight?: boolean;
158
+ }
159
+
160
+ /** A section of icon rows under a heading, two across on a desktop. */
161
+ export interface NavIconRowsSection {
162
+ kind: "rows";
163
+ heading?: string;
164
+ rows: NavIconRow[];
165
+ }
166
+
167
+ /** One small card: a kicker, a title, and a meta line beside an optional square picture. */
168
+ export interface NavCard {
169
+ kicker?: string;
170
+ title: string;
171
+ meta?: string;
172
+ /** A square picture at the card's left; a quiet tile stands in without one. */
173
+ image?: { src: string; alt?: string };
174
+ href: string;
175
+ external?: boolean;
176
+ }
177
+
178
+ /** A section of small cards under a heading, such as the latest article and the latest job. */
179
+ export interface NavCardsSection {
180
+ kind: "cards";
181
+ heading?: string;
182
+ cards: NavCard[];
183
+ }
184
+
185
+ /** One section of a nav group's panel. */
186
+ export type NavPanelSection =
187
+ | NavGroupColumn
188
+ | NavPictureSection
189
+ | NavIconRowsSection
190
+ | NavCardsSection;
191
+
192
+ /** The card a nav group can carry at the right of its panel on a desktop. */
193
+ export interface NavFeature {
194
+ /** A small label over the headline. */
195
+ eyebrow?: string;
196
+ title: string;
197
+ /** One line under the headline. */
198
+ text?: string;
199
+ /** Short reasons, each set beside a tick under the headline. */
200
+ points?: string[];
201
+ cta: CallToAction;
202
+ /** The picture that fills the card above the words. */
203
+ image?: { src: string; alt: string };
204
+ }
205
+
206
+ /** A number the header shows, with the words that say whose line it is. */
207
+ export interface HeaderPhone extends Phone {
208
+ /** Printed small over the number and read with it, e.g. "Mountain office". */
209
+ label?: string;
49
210
  }
50
211
 
51
212
  /** A conversion action rendered as a button link. */
@@ -54,6 +215,8 @@ export interface CallToAction {
54
215
  href: string;
55
216
  /** Opens in a new tab, except on mailto, tel, and sms links. */
56
217
  external?: boolean;
218
+ /** The header's button carries the arrow a hero's primary button shows. Off by default. */
219
+ arrow?: boolean;
57
220
  }
58
221
 
59
222
  /** A footer or legal link that may open in a new tab. */
@@ -122,3 +285,57 @@ export interface MenuContact {
122
285
  email?: string;
123
286
  address?: PostalAddress;
124
287
  }
288
+
289
+ /** The pictures a dock item can lead with. */
290
+ export type ContactDockIcon =
291
+ | "chat"
292
+ | "phone"
293
+ | "calendar"
294
+ | "mail"
295
+ | "form"
296
+ | "calculator"
297
+ | "map";
298
+
299
+ /** What every dock item has, whichever way it acts. */
300
+ interface ContactDockItemBase {
301
+ label: string;
302
+ /** One short line under the label. */
303
+ description?: string;
304
+ icon?: ContactDockIcon;
305
+ /** Sets the item apart on a tinted ground, as the way most people should take. */
306
+ lead?: boolean;
307
+ }
308
+
309
+ /**
310
+ * One way to reach the business: a link (`href`, where a `tel:` dials and a
311
+ * form page opens) or a button (`onSelect`, which hands off to something
312
+ * already on the page, such as a chat vendor's own window), and never
313
+ * neither. A prototype never implies a system the business does not run, so
314
+ * an item always points at the business's existing flow.
315
+ */
316
+ export type ContactDockItem =
317
+ | (ContactDockItemBase & {
318
+ href: string;
319
+ /** Opens in a new tab, except on mailto, tel, and sms links. */
320
+ external?: boolean;
321
+ onSelect?: never;
322
+ })
323
+ | (ContactDockItemBase & {
324
+ /** Called on select in place of following a link; the dock closes first. */
325
+ onSelect: () => void;
326
+ href?: never;
327
+ external?: never;
328
+ });
329
+
330
+ /** What a site's config gives the dock; `SiteShell` mounts it when present. */
331
+ export interface ContactDockConfig {
332
+ /** The launcher's words, e.g. "Talk to us". On a phone the launcher shows its icon alone. */
333
+ label: string;
334
+ /** The panel's heading. Defaults to the launcher's words. */
335
+ title?: string;
336
+ /** One line under the heading. */
337
+ subtitle?: string;
338
+ items: ContactDockItem[];
339
+ /** A small line at the panel's foot, such as the hours someone answers. */
340
+ footnote?: string;
341
+ }
package/src/vite/index.ts CHANGED
@@ -10,10 +10,14 @@ export {
10
10
  artifactPages,
11
11
  } from "./artifact-config.js";
12
12
  export {
13
+ buildRelease,
14
+ environmentPlugin,
13
15
  type MarketingConfigOptions,
14
16
  type MarketingPage,
15
17
  marketingBasePath,
16
18
  marketingConfig,
17
19
  NOT_FOUND_PAGE,
20
+ type SentryUpload,
21
+ sentryUpload,
18
22
  } from "./marketing-config.js";
19
23
  export { DOC_DIR, isPrivateContent, privateChunks } from "./private-chunks.js";
@@ -15,7 +15,7 @@
15
15
  import { resolve } from "node:path";
16
16
  import { tanstackStart } from "@tanstack/react-start/plugin/vite";
17
17
  import react from "@vitejs/plugin-react";
18
- import { mergeConfig, type UserConfig } from "vite";
18
+ import { mergeConfig, type Plugin, type PluginOption, type UserConfig } from "vite";
19
19
  import { normalizeBasePath } from "../routing/basePath.js";
20
20
 
21
21
  /** One entry of the prerender list, as TanStack Start takes it. */
@@ -49,6 +49,76 @@ export interface MarketingConfigOptions {
49
49
  env?: Record<string, string | undefined>;
50
50
  }
51
51
 
52
+ /**
53
+ * The commit a build is filed under in Sentry: Vercel's commit, else the CI's.
54
+ * The same value names the release the Sentry plugin creates and the release
55
+ * the browser reports under, so a stack trace meets its source maps.
56
+ */
57
+ export function buildRelease(
58
+ env: Record<string, string | undefined> = process.env,
59
+ ): string | undefined {
60
+ return env.VERCEL_GIT_COMMIT_SHA || env.GITHUB_SHA || undefined;
61
+ }
62
+
63
+ /** What the Sentry plugin is given, when it runs at all. */
64
+ export interface SentryUpload {
65
+ org: string;
66
+ project: string;
67
+ authToken: string;
68
+ release: string;
69
+ }
70
+
71
+ /**
72
+ * The source map upload, on only when `SENTRY_AUTH_TOKEN`, `SENTRY_ORG`, and
73
+ * `SENTRY_PROJECT` are all set and the build knows its commit. Off, the
74
+ * build is exactly what it was: no plugin, no source maps.
75
+ */
76
+ export function sentryUpload(
77
+ env: Record<string, string | undefined> = process.env,
78
+ ): SentryUpload | undefined {
79
+ const { SENTRY_AUTH_TOKEN: authToken, SENTRY_ORG: org, SENTRY_PROJECT: project } = env;
80
+ const release = buildRelease(env);
81
+ if (!authToken || !org || !project || !release) return undefined;
82
+ return { org, project, authToken, release };
83
+ }
84
+
85
+ /**
86
+ * The Sentry Vite plugin, loaded only when it runs: it creates the release
87
+ * named by the commit, uploads the build's hidden source maps, and deletes
88
+ * every map file from the output afterwards, so none is ever served.
89
+ */
90
+ function sentryPlugin(upload: SentryUpload): PluginOption {
91
+ return import("@sentry/vite-plugin").then(
92
+ ({ sentryVitePlugin }) =>
93
+ sentryVitePlugin({
94
+ org: upload.org,
95
+ project: upload.project,
96
+ authToken: upload.authToken,
97
+ release: { name: upload.release, inject: false },
98
+ sourcemaps: { filesToDeleteAfterUpload: ["./dist/**/*.map"] },
99
+ telemetry: false,
100
+ }) as PluginOption,
101
+ );
102
+ }
103
+
104
+ /**
105
+ * The environment the browser files its errors under, as
106
+ * `import.meta.env.VITE_ENVIRONMENT`: Vercel's (production, preview,
107
+ * development) when the build runs there, else the build's mode. A Vite
108
+ * production build's mode is production on every deploy, a preview's
109
+ * included, so the mode alone filed every error as production.
110
+ */
111
+ export function environmentPlugin(env: Record<string, string | undefined> = process.env): Plugin {
112
+ return {
113
+ name: "atelic-build-environment",
114
+ config: (_config, { mode }) => ({
115
+ define: {
116
+ "import.meta.env.VITE_ENVIRONMENT": JSON.stringify(env.VERCEL_ENV || mode),
117
+ },
118
+ }),
119
+ };
120
+ }
121
+
52
122
  /** The 404 page, prerendered and copied to 404.html by the build, never in the sitemap. */
53
123
  export const NOT_FOUND_PAGE: MarketingPage = {
54
124
  path: "/404",
@@ -84,6 +154,8 @@ export function marketingConfig({
84
154
  env = process.env,
85
155
  }: MarketingConfigOptions): UserConfig {
86
156
  const basePath = marketingBasePath(site, env);
157
+ const release = buildRelease(env);
158
+ const upload = sentryUpload(env);
87
159
  const listed = pages.filter((page) => page.path !== NOT_FOUND_PAGE.path);
88
160
  const config: UserConfig = {
89
161
  // The base becomes Vite's `base`, so every built asset URL and every
@@ -110,7 +182,15 @@ export function marketingConfig({
110
182
  },
111
183
  }),
112
184
  react(),
185
+ environmentPlugin(env),
186
+ ...(upload ? [sentryPlugin(upload)] : []),
113
187
  ],
188
+ // The commit, for the browser to report under (`startErrorReporting`'s
189
+ // `release`), read as `import.meta.env.VITE_RELEASE`.
190
+ ...(release ? { define: { "import.meta.env.VITE_RELEASE": JSON.stringify(release) } } : {}),
191
+ // Maps only for Sentry, and hidden: the bundles carry no comment
192
+ // pointing at one, and the plugin deletes them once uploaded.
193
+ ...(upload ? { build: { sourcemap: "hidden" as const } } : {}),
114
194
  resolve: {
115
195
  alias: {
116
196
  // The site's src, from the directory Vite is run in: this file
@@ -1,39 +0,0 @@
1
- import { Component, type ErrorInfo, type ReactNode } from "react";
2
- import { Card, CardContent } from "./ui/card";
3
-
4
- interface Props {
5
- children: ReactNode;
6
- }
7
-
8
- interface State {
9
- hasError: boolean;
10
- }
11
-
12
- export class CardErrorBoundary extends Component<Props, State> {
13
- constructor(props: Props) {
14
- super(props);
15
- this.state = { hasError: false };
16
- }
17
-
18
- static getDerivedStateFromError(): State {
19
- return { hasError: true };
20
- }
21
-
22
- componentDidCatch(error: Error, info: ErrorInfo) {
23
- console.error("CardErrorBoundary caught:", error, info.componentStack);
24
- }
25
-
26
- render() {
27
- if (this.state.hasError) {
28
- return (
29
- <Card className="border-destructive/30">
30
- <CardContent className="py-6 text-center text-sm text-muted-foreground">
31
- Unable to display this item
32
- </CardContent>
33
- </Card>
34
- );
35
- }
36
-
37
- return this.props.children;
38
- }
39
- }
@@ -1,93 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import { Eyebrow, Lead } from "../primitives";
3
- import { Button } from "../primitives/Button";
4
- import { useWithBase } from "../routing/BasePathProvider";
5
-
6
- export interface CTABannerCTA {
7
- label: string;
8
- href: string;
9
- newTab?: boolean;
10
- }
11
-
12
- export interface CTABannerProps {
13
- id?: string;
14
- eyebrow?: string;
15
- /** Headline; use <em className="serif"> spans for the script accent. */
16
- title: ReactNode;
17
- lead?: ReactNode;
18
- /**
19
- * Full-bleed background image behind the content. Omit it and the banner
20
- * renders the token gradient fallback (the Hero treatment), so the section
21
- * works before photography exists.
22
- */
23
- image?: { src: string; alt?: string };
24
- primaryCTA?: CTABannerCTA;
25
- secondaryCTA?: CTABannerCTA;
26
- /**
27
- * Wash over the image so the copy pops: "dark" (light text over a dark
28
- * gradient, the hero treatment) or "light" (ink text over a surface wash,
29
- * for bright imagery). The wash fades toward the far side so the image
30
- * still reads.
31
- */
32
- tone?: "dark" | "light";
33
- }
34
-
35
- /**
36
- * Mid-page full-bleed CTA banner: the image spans the viewport as a backdrop
37
- * with eyebrow, title, lead, and actions overlaid. The section-scale sibling
38
- * of Hero — same treatment, banner height, usable anywhere in the page flow.
39
- */
40
- export function CTABanner({
41
- id,
42
- eyebrow,
43
- title,
44
- lead,
45
- image,
46
- primaryCTA,
47
- secondaryCTA,
48
- tone = "dark",
49
- }: CTABannerProps) {
50
- const withBase = useWithBase();
51
- const onDark = tone === "dark";
52
- return (
53
- <section className={["cta-banner", tone].join(" ")} id={id}>
54
- {image ? (
55
- <img
56
- className="cta-banner-media"
57
- src={withBase(image.src)}
58
- alt={image.alt ?? ""}
59
- loading="lazy"
60
- />
61
- ) : (
62
- <div className="cta-banner-media cta-banner-fallback" aria-hidden="true" />
63
- )}
64
- <div className="cta-banner-wash" aria-hidden="true" />
65
- <div className="wrap">
66
- <div className="cta-banner-content">
67
- {eyebrow && <Eyebrow onDark={onDark}>{eyebrow}</Eyebrow>}
68
- <h2>{title}</h2>
69
- {lead && <Lead>{lead}</Lead>}
70
- {(primaryCTA || secondaryCTA) && (
71
- <div className="cta-banner-actions">
72
- {primaryCTA && (
73
- <Button href={primaryCTA.href} newTab={primaryCTA.newTab} arrow>
74
- {primaryCTA.label}
75
- </Button>
76
- )}
77
- {secondaryCTA && (
78
- <Button
79
- variant="ghost"
80
- onDark={onDark}
81
- href={secondaryCTA.href}
82
- newTab={secondaryCTA.newTab}
83
- >
84
- {secondaryCTA.label}
85
- </Button>
86
- )}
87
- </div>
88
- )}
89
- </div>
90
- </div>
91
- </section>
92
- );
93
- }
@@ -1,39 +0,0 @@
1
- import { useWithBase } from "../routing/BasePathProvider";
2
-
3
- export interface DeviceImage {
4
- src: string;
5
- alt: string;
6
- }
7
-
8
- export interface DeviceShowcaseProps {
9
- /** Desktop screenshot, shown inside a browser window frame. */
10
- desktop: DeviceImage;
11
- /** Phone screenshot, shown in a device frame overlapping the desktop. */
12
- phone: DeviceImage;
13
- }
14
-
15
- /**
16
- * A desktop browser mockup with a phone mockup overlapping its lower-left,
17
- * for showing a rebuilt site the way it will actually look. Reusable; both
18
- * images arrive via props.
19
- */
20
- export function DeviceShowcase({ desktop, phone }: DeviceShowcaseProps) {
21
- const withBase = useWithBase();
22
- return (
23
- <div className="devices">
24
- <div className="dv-desktop">
25
- <div className="dv-bar">
26
- <i />
27
- <i />
28
- <i />
29
- </div>
30
- <div className="dv-screen">
31
- <img src={withBase(desktop.src)} alt={desktop.alt} loading="lazy" />
32
- </div>
33
- </div>
34
- <div className="dv-phone">
35
- <img src={withBase(phone.src)} alt={phone.alt} loading="lazy" />
36
- </div>
37
- </div>
38
- );
39
- }
@@ -1,20 +0,0 @@
1
- import { useWithBase } from "../routing/BasePathProvider";
2
-
3
- export interface MediaBandProps {
4
- image: { src: string; alt: string };
5
- /**
6
- * CSS aspect-ratio for the band (viewport-width : height), e.g. "8/3" for
7
- * a wide strip. The image covers the band and crops from center.
8
- */
9
- aspectRatio?: string;
10
- }
11
-
12
- /** Full-bleed image band: edge to edge, no frame, no radius. */
13
- export function MediaBand({ image, aspectRatio = "8/3" }: MediaBandProps) {
14
- const withBase = useWithBase();
15
- return (
16
- <div className="media-band" style={{ aspectRatio }}>
17
- <img src={withBase(image.src)} alt={image.alt} loading="lazy" />
18
- </div>
19
- );
20
- }
@@ -1,44 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- /**
4
- * A priced menu group: uppercase heading over dotted rows of name, optional
5
- * note, and price, with an optional fine-print foot line. Composes into a
6
- * page column; pair with Menu structured data in the route's head().
7
- * Styles live in menu-list.css beside it, with the `.menu-stack` and
8
- * `.menu-cols` layouts a page stacks its groups in.
9
- */
10
-
11
- export interface MenuListItem {
12
- name: string;
13
- /** Modifier or description line under the name. */
14
- note?: string;
15
- /** Rendered as text so ranges ("Small 5 / Large 6") stay expressible. */
16
- price: string;
17
- }
18
-
19
- export interface MenuListProps {
20
- heading: string;
21
- items: MenuListItem[];
22
- /** Fine print after the rows, e.g. "All sandwiches available as a salad." */
23
- foot?: ReactNode;
24
- }
25
-
26
- export function MenuList({ heading, items, foot }: MenuListProps) {
27
- return (
28
- <div className="menu-list">
29
- <h3>{heading}</h3>
30
- <ul>
31
- {items.map((item) => (
32
- <li key={item.name}>
33
- <span className="ml-item">
34
- <span className="ml-name">{item.name}</span>
35
- {item.note && <span className="ml-note">{item.note}</span>}
36
- </span>
37
- <span className="ml-price">{item.price}</span>
38
- </li>
39
- ))}
40
- </ul>
41
- {foot && <p className="ml-foot">{foot}</p>}
42
- </div>
43
- );
44
- }