Skip to content

feat: Add shadcn/ui component library and migrate components - #126

Open
iacapuca wants to merge 5 commits into
mainfrom
migrate-shadcn-ui
Open

feat: Add shadcn/ui component library and migrate components#126
iacapuca wants to merge 5 commits into
mainfrom
migrate-shadcn-ui

Conversation

@iacapuca

Copy link
Copy Markdown
Collaborator

Summary

  • Set up shadcn/ui with Tailwind CSS theming (CSS variables, cn() utility, tailwindcss-animate)
  • Created 12 base UI components: Button, Card, Dialog, Input, Textarea, Label, Select, Alert, Badge, Tooltip, Skeleton, Breadcrumb
  • Migrated 7 existing components to use shadcn/ui primitives (ApiAlert, modals, forms, tooltips, errors)
  • Removed unused styled-components dependency

Components migrated

Component Before After
ApiAlert Custom overlay + manual focus trap Dialog + Alert (destructive)
PointDetailsModal Custom fixed overlay Dialog + DialogContent
CachePermissionModal Custom modal + useFocusTrap Dialog + Button
ContactForm Raw <input>/<textarea>/<select> Input, Textarea, Label, Select, Button
SelectionFilter Custom styled select + SVG chevron Select + Label
ErrorFallback Raw divs Alert (destructive) + Button
Tooltip Custom CSS hover tooltip shadcn Tooltip wrapper

Theme configuration

  • Primary color: #008080 (ameciclo teal) mapped to --primary CSS variable
  • All shadcn semantic colors configured (background, foreground, muted, accent, etc.)
  • Border radius, ring colors all customizable via CSS variables

Test plan

  • Verify ApiAlert modal opens/closes correctly on API errors
  • Test PointDetailsModal on /dados/contagens map point clicks
  • Test CachePermissionModal appears correctly
  • Test contact form validation and submission on /contato
  • Verify SelectionFilter dropdowns work on data pages
  • Verify ErrorFallback renders on error
  • Test Tooltip hover behavior across the site
  • Run npm run build to confirm production build succeeds

🤖 Generated with Claude Code

iacapuca and others added 5 commits March 30, 2026 14:55
…ployment

Migrate the entire application from Remix 2.16 to TanStack Start 1.167
with TanStack Router for file-based routing. Configure deployment target
to Cloudflare Workers instead of Vercel.

Key changes:
- Replace @remix-run/* packages with @tanstack/react-start and @tanstack/react-router
- Convert all 28 route files to use createFileRoute pattern
- Convert all 27 loader files to plain async functions (remove json/defer wrappers)
- Replace Remix entry points with TanStack Start client/ssr/router entries
- Create __root.tsx with createRootRoute (replaces root.tsx)
- Update all component imports from @remix-run/react to @tanstack/react-router
- Replace useLocation with useRouterState, useSearchParams with useSearch
- Replace remix-utils ClientOnly with inline implementation
- Replace Node.js fs/path usage with fetch() for Cloudflare Workers compatibility
- Add wrangler.jsonc for Cloudflare Workers deployment
- Add @cloudflare/vite-plugin for SSR on Workers
- Configure TanStack Start plugin with srcDirectory: "app"
- Update .gitignore for routeTree.gen.ts and .wrangler/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…F Workers

- Set compatibility_date to 2026-03-17 (latest supported by runtime)
- Strip `cache: "force-cache"` from fetch options since Cloudflare Workers
  doesn't support it

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove VercelSponsor component and logo from Footer
- Delete vercel.json configuration
- Clean up .gitignore (remove .vercel, deduplicate .wrangler)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…refetching

- Add @tanstack/react-router-with-query for automatic dehydration/hydration
- Update router.tsx to use routerWithQueryClient with shared QueryClient
- Update __root.tsx to use createRootRouteWithContext<{ queryClient }>
- Convert all 27 loader files to export queryOptions() factories
- Update all route loaders to use queryClient.ensureQueryData()
- Update all route components to use useSuspenseQuery() instead of
  Route.useLoaderData()
- Await all deferred promises in loaders (no more promise-based returns)
- Remove Await/Suspense wrappers from deferred routes (data is now
  pre-loaded on server)
- QueryClient is now managed by the router, not a separate provider

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set up shadcn/ui with Tailwind CSS integration:
- Add CSS variables for theming (primary = ameciclo teal)
- Add tailwindcss-animate, class-variance-authority, clsx, tailwind-merge
- Create cn() utility for class merging
- Remove unused styled-components dependency

Create shadcn/ui base components:
- Button (with variants: default, destructive, outline, secondary, ghost, link)
- Card (Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter)
- Dialog (Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription)
- Input, Textarea, Label, Select
- Alert (with variants: default, destructive, warning, success)
- Badge, Tooltip, Skeleton, Breadcrumb

Migrate existing components to use shadcn/ui:
- ApiAlert: custom modal -> Dialog + Alert (destructive)
- PointDetailsModal: custom overlay -> Dialog
- CachePermissionModal: custom modal -> Dialog + Button
- ContactForm: raw inputs -> Input, Textarea, Label, Select, Button
- SelectionFilter: custom select -> Select + Label
- ErrorFallback: raw div -> Alert (destructive) + Button
- Tooltip: custom CSS tooltip -> shadcn Tooltip wrapper

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ameciclo-v1 Error Error Mar 30, 2026 9:40pm

Base automatically changed from migrate-tanstack-start-cloudflare to main April 23, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant