Skip to content

Commit 1b41942

Browse files
committed
Relocate components to routes
1 parent 62140fe commit 1b41942

62 files changed

Lines changed: 209 additions & 400 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

astro.config.mjs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import react from "@astrojs/react";
44
import sitemap from "@astrojs/sitemap";
55
import sanity from "@sanity/astro";
66
import { defineConfig, passthroughImageService } from "astro/config";
7+
import tsconfigPaths from "vite-tsconfig-paths";
78

89
export default defineConfig({
910
output: "server",
@@ -34,6 +35,53 @@ export default defineConfig({
3435
format: "file",
3536
},
3637
vite: {
38+
build: {
39+
rollupOptions: {
40+
output: {
41+
// Use a supported file pattern for Vite 5/Rollup 4
42+
// @doc https://relative-ci.com/documentation/guides/vite-config
43+
assetFileNames: "assets/[name].[hash][extname]",
44+
chunkFileNames: "assets/[name].[hash].js",
45+
entryFileNames: "assets/[name].[hash].js",
46+
manualChunks(id) {
47+
// Astro
48+
if (id.includes("astro") || id.includes("@astrojs")) {
49+
return "astro";
50+
}
51+
52+
// Core component primitives
53+
if (
54+
id.includes("@radix-ui") ||
55+
id.includes("react-aria") ||
56+
id.includes("react-aria-components")
57+
) {
58+
return "react-aria";
59+
}
60+
61+
// Icons and visual components
62+
if (id.includes("@maskito") || id.includes("@remixicon")) {
63+
return "ui-components";
64+
}
65+
66+
// USA states and counties dictionary
67+
if (id.includes("typed-usa-states")) {
68+
return "usa-states";
69+
}
70+
71+
// PDF lib
72+
if (id.includes("@cantoo/pdf-lib")) {
73+
return "pdf";
74+
}
75+
76+
// Analytics
77+
if (id.includes("posthog-js")) {
78+
return "analytics";
79+
}
80+
},
81+
},
82+
},
83+
},
84+
plugins: [tsconfigPaths()],
3785
ssr: {
3886
external: ["buffer", "path", "fs", "os", "crypto", "async_hooks"].map(
3987
(i) => `node:${i}`,

biome.jsonc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"!worker-configuration.d.ts"
1414
]
1515
},
16+
"vcs": {
17+
"enabled": true,
18+
"clientKind": "git",
19+
"useIgnoreFile": true
20+
},
1621
"formatter": {
1722
"enabled": true,
1823
"indentStyle": "space"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
"postcss-utopia": "^1.1.0",
114114
"sharp": "^0.34.5",
115115
"storybook": "^10.0.8",
116+
"vite-tsconfig-paths": "^5.1.4",
116117
"vitest": "4.0.13",
117118
"wrangler": "^4.50.0"
118119
},

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/react/common/ComboBox/ComboBox.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,25 @@ export function ComboBox<T extends object>({
3434
autoComplete,
3535
children,
3636
className,
37+
name,
3738
...props
3839
}: ComboBoxProps<T>) {
3940
return (
40-
<AriaComboBox className={clsx("namesake-combobox", className)} {...props}>
41-
{({ isInvalid }) => (
41+
<AriaComboBox
42+
className={clsx("namesake-combobox", className)}
43+
name={name}
44+
{...props}
45+
>
46+
{({ isInvalid, isRequired }) => (
4247
<>
4348
<Label>{label}</Label>
4449
<div className="namesake-combobox-container">
45-
<Input placeholder={placeholder} autoComplete={autoComplete} />
50+
<Input
51+
placeholder={placeholder}
52+
autoComplete={autoComplete}
53+
required={isRequired}
54+
name={name}
55+
/>
4656
<FieldButton>
4757
<RiArrowDownSLine size={20} />
4858
</FieldButton>

src/components/react/forms/CheckboxGroupField/CheckboxGroupField.test.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,6 @@ describe("CheckboxGroupField", () => {
4040
}
4141
});
4242

43-
it("displays guidance for checkbox groups", () => {
44-
renderWithFormProvider(
45-
<CheckboxGroupField
46-
name="reasonForChangingName"
47-
label="Test Label"
48-
options={mockOptions}
49-
/>,
50-
);
51-
52-
const guidance = screen.getByText("Select all that apply:");
53-
expect(guidance).toBeInTheDocument();
54-
});
55-
5643
it("allows selecting a checkbox option", async () => {
5744
renderWithFormProvider(
5845
<CheckboxGroupField

src/components/react/forms/FormContainer/FormContainer.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
22
import { FormProvider, type UseFormReturn } from "react-hook-form";
3+
import {
4+
FormNavigation,
5+
FormReviewStep,
6+
FormTitleStep,
7+
} from "~/components/react/forms";
38
import { Form } from "../../common/Form";
4-
import { FormNavigation } from "../FormNavigation";
5-
import { FormReviewStep } from "../FormReviewStep";
6-
import { FormTitleStep } from "../FormTitleStep";
79
import { FormStepContext } from "./FormStepContext";
810
import "./FormContainer.css";
911

src/components/react/forms/FormContainer/index.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/components/react/forms/FormNavigation/FormNavigation.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Meta, StoryFn } from "@storybook/react";
2-
import { FormStepContext } from "../FormContainer/FormStepContext";
3-
import { FormNavigation } from "./FormNavigation";
2+
import { FormNavigation, FormStepContext } from "~/components/react/forms";
43

54
const meta: Meta<typeof FormNavigation> = {
65
component: FormNavigation,

src/components/react/forms/FormNavigation/FormNavigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { RiArrowLeftLine, RiArrowRightLine } from "@remixicon/react";
2+
import { useFormStep } from "~/components/react/forms";
23
import { Button } from "../../common/Button";
34
import { ProgressBar } from "../../common/ProgressBar";
4-
import { useFormStep } from "../FormContainer";
55
import "./FormNavigation.css";
66
import { Fragment } from "react/jsx-runtime";
77

0 commit comments

Comments
 (0)