"usage": "# Usage instructions\n\n- Built with\n * React Router 6 for declarative client-side routing\n * ShadCN UI (v2.3.0) for customizable and accessible UI components built on Radix UI primitives\n * Tailwind CSS for utility-first styling\n * Lucide Icons (React) for modern and lightweight iconography\n * ESLint with sensible defaults and TypeScript support\n * Cloudflare Workers for serving and server-side processing\n\n- Restrictions:\n * When including `tailwind.config.js`, **hardcode custom colors** directly in the config file – do **not** define them in `index.css` unless specified\n\n- Styling:\n * Must generate **fully responsive** and accessible layouts\n * Use Shadcn preinstalled components rather than writing custom ones when possible\n * Use **Tailwind's spacing, layout, and typography utilities** for all custom components\n\n- Components\n * All Shadcn components are available and can be imported from @/components/ui/...\n * Do not write custom components if shadcn components are available\n * Icons from Lucide should be imported directly from `lucide-react`\n\n**NOTE: ErrorBoundary and related Error handling components and code are already implemented but hidden**\n\n- Animation:\n * Use `framer-motion`'s `motion` components to animate sections on scroll or page load\n * You can integrate variants and transitions using Tailwind utility classes alongside motion props\n\nComponents available:\n```sh\n$ ls -1 src/components/ui\naccordion.tsx\nalert-dialog.tsx\nalert.tsx\naspect-ratio.tsx\navatar.tsx\nbadge.tsx\nbreadcrumb.tsx\nbutton.tsx\ncalendar.tsx\ncard.tsx\ncarousel.tsx\nchart.tsx\ncheckbox.tsx\ncollapsible.tsx\ncommand.tsx\ncontext-menu.tsx\ndialog.tsx\ndrawer.tsx\ndropdown-menu.tsx\nform.tsx\nhover-card.tsx\ninput-otp.tsx\ninput.tsx\nlabel.tsx\nmenubar.tsx\nnavigation-menu.tsx\npagination.tsx\npopover.tsx\nprogress.tsx\nradio-group.tsx\nresizable.tsx\nscroll-area.tsx\nselect.tsx\nseparator.tsx\nsheet.tsx\nsidebar.tsx\nskeleton.tsx\nslider.tsx\nsonner.tsx\nswitch.tsx\ntable.tsx\ntabs.tsx\ntextarea.tsx\ntoast.tsx\ntoggle-group.tsx\ntoggle.tsx\ntooltip.tsx\n```\n\nUsage Example:\n```tsx file=\"example.tsx\"\n import { Button } from '@/components/ui/button'\n import { CardContent, Card } from '@/components/ui/card'\n import { MousePointerClickIcon } from 'lucide-react';\n // custom hook for example ignore\n import { useStopwatch } from '../hooks/useStopwatch'\n\n export function Stopwatch({ initialTime = 0 }) {\n const { time, isRunning, start, pause, reset } = useStopwatch(initialTime);\n\n return (\n <Card className=\"w-full max-w-md\">\n <CardContent className=\"flex flex-col items-center justify-center gap-4 p-4\">\n <div \n className=\"text-6xl font-bold tabular-nums\" \n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {time}\n </div>\n <div className=\"flex gap-4\">\n <Button \n onClick={isRunning ? pause : start}\n aria-pressed={isRunning}\n >\n <MousePointerClickIcon className=\"text-yellow-400 size-4\" />\n {isRunning ? 'Pause' : 'Start'}\n </Button>\n <Button \n onClick={reset}\n disabled={time === 0 && !isRunning}\n >\n Reset\n </Button>\n </div>\n </CardContent>\n </Card>\n )\n }\n```\n\nThe backend routes (worker logic) are defined in the `worker/index.ts` file. For any server-side processing, define appropriate routes, types and controllers in the worker, **BUT BE CAREFUL** You can easily break everything so make sure you follow the **exact** pattern in the worker file to add any new routes"
0 commit comments