@pylonsync/create-pylon 0.22.75 → 0.22.76
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.
- package/bin/create-pylon.js +24 -74
- package/package.json +1 -1
- package/skill/SKILL.md +7 -11
- package/templates/_root/README.md +2 -8
- package/templates/agency/AGENTS.md +17 -0
- package/templates/agency/app/globals.css +5 -1
- package/templates/agency/app/internal/components/page.tsx +248 -0
- package/templates/agency/app/internal/design/page.tsx +169 -0
- package/templates/agency/app/internal/layout.tsx +89 -0
- package/templates/agency/app/internal/sections.ts +26 -0
- package/templates/agency/app/internal/showcase.tsx +43 -0
- package/templates/agency/app/robots.ts +1 -1
- package/templates/agency/components/ui/button.tsx +22 -20
- package/templates/agency/components/ui/dialog.tsx +77 -64
- package/templates/agency/components/ui/input.tsx +5 -5
- package/templates/agency/components/ui/label.tsx +5 -3
- package/templates/agency/components/ui/select.tsx +81 -19
- package/templates/agency/components/ui/textarea.tsx +5 -3
- package/templates/agency/lib/utils.ts +4 -4
- package/templates/agency/package.json +3 -3
- package/templates/ai-chat/AGENTS.md +17 -0
- package/templates/ai-chat/app/globals.css +5 -1
- package/templates/ai-chat/app/internal/components/page.tsx +248 -0
- package/templates/ai-chat/app/internal/design/page.tsx +173 -0
- package/templates/ai-chat/app/internal/layout.tsx +89 -0
- package/templates/ai-chat/app/internal/sections.ts +26 -0
- package/templates/ai-chat/app/internal/showcase.tsx +43 -0
- package/templates/ai-chat/app/robots.ts +1 -1
- package/templates/ai-chat/components/ui/button.tsx +22 -20
- package/templates/ai-chat/components/ui/dialog.tsx +77 -64
- package/templates/ai-chat/components/ui/input.tsx +5 -5
- package/templates/ai-chat/components/ui/label.tsx +5 -3
- package/templates/ai-chat/components/ui/select.tsx +81 -19
- package/templates/ai-chat/components/ui/textarea.tsx +5 -3
- package/templates/ai-chat/lib/utils.ts +4 -4
- package/templates/ai-chat/package.json +4 -4
- package/templates/ai-studio/AGENTS.md +17 -0
- package/templates/ai-studio/app/globals.css +5 -1
- package/templates/ai-studio/app/internal/components/page.tsx +248 -0
- package/templates/ai-studio/app/internal/design/page.tsx +168 -0
- package/templates/ai-studio/app/internal/layout.tsx +89 -0
- package/templates/ai-studio/app/internal/sections.ts +26 -0
- package/templates/ai-studio/app/internal/showcase.tsx +43 -0
- package/templates/ai-studio/app/robots.ts +1 -1
- package/templates/ai-studio/components/ui/button.tsx +22 -20
- package/templates/ai-studio/components/ui/dialog.tsx +77 -64
- package/templates/ai-studio/components/ui/input.tsx +5 -5
- package/templates/ai-studio/components/ui/label.tsx +5 -3
- package/templates/ai-studio/components/ui/select.tsx +81 -19
- package/templates/ai-studio/components/ui/textarea.tsx +5 -3
- package/templates/ai-studio/lib/utils.ts +4 -4
- package/templates/ai-studio/package.json +4 -4
- package/templates/barebones/AGENTS.md +17 -0
- package/templates/barebones/README.md +6 -3
- package/templates/barebones/app/(app)/layout.tsx +16 -0
- package/templates/barebones/app/{page.tsx → (app)/page.tsx} +2 -2
- package/templates/barebones/app/error.tsx +1 -1
- package/templates/barebones/app/globals.css +9 -7
- package/templates/barebones/app/internal/components/page.tsx +248 -0
- package/templates/barebones/app/internal/design/page.tsx +165 -0
- package/templates/barebones/app/internal/layout.tsx +89 -0
- package/templates/barebones/app/internal/sections.ts +26 -0
- package/templates/barebones/app/internal/showcase.tsx +43 -0
- package/templates/barebones/app/layout.tsx +4 -6
- package/templates/barebones/app/not-found.tsx +2 -4
- package/templates/barebones/app/robots.ts +1 -1
- package/templates/barebones/components/ui/button.tsx +22 -20
- package/templates/barebones/components/ui/dialog.tsx +77 -64
- package/templates/barebones/components/ui/input.tsx +5 -5
- package/templates/barebones/components/ui/label.tsx +5 -3
- package/templates/barebones/components/ui/select.tsx +81 -19
- package/templates/barebones/components/ui/textarea.tsx +5 -3
- package/templates/barebones/lib/utils.ts +4 -4
- package/templates/barebones/package.json +3 -3
- package/templates/chat/AGENTS.md +17 -0
- package/templates/chat/app/globals.css +7 -5
- package/templates/chat/app/internal/components/page.tsx +248 -0
- package/templates/chat/app/internal/design/page.tsx +170 -0
- package/templates/chat/app/internal/layout.tsx +89 -0
- package/templates/chat/app/internal/sections.ts +26 -0
- package/templates/chat/app/internal/showcase.tsx +43 -0
- package/templates/chat/app/not-found.tsx +1 -3
- package/templates/chat/app/robots.ts +1 -1
- package/templates/chat/components/ui/button.tsx +22 -20
- package/templates/chat/components/ui/dialog.tsx +77 -64
- package/templates/chat/components/ui/input.tsx +5 -5
- package/templates/chat/components/ui/label.tsx +5 -3
- package/templates/chat/components/ui/select.tsx +81 -19
- package/templates/chat/components/ui/textarea.tsx +5 -3
- package/templates/chat/lib/utils.ts +4 -4
- package/templates/chat/package.json +4 -4
- package/templates/consumer/AGENTS.md +17 -0
- package/templates/consumer/app/globals.css +9 -7
- package/templates/consumer/app/internal/components/page.tsx +248 -0
- package/templates/consumer/app/internal/design/page.tsx +167 -0
- package/templates/consumer/app/internal/layout.tsx +89 -0
- package/templates/consumer/app/internal/sections.ts +26 -0
- package/templates/consumer/app/internal/showcase.tsx +43 -0
- package/templates/consumer/app/robots.ts +1 -1
- package/templates/consumer/components/ui/button.tsx +22 -20
- package/templates/consumer/components/ui/dialog.tsx +77 -64
- package/templates/consumer/components/ui/input.tsx +5 -5
- package/templates/consumer/components/ui/label.tsx +5 -3
- package/templates/consumer/components/ui/select.tsx +81 -19
- package/templates/consumer/components/ui/textarea.tsx +5 -3
- package/templates/consumer/lib/utils.ts +4 -4
- package/templates/consumer/package.json +4 -4
- package/templates/creator/AGENTS.md +17 -0
- package/templates/creator/app/globals.css +5 -1
- package/templates/creator/app/internal/components/page.tsx +248 -0
- package/templates/creator/app/internal/design/page.tsx +171 -0
- package/templates/creator/app/internal/layout.tsx +89 -0
- package/templates/creator/app/internal/sections.ts +26 -0
- package/templates/creator/app/internal/showcase.tsx +43 -0
- package/templates/creator/app/robots.ts +1 -1
- package/templates/creator/components/ui/button.tsx +22 -20
- package/templates/creator/components/ui/dialog.tsx +77 -64
- package/templates/creator/components/ui/input.tsx +5 -5
- package/templates/creator/components/ui/label.tsx +5 -3
- package/templates/creator/components/ui/select.tsx +81 -19
- package/templates/creator/components/ui/textarea.tsx +5 -3
- package/templates/creator/lib/utils.ts +4 -4
- package/templates/creator/package.json +4 -4
- package/templates/crm/AGENTS.md +17 -0
- package/templates/crm/README.md +3 -4
- package/templates/crm/app/deals/[id]/deal-view.tsx +9 -14
- package/templates/crm/app/globals.css +5 -2
- package/templates/crm/app/internal/components/page.tsx +282 -0
- package/templates/crm/app/internal/design/page.tsx +163 -0
- package/templates/crm/app/internal/layout.tsx +89 -0
- package/templates/crm/app/internal/sections.ts +27 -0
- package/templates/crm/app/internal/showcase.tsx +43 -0
- package/templates/crm/app/not-found.tsx +1 -3
- package/templates/crm/app/robots.ts +1 -1
- package/templates/crm/components/activity-timeline.tsx +6 -8
- package/templates/crm/components/app-shell.tsx +25 -26
- package/templates/crm/components/deal-dialog.tsx +15 -17
- package/templates/crm/components/record-dialog.tsx +10 -11
- package/templates/crm/components/ui/button.tsx +22 -20
- package/templates/crm/components/ui/dialog.tsx +77 -64
- package/templates/crm/components/ui/input.tsx +5 -5
- package/templates/crm/components/ui/label.tsx +5 -3
- package/templates/crm/components/ui/select.tsx +81 -19
- package/templates/crm/components/ui/sheet.tsx +64 -0
- package/templates/crm/components/ui/textarea.tsx +5 -3
- package/templates/crm/lib/utils.ts +4 -4
- package/templates/crm/package.json +4 -4
- package/templates/directory/AGENTS.md +17 -0
- package/templates/directory/app/globals.css +5 -1
- package/templates/directory/app/internal/components/page.tsx +248 -0
- package/templates/directory/app/internal/design/page.tsx +168 -0
- package/templates/directory/app/internal/layout.tsx +89 -0
- package/templates/directory/app/internal/sections.ts +26 -0
- package/templates/directory/app/internal/showcase.tsx +43 -0
- package/templates/directory/app/robots.ts +1 -1
- package/templates/directory/components/ui/button.tsx +22 -20
- package/templates/directory/components/ui/dialog.tsx +77 -64
- package/templates/directory/components/ui/input.tsx +5 -5
- package/templates/directory/components/ui/label.tsx +5 -3
- package/templates/directory/components/ui/select.tsx +81 -19
- package/templates/directory/components/ui/textarea.tsx +5 -3
- package/templates/directory/lib/utils.ts +4 -4
- package/templates/directory/package.json +4 -4
- package/templates/helpdesk/AGENTS.md +17 -0
- package/templates/helpdesk/README.md +1 -1
- package/templates/helpdesk/app/globals.css +5 -2
- package/templates/helpdesk/app/internal/components/page.tsx +282 -0
- package/templates/helpdesk/app/internal/design/page.tsx +163 -0
- package/templates/helpdesk/app/internal/layout.tsx +89 -0
- package/templates/helpdesk/app/internal/sections.ts +27 -0
- package/templates/helpdesk/app/internal/showcase.tsx +43 -0
- package/templates/helpdesk/app/not-found.tsx +1 -3
- package/templates/helpdesk/app/robots.ts +1 -1
- package/templates/helpdesk/app/tickets/[id]/ticket-view.tsx +22 -29
- package/templates/helpdesk/components/app-shell.tsx +25 -26
- package/templates/helpdesk/components/new-ticket-dialog.tsx +15 -17
- package/templates/helpdesk/components/record-dialog.tsx +10 -11
- package/templates/helpdesk/components/ui/button.tsx +22 -20
- package/templates/helpdesk/components/ui/dialog.tsx +77 -64
- package/templates/helpdesk/components/ui/input.tsx +5 -5
- package/templates/helpdesk/components/ui/label.tsx +5 -3
- package/templates/helpdesk/components/ui/select.tsx +81 -19
- package/templates/helpdesk/components/ui/sheet.tsx +64 -0
- package/templates/helpdesk/components/ui/textarea.tsx +5 -3
- package/templates/helpdesk/lib/utils.ts +4 -4
- package/templates/helpdesk/package.json +4 -4
- package/templates/imessage/AGENTS.md +17 -0
- package/templates/imessage/app/globals.css +4 -0
- package/templates/imessage/app/internal/components/page.tsx +248 -0
- package/templates/imessage/app/internal/design/page.tsx +163 -0
- package/templates/imessage/app/internal/layout.tsx +89 -0
- package/templates/imessage/app/internal/sections.ts +26 -0
- package/templates/imessage/app/internal/showcase.tsx +43 -0
- package/templates/imessage/components/ui/button.tsx +22 -20
- package/templates/imessage/components/ui/dialog.tsx +77 -64
- package/templates/imessage/components/ui/input.tsx +5 -5
- package/templates/imessage/components/ui/label.tsx +5 -3
- package/templates/imessage/components/ui/select.tsx +81 -19
- package/templates/imessage/components/ui/textarea.tsx +5 -3
- package/templates/imessage/lib/utils.ts +4 -4
- package/templates/imessage/package.json +4 -4
- package/templates/inventory/AGENTS.md +17 -0
- package/templates/inventory/README.md +1 -1
- package/templates/inventory/app/globals.css +5 -2
- package/templates/inventory/app/internal/components/page.tsx +282 -0
- package/templates/inventory/app/internal/design/page.tsx +163 -0
- package/templates/inventory/app/internal/layout.tsx +89 -0
- package/templates/inventory/app/internal/sections.ts +27 -0
- package/templates/inventory/app/internal/showcase.tsx +43 -0
- package/templates/inventory/app/not-found.tsx +1 -3
- package/templates/inventory/app/products/[id]/product-view.tsx +1 -3
- package/templates/inventory/app/robots.ts +1 -1
- package/templates/inventory/components/app-shell.tsx +25 -26
- package/templates/inventory/components/movement-dialog.tsx +15 -17
- package/templates/inventory/components/record-dialog.tsx +10 -11
- package/templates/inventory/components/ui/button.tsx +22 -20
- package/templates/inventory/components/ui/dialog.tsx +77 -64
- package/templates/inventory/components/ui/input.tsx +5 -5
- package/templates/inventory/components/ui/label.tsx +5 -3
- package/templates/inventory/components/ui/select.tsx +81 -19
- package/templates/inventory/components/ui/sheet.tsx +64 -0
- package/templates/inventory/components/ui/textarea.tsx +5 -3
- package/templates/inventory/lib/utils.ts +4 -4
- package/templates/inventory/package.json +4 -4
- package/templates/inventory/tests/components.test.tsx +27 -14
- package/templates/invoices/AGENTS.md +17 -0
- package/templates/invoices/README.md +1 -1
- package/templates/invoices/app/globals.css +5 -2
- package/templates/invoices/app/internal/components/page.tsx +282 -0
- package/templates/invoices/app/internal/design/page.tsx +163 -0
- package/templates/invoices/app/internal/layout.tsx +89 -0
- package/templates/invoices/app/internal/sections.ts +27 -0
- package/templates/invoices/app/internal/showcase.tsx +43 -0
- package/templates/invoices/app/invoices/[id]/invoice-view.tsx +20 -26
- package/templates/invoices/app/not-found.tsx +1 -3
- package/templates/invoices/app/robots.ts +1 -1
- package/templates/invoices/components/app-shell.tsx +25 -26
- package/templates/invoices/components/payment-dialog.tsx +6 -8
- package/templates/invoices/components/record-dialog.tsx +10 -11
- package/templates/invoices/components/ui/button.tsx +22 -20
- package/templates/invoices/components/ui/dialog.tsx +77 -64
- package/templates/invoices/components/ui/input.tsx +5 -5
- package/templates/invoices/components/ui/label.tsx +5 -3
- package/templates/invoices/components/ui/select.tsx +81 -19
- package/templates/invoices/components/ui/sheet.tsx +64 -0
- package/templates/invoices/components/ui/textarea.tsx +5 -3
- package/templates/invoices/lib/utils.ts +4 -4
- package/templates/invoices/package.json +4 -4
- package/templates/local-service/AGENTS.md +17 -0
- package/templates/local-service/app/globals.css +5 -1
- package/templates/local-service/app/internal/components/page.tsx +248 -0
- package/templates/local-service/app/internal/design/page.tsx +170 -0
- package/templates/local-service/app/internal/layout.tsx +89 -0
- package/templates/local-service/app/internal/sections.ts +26 -0
- package/templates/local-service/app/internal/showcase.tsx +43 -0
- package/templates/local-service/app/robots.ts +1 -1
- package/templates/local-service/components/ui/button.tsx +22 -20
- package/templates/local-service/components/ui/dialog.tsx +77 -64
- package/templates/local-service/components/ui/input.tsx +5 -5
- package/templates/local-service/components/ui/label.tsx +5 -3
- package/templates/local-service/components/ui/select.tsx +81 -19
- package/templates/local-service/components/ui/textarea.tsx +5 -3
- package/templates/local-service/lib/utils.ts +4 -4
- package/templates/local-service/package.json +4 -4
- package/templates/marketplace/AGENTS.md +17 -0
- package/templates/marketplace/README.md +8 -5
- package/templates/marketplace/app/(market)/layout.tsx +113 -0
- package/templates/marketplace/app/{listing → (market)/listing}/[id]/page.tsx +7 -7
- package/templates/marketplace/app/{me → (market)/me}/page.tsx +1 -1
- package/templates/marketplace/app/{not-found.tsx → (market)/not-found.tsx} +1 -3
- package/templates/marketplace/app/{page.tsx → (market)/page.tsx} +5 -5
- package/templates/marketplace/app/{sell → (market)/sell}/page.tsx +1 -1
- package/templates/marketplace/app/error.tsx +1 -3
- package/templates/marketplace/app/globals.css +4 -0
- package/templates/marketplace/app/internal/components/page.tsx +335 -0
- package/templates/marketplace/app/internal/design/page.tsx +158 -0
- package/templates/marketplace/app/internal/layout.tsx +89 -0
- package/templates/marketplace/app/internal/sections.ts +30 -0
- package/templates/marketplace/app/internal/showcase.tsx +43 -0
- package/templates/marketplace/app/layout.tsx +4 -100
- package/templates/marketplace/app/robots.ts +1 -1
- package/templates/marketplace/client/ListingCard.tsx +1 -1
- package/templates/marketplace/components/ui/button.tsx +22 -21
- package/templates/marketplace/components/ui/dialog.tsx +77 -64
- package/templates/marketplace/components/ui/input.tsx +5 -5
- package/templates/marketplace/components/ui/label.tsx +5 -4
- package/templates/marketplace/components/ui/select.tsx +101 -0
- package/templates/marketplace/components/ui/separator.tsx +5 -8
- package/templates/marketplace/components/ui/textarea.tsx +5 -3
- package/templates/marketplace/lib/utils.ts +4 -4
- package/templates/marketplace/package.json +3 -5
- package/templates/projects/AGENTS.md +17 -0
- package/templates/projects/README.md +1 -1
- package/templates/projects/app/globals.css +5 -2
- package/templates/projects/app/internal/components/page.tsx +282 -0
- package/templates/projects/app/internal/design/page.tsx +163 -0
- package/templates/projects/app/internal/layout.tsx +89 -0
- package/templates/projects/app/internal/sections.ts +27 -0
- package/templates/projects/app/internal/showcase.tsx +43 -0
- package/templates/projects/app/not-found.tsx +1 -3
- package/templates/projects/app/projects/[id]/project-view.tsx +9 -14
- package/templates/projects/app/robots.ts +1 -1
- package/templates/projects/components/app-shell.tsx +25 -26
- package/templates/projects/components/record-dialog.tsx +10 -11
- package/templates/projects/components/time-dialog.tsx +6 -8
- package/templates/projects/components/ui/button.tsx +22 -20
- package/templates/projects/components/ui/dialog.tsx +77 -64
- package/templates/projects/components/ui/input.tsx +5 -5
- package/templates/projects/components/ui/label.tsx +5 -3
- package/templates/projects/components/ui/select.tsx +81 -19
- package/templates/projects/components/ui/sheet.tsx +64 -0
- package/templates/projects/components/ui/textarea.tsx +5 -3
- package/templates/projects/lib/utils.ts +4 -4
- package/templates/projects/package.json +4 -4
- package/templates/restaurant/AGENTS.md +17 -0
- package/templates/restaurant/app/globals.css +5 -1
- package/templates/restaurant/app/internal/components/page.tsx +248 -0
- package/templates/restaurant/app/internal/design/page.tsx +168 -0
- package/templates/restaurant/app/internal/layout.tsx +89 -0
- package/templates/restaurant/app/internal/sections.ts +26 -0
- package/templates/restaurant/app/internal/showcase.tsx +43 -0
- package/templates/restaurant/app/robots.ts +1 -1
- package/templates/restaurant/components/ui/button.tsx +22 -20
- package/templates/restaurant/components/ui/dialog.tsx +77 -64
- package/templates/restaurant/components/ui/input.tsx +5 -5
- package/templates/restaurant/components/ui/label.tsx +5 -3
- package/templates/restaurant/components/ui/select.tsx +81 -19
- package/templates/restaurant/components/ui/textarea.tsx +5 -3
- package/templates/restaurant/lib/utils.ts +4 -4
- package/templates/restaurant/package.json +4 -4
- package/templates/saas/AGENTS.md +17 -0
- package/templates/saas/README.md +1 -1
- package/templates/saas/app/(marketing)/not-found.tsx +1 -3
- package/templates/saas/app/dashboard/board-client.tsx +32 -42
- package/templates/saas/app/globals.css +9 -7
- package/templates/saas/app/internal/components/page.tsx +282 -0
- package/templates/saas/app/internal/design/page.tsx +168 -0
- package/templates/saas/app/internal/layout.tsx +89 -0
- package/templates/saas/app/internal/sections.ts +27 -0
- package/templates/saas/app/internal/showcase.tsx +43 -0
- package/templates/saas/app/robots.ts +1 -1
- package/templates/saas/components/dashboard-shell.tsx +28 -21
- package/templates/saas/components/ui/button.tsx +22 -20
- package/templates/saas/components/ui/dialog.tsx +77 -64
- package/templates/saas/components/ui/input.tsx +5 -5
- package/templates/saas/components/ui/label.tsx +5 -3
- package/templates/saas/components/ui/select.tsx +81 -19
- package/templates/saas/components/ui/sheet.tsx +64 -0
- package/templates/saas/components/ui/textarea.tsx +5 -3
- package/templates/saas/lib/utils.ts +4 -4
- package/templates/saas/package.json +4 -4
- package/templates/shop/AGENTS.md +17 -0
- package/templates/shop/app/globals.css +5 -1
- package/templates/shop/app/internal/components/page.tsx +248 -0
- package/templates/shop/app/internal/design/page.tsx +173 -0
- package/templates/shop/app/internal/layout.tsx +89 -0
- package/templates/shop/app/internal/sections.ts +26 -0
- package/templates/shop/app/internal/showcase.tsx +43 -0
- package/templates/shop/app/robots.ts +1 -1
- package/templates/shop/components/ui/button.tsx +22 -20
- package/templates/shop/components/ui/dialog.tsx +77 -64
- package/templates/shop/components/ui/input.tsx +5 -5
- package/templates/shop/components/ui/label.tsx +5 -3
- package/templates/shop/components/ui/select.tsx +81 -19
- package/templates/shop/components/ui/textarea.tsx +5 -3
- package/templates/shop/lib/utils.ts +4 -4
- package/templates/shop/package.json +4 -4
- package/templates/todo/AGENTS.md +17 -0
- package/templates/todo/README.md +7 -4
- package/templates/todo/app/(app)/layout.tsx +16 -0
- package/templates/todo/app/{page.tsx → (app)/page.tsx} +2 -2
- package/templates/todo/app/error.tsx +1 -1
- package/templates/todo/app/globals.css +9 -7
- package/templates/todo/app/internal/components/page.tsx +248 -0
- package/templates/todo/app/internal/design/page.tsx +165 -0
- package/templates/todo/app/internal/layout.tsx +89 -0
- package/templates/todo/app/internal/sections.ts +26 -0
- package/templates/todo/app/internal/showcase.tsx +43 -0
- package/templates/todo/app/layout.tsx +5 -7
- package/templates/todo/app/not-found.tsx +2 -4
- package/templates/todo/app/robots.ts +1 -1
- package/templates/todo/components/ui/button.tsx +22 -20
- package/templates/todo/components/ui/dialog.tsx +77 -64
- package/templates/todo/components/ui/input.tsx +5 -5
- package/templates/todo/components/ui/label.tsx +5 -3
- package/templates/todo/components/ui/select.tsx +81 -19
- package/templates/todo/components/ui/textarea.tsx +5 -3
- package/templates/todo/lib/utils.ts +4 -4
- package/templates/todo/package.json +4 -4
- package/templates/waitlist/AGENTS.md +17 -0
- package/templates/waitlist/app/globals.css +5 -1
- package/templates/waitlist/app/internal/components/page.tsx +248 -0
- package/templates/waitlist/app/internal/design/page.tsx +173 -0
- package/templates/waitlist/app/internal/layout.tsx +89 -0
- package/templates/waitlist/app/internal/sections.ts +26 -0
- package/templates/waitlist/app/internal/showcase.tsx +43 -0
- package/templates/waitlist/app/robots.ts +1 -1
- package/templates/waitlist/components/ui/button.tsx +22 -20
- package/templates/waitlist/components/ui/dialog.tsx +77 -64
- package/templates/waitlist/components/ui/input.tsx +5 -5
- package/templates/waitlist/components/ui/label.tsx +5 -3
- package/templates/waitlist/components/ui/select.tsx +81 -19
- package/templates/waitlist/components/ui/textarea.tsx +5 -3
- package/templates/waitlist/lib/utils.ts +4 -4
- package/templates/waitlist/package.json +4 -4
- package/templates/agency/components.json +0 -20
- package/templates/ai-chat/components.json +0 -20
- package/templates/ai-studio/components.json +0 -20
- package/templates/backend/b2b/apps/api/functions/archiveProject.ts +0 -13
- package/templates/backend/b2b/apps/api/functions/createOrg.ts +0 -44
- package/templates/backend/b2b/apps/api/functions/createProject.ts +0 -22
- package/templates/backend/b2b/apps/api/functions/inviteMember.ts +0 -41
- package/templates/backend/b2b/apps/api/functions/myOrgs.ts +0 -37
- package/templates/backend/b2b/apps/api/functions/orgMembers.ts +0 -13
- package/templates/backend/b2b/apps/api/functions/orgProjects.ts +0 -15
- package/templates/backend/b2b/apps/api/functions/removeMember.ts +0 -25
- package/templates/backend/b2b/apps/api/functions/setMemberRole.ts +0 -33
- package/templates/backend/b2b/apps/api/package.json +0 -20
- package/templates/backend/b2b/apps/api/schema.ts +0 -182
- package/templates/backend/b2b/apps/api/tsconfig.json +0 -13
- package/templates/backend/barebones/apps/api/functions/createWidget.ts +0 -26
- package/templates/backend/barebones/apps/api/functions/listWidgets.ts +0 -19
- package/templates/backend/barebones/apps/api/package.json +0 -20
- package/templates/backend/barebones/apps/api/schema.ts +0 -64
- package/templates/backend/barebones/apps/api/tsconfig.json +0 -13
- package/templates/backend/chat/apps/api/functions/createRoom.ts +0 -32
- package/templates/backend/chat/apps/api/functions/listRooms.ts +0 -15
- package/templates/backend/chat/apps/api/functions/roomMessages.ts +0 -20
- package/templates/backend/chat/apps/api/functions/sendMessage.ts +0 -37
- package/templates/backend/chat/apps/api/package.json +0 -20
- package/templates/backend/chat/apps/api/schema.ts +0 -99
- package/templates/backend/chat/apps/api/tsconfig.json +0 -13
- package/templates/backend/todo/apps/api/functions/addTodo.ts +0 -31
- package/templates/backend/todo/apps/api/functions/deleteTodo.ts +0 -15
- package/templates/backend/todo/apps/api/functions/editTodo.ts +0 -17
- package/templates/backend/todo/apps/api/functions/listTodos.ts +0 -25
- package/templates/backend/todo/apps/api/functions/reorderTodo.ts +0 -15
- package/templates/backend/todo/apps/api/functions/toggleTodo.ts +0 -14
- package/templates/backend/todo/apps/api/package.json +0 -20
- package/templates/backend/todo/apps/api/schema.ts +0 -88
- package/templates/backend/todo/apps/api/tsconfig.json +0 -13
- package/templates/barebones/components.json +0 -20
- package/templates/chat/components.json +0 -20
- package/templates/consumer/components.json +0 -20
- package/templates/creator/components.json +0 -20
- package/templates/crm/components.json +0 -20
- package/templates/directory/components.json +0 -20
- package/templates/expo/barebones/apps/expo/App.tsx +0 -166
- package/templates/expo/barebones/apps/expo/app.json +0 -31
- package/templates/expo/barebones/apps/expo/babel.config.js +0 -6
- package/templates/expo/barebones/apps/expo/package.json +0 -31
- package/templates/expo/barebones/apps/expo/tsconfig.json +0 -16
- package/templates/expo/chat/apps/expo/App.tsx +0 -391
- package/templates/expo/chat/apps/expo/app.json +0 -25
- package/templates/expo/chat/apps/expo/babel.config.js +0 -6
- package/templates/expo/chat/apps/expo/package.json +0 -32
- package/templates/expo/chat/apps/expo/tsconfig.json +0 -16
- package/templates/expo/todo/apps/expo/App.tsx +0 -287
- package/templates/expo/todo/apps/expo/app.json +0 -25
- package/templates/expo/todo/apps/expo/babel.config.js +0 -6
- package/templates/expo/todo/apps/expo/package.json +0 -31
- package/templates/expo/todo/apps/expo/tsconfig.json +0 -16
- package/templates/helpdesk/components.json +0 -20
- package/templates/imessage/components.json +0 -20
- package/templates/inventory/components.json +0 -20
- package/templates/invoices/components.json +0 -20
- package/templates/ios/barebones/apps/ios/Package.swift +0 -34
- package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/ContentView.swift +0 -98
- package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -17
- package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -34
- package/templates/ios/barebones/apps/ios/project.yml +0 -42
- package/templates/ios/chat/apps/ios/Package.swift +0 -24
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/ChatRootView.swift +0 -116
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -26
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/RoomView.swift +0 -136
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -58
- package/templates/ios/chat/apps/ios/project.yml +0 -44
- package/templates/ios/todo/apps/ios/Package.swift +0 -23
- package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -18
- package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/TodoListView.swift +0 -230
- package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -28
- package/templates/ios/todo/apps/ios/project.yml +0 -32
- package/templates/local-service/components.json +0 -20
- package/templates/mac/b2b/apps/mac/Package.swift +0 -22
- package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -15
- package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/OrgPickerView.swift +0 -178
- package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
- package/templates/mac/b2b/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/b2b/apps/mac/project.yml +0 -34
- package/templates/mac/barebones/apps/mac/Package.swift +0 -33
- package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/ContentView.swift +0 -104
- package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -17
- package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
- package/templates/mac/barebones/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/barebones/apps/mac/project.yml +0 -34
- package/templates/mac/chat/apps/mac/Package.swift +0 -34
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/ChatRootView.swift +0 -143
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -26
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/RoomView.swift +0 -136
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -58
- package/templates/mac/chat/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/chat/apps/mac/project.yml +0 -36
- package/templates/mac/consumer/apps/mac/Package.swift +0 -34
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/FeedView.swift +0 -199
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -34
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/ProfileSetupView.swift +0 -68
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/RootView.swift +0 -40
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -59
- package/templates/mac/consumer/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/consumer/apps/mac/project.yml +0 -36
- package/templates/mac/todo/apps/mac/Package.swift +0 -33
- package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -19
- package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/TodoListView.swift +0 -244
- package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
- package/templates/mac/todo/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/todo/apps/mac/project.yml +0 -34
- package/templates/marketplace/components/ui/native-select.tsx +0 -62
- package/templates/marketplace/components.json +0 -20
- package/templates/projects/components.json +0 -20
- package/templates/restaurant/components.json +0 -20
- package/templates/saas/components.json +0 -20
- package/templates/shop/components.json +0 -20
- package/templates/todo/components.json +0 -20
- package/templates/ui/packages/ui/package.json +0 -26
- package/templates/ui/packages/ui/src/button.tsx +0 -44
- package/templates/ui/packages/ui/src/card.tsx +0 -39
- package/templates/ui/packages/ui/src/cn.ts +0 -12
- package/templates/ui/packages/ui/src/index.ts +0 -4
- package/templates/ui/packages/ui/src/input.tsx +0 -19
- package/templates/ui/packages/ui/tsconfig.json +0 -15
- package/templates/vite/todo/apps/web/index.html +0 -12
- package/templates/vite/todo/apps/web/package.json +0 -31
- package/templates/vite/todo/apps/web/src/App.tsx +0 -16
- package/templates/vite/todo/apps/web/src/components/TodoList.tsx +0 -281
- package/templates/vite/todo/apps/web/src/index.css +0 -14
- package/templates/vite/todo/apps/web/src/main.tsx +0 -20
- package/templates/vite/todo/apps/web/tsconfig.json +0 -24
- package/templates/vite/todo/apps/web/vite.config.ts +0 -41
- package/templates/waitlist/components.json +0 -20
- package/templates/web/b2b/apps/web/next-env.d.ts +0 -2
- package/templates/web/b2b/apps/web/next.config.ts +0 -24
- package/templates/web/b2b/apps/web/package.json +0 -27
- package/templates/web/b2b/apps/web/postcss.config.mjs +0 -3
- package/templates/web/b2b/apps/web/src/app/components/OrgPicker.tsx +0 -171
- package/templates/web/b2b/apps/web/src/app/globals.css +0 -6
- package/templates/web/b2b/apps/web/src/app/layout.tsx +0 -21
- package/templates/web/b2b/apps/web/src/app/page.tsx +0 -39
- package/templates/web/b2b/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/b2b/apps/web/tsconfig.json +0 -26
- package/templates/web/barebones/apps/web/next-env.d.ts +0 -2
- package/templates/web/barebones/apps/web/next.config.ts +0 -40
- package/templates/web/barebones/apps/web/package.json +0 -27
- package/templates/web/barebones/apps/web/postcss.config.mjs +0 -3
- package/templates/web/barebones/apps/web/src/app/components/WidgetList.tsx +0 -81
- package/templates/web/barebones/apps/web/src/app/globals.css +0 -6
- package/templates/web/barebones/apps/web/src/app/layout.tsx +0 -21
- package/templates/web/barebones/apps/web/src/app/page.tsx +0 -43
- package/templates/web/barebones/apps/web/src/lib/pylon.ts +0 -14
- package/templates/web/barebones/apps/web/tsconfig.json +0 -26
- package/templates/web/chat/apps/web/next-env.d.ts +0 -2
- package/templates/web/chat/apps/web/next.config.ts +0 -24
- package/templates/web/chat/apps/web/package.json +0 -27
- package/templates/web/chat/apps/web/postcss.config.mjs +0 -3
- package/templates/web/chat/apps/web/src/app/components/ChatRoom.tsx +0 -231
- package/templates/web/chat/apps/web/src/app/globals.css +0 -6
- package/templates/web/chat/apps/web/src/app/layout.tsx +0 -22
- package/templates/web/chat/apps/web/src/app/page.tsx +0 -12
- package/templates/web/chat/apps/web/src/app/providers.tsx +0 -25
- package/templates/web/chat/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/chat/apps/web/tsconfig.json +0 -26
- package/templates/web/consumer/apps/web/next-env.d.ts +0 -2
- package/templates/web/consumer/apps/web/next.config.ts +0 -24
- package/templates/web/consumer/apps/web/package.json +0 -27
- package/templates/web/consumer/apps/web/postcss.config.mjs +0 -3
- package/templates/web/consumer/apps/web/src/app/components/Feed.tsx +0 -315
- package/templates/web/consumer/apps/web/src/app/globals.css +0 -6
- package/templates/web/consumer/apps/web/src/app/layout.tsx +0 -22
- package/templates/web/consumer/apps/web/src/app/page.tsx +0 -21
- package/templates/web/consumer/apps/web/src/app/providers.tsx +0 -25
- package/templates/web/consumer/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/consumer/apps/web/tsconfig.json +0 -26
- package/templates/web/todo/apps/web/next-env.d.ts +0 -2
- package/templates/web/todo/apps/web/next.config.ts +0 -26
- package/templates/web/todo/apps/web/package.json +0 -30
- package/templates/web/todo/apps/web/postcss.config.mjs +0 -3
- package/templates/web/todo/apps/web/src/app/components/TodoList.tsx +0 -310
- package/templates/web/todo/apps/web/src/app/globals.css +0 -6
- package/templates/web/todo/apps/web/src/app/layout.tsx +0 -21
- package/templates/web/todo/apps/web/src/app/page.tsx +0 -36
- package/templates/web/todo/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/todo/apps/web/tsconfig.json +0 -26
- /package/templates/barebones/app/{items-client.tsx → (app)/items-client.tsx} +0 -0
- /package/templates/marketplace/{app/_components → components}/CategoryIcon.tsx +0 -0
- /package/templates/todo/app/{todo-app.tsx → (app)/todo-app.tsx} +0 -0
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
"@pylonsync/client": "^__PYLON_VERSION__",
|
|
17
17
|
"react": "^19.0.0",
|
|
18
18
|
"react-dom": "^19.0.0",
|
|
19
|
+
"@ui-sdk/core": "0.1.0-beta.12",
|
|
20
|
+
"@ui-sdk/react": "0.1.0-beta.12",
|
|
19
21
|
"tailwindcss": "^4.3.0",
|
|
20
22
|
"@tailwindcss/cli": "^4.3.0",
|
|
21
23
|
"tw-animate-css": "^1.2.0",
|
|
22
24
|
"class-variance-authority": "^0.7.1",
|
|
23
25
|
"clsx": "^2.1.1",
|
|
24
26
|
"tailwind-merge": "^2.5.0",
|
|
25
|
-
"lucide-react": "^0.460.0"
|
|
26
|
-
"@radix-ui/react-dialog": "^1.1.4",
|
|
27
|
-
"@radix-ui/react-slot": "^1.1.0"
|
|
27
|
+
"lucide-react": "^0.460.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@happy-dom/global-registrator": "^21.0.4",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@testing-library/dom": "^10.4.0",
|
|
33
33
|
"@testing-library/react": "^16.3.0",
|
|
34
34
|
"@types/node": "^22.0.0",
|
|
35
|
-
"@types/react": "^19.
|
|
35
|
+
"@types/react": "^19.2.10",
|
|
36
36
|
"@types/react-dom": "^19.0.0",
|
|
37
37
|
"typescript": "^5.6.0"
|
|
38
38
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterEach, describe, expect, test } from "bun:test";
|
|
2
2
|
// This project uses the classic JSX transform, so .tsx tests import React.
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
|
|
4
|
+
import { act, cleanup, fireEvent, render, screen } from "@testing-library/react";
|
|
5
5
|
import { StockLevel } from "../components/stock-level";
|
|
6
6
|
import { MovementDialog } from "../components/movement-dialog";
|
|
7
7
|
|
|
@@ -32,10 +32,23 @@ describe("StockLevel", () => {
|
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
+
// Open the select that a label names, then pick the option with this text.
|
|
36
|
+
async function pick(label: string, option: string) {
|
|
37
|
+
const id = screen.getByText(label, { selector: "label" }).getAttribute("for");
|
|
38
|
+
const trigger = document.getElementById(id ?? "");
|
|
39
|
+
if (!trigger) throw new Error(`no select for the label "${label}"`);
|
|
40
|
+
await act(async () => {
|
|
41
|
+
fireEvent.click(trigger);
|
|
42
|
+
});
|
|
43
|
+
await act(async () => {
|
|
44
|
+
fireEvent.click(screen.getByRole("option", { name: option }));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
35
48
|
describe("MovementDialog", () => {
|
|
36
49
|
const level = (id: string) => (id === "p1" ? 12 : 0);
|
|
37
50
|
|
|
38
|
-
test("a sale is recorded as a negative delta from a positive input", () => {
|
|
51
|
+
test("a sale is recorded as a negative delta from a positive input", async () => {
|
|
39
52
|
// Asking someone to type "-3" is how you get a "+3" sale.
|
|
40
53
|
const recorded: unknown[] = [];
|
|
41
54
|
render(
|
|
@@ -47,14 +60,14 @@ describe("MovementDialog", () => {
|
|
|
47
60
|
onRecord={(id, delta, reason) => recorded.push([id, delta, reason])}
|
|
48
61
|
/>,
|
|
49
62
|
);
|
|
50
|
-
|
|
51
|
-
|
|
63
|
+
await pick("Product", "CFE-001 · House Blend");
|
|
64
|
+
await pick("Reason", "Sold");
|
|
52
65
|
fireEvent.change(screen.getByLabelText("Quantity"), { target: { value: "3" } });
|
|
53
66
|
fireEvent.click(screen.getByRole("button", { name: /^record$/i }));
|
|
54
67
|
expect(recorded).toEqual([["p1", -3, "sold"]]);
|
|
55
68
|
});
|
|
56
69
|
|
|
57
|
-
test("a receipt is positive", () => {
|
|
70
|
+
test("a receipt is positive", async () => {
|
|
58
71
|
const recorded: unknown[] = [];
|
|
59
72
|
render(
|
|
60
73
|
<MovementDialog
|
|
@@ -65,13 +78,13 @@ describe("MovementDialog", () => {
|
|
|
65
78
|
onRecord={(id, delta) => recorded.push(delta)}
|
|
66
79
|
/>,
|
|
67
80
|
);
|
|
68
|
-
|
|
81
|
+
await pick("Product", "CFE-001 · House Blend");
|
|
69
82
|
fireEvent.change(screen.getByLabelText("Quantity"), { target: { value: "10" } });
|
|
70
83
|
fireEvent.click(screen.getByRole("button", { name: /^record$/i }));
|
|
71
84
|
expect(recorded).toEqual([10]);
|
|
72
85
|
});
|
|
73
86
|
|
|
74
|
-
test("a stock count sets the level, so it sends the difference", () => {
|
|
87
|
+
test("a stock count sets the level, so it sends the difference", async () => {
|
|
75
88
|
// Counting a shelf produces "there are 9", not "adjust by -3".
|
|
76
89
|
const recorded: unknown[] = [];
|
|
77
90
|
render(
|
|
@@ -83,14 +96,14 @@ describe("MovementDialog", () => {
|
|
|
83
96
|
onRecord={(id, delta) => recorded.push(delta)}
|
|
84
97
|
/>,
|
|
85
98
|
);
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
await pick("Product", "CFE-001 · House Blend");
|
|
100
|
+
await pick("Reason", "Stock count");
|
|
88
101
|
fireEvent.change(screen.getByLabelText("Counted"), { target: { value: "9" } });
|
|
89
102
|
fireEvent.click(screen.getByRole("button", { name: /^record$/i }));
|
|
90
103
|
expect(recorded).toEqual([-3]);
|
|
91
104
|
});
|
|
92
105
|
|
|
93
|
-
test("refuses to take stock below zero", () => {
|
|
106
|
+
test("refuses to take stock below zero", async () => {
|
|
94
107
|
const recorded: unknown[] = [];
|
|
95
108
|
render(
|
|
96
109
|
<MovementDialog
|
|
@@ -101,15 +114,15 @@ describe("MovementDialog", () => {
|
|
|
101
114
|
onRecord={(id, delta) => recorded.push(delta)}
|
|
102
115
|
/>,
|
|
103
116
|
);
|
|
104
|
-
|
|
105
|
-
|
|
117
|
+
await pick("Product", "PKG-011 · Lids");
|
|
118
|
+
await pick("Reason", "Sold");
|
|
106
119
|
fireEvent.change(screen.getByLabelText("Quantity"), { target: { value: "1" } });
|
|
107
120
|
fireEvent.click(screen.getByRole("button", { name: /^record$/i }));
|
|
108
121
|
expect(recorded).toEqual([]);
|
|
109
122
|
expect(screen.getByText(/below zero/i)).toBeDefined();
|
|
110
123
|
});
|
|
111
124
|
|
|
112
|
-
test("shows what the level will become", () => {
|
|
125
|
+
test("shows what the level will become", async () => {
|
|
113
126
|
render(
|
|
114
127
|
<MovementDialog
|
|
115
128
|
open
|
|
@@ -119,7 +132,7 @@ describe("MovementDialog", () => {
|
|
|
119
132
|
onRecord={() => {}}
|
|
120
133
|
/>,
|
|
121
134
|
);
|
|
122
|
-
|
|
135
|
+
await pick("Product", "CFE-001 · House Blend");
|
|
123
136
|
fireEvent.change(screen.getByLabelText("Quantity"), { target: { value: "5" } });
|
|
124
137
|
expect(screen.getByText(/On hand 12 → 17/)).toBeDefined();
|
|
125
138
|
});
|
|
@@ -25,6 +25,8 @@ this pass before the user has to ask.
|
|
|
25
25
|
- `app.ts`: data model + manifest (`entity()` + `field.*`, queries/actions/policies, `routes: await discoverAppRoutes()`). Ends with `console.log(JSON.stringify(manifest))` — that line is the manifest handoff (the CLI parses this file's stdout), not debug output. Never remove it.
|
|
26
26
|
- `app/`: file-based SSR routes. `app/page.tsx` → `/`, `app/about/page.tsx` → `/about`, `app/blog/[slug]/page.tsx` → `/blog/:slug`. A `(group)` directory is stripped from the URL — `app/(marketing)/about/page.tsx` still serves `/about` — so a group's `layout.tsx` gives one section its own chrome (nav, footer) without changing any path; routes outside the group render without it. `app/layout.tsx` is the document shell; `app/error.tsx` / `app/not-found.tsx` are boundaries.
|
|
27
27
|
- `app/globals.css`: Tailwind v4 entrypoint (auto-compiled and injected).
|
|
28
|
+
- `components/`: reusable React components. `components/ui/` holds the primitives, built on `@ui-sdk/react`.
|
|
29
|
+
- `app/internal/`: `/internal/design` shows the design tokens and `/internal/components` shows every component. See "UI: design tokens and components".
|
|
28
30
|
- `functions/`: server functions, one per file, `default`-exported.
|
|
29
31
|
- `.pylon/`: local dev state (SQLite, jobs, sessions, uploads). Created by `pylon dev`. Do not commit.
|
|
30
32
|
|
|
@@ -68,6 +70,21 @@ this pass before the user has to ask.
|
|
|
68
70
|
- **It's `db.useQueryOne`, not `useOne`.** Validators and field types have aliases: `v.bool`/`v.boolean`, `v.float`/`v.number`.
|
|
69
71
|
- **Use the supported file and scheduling APIs.** Files go through `<FileUpload>` and `/api/files/*`; an upload is readable by its uploader only, so pass `visibility: "public"` to `uploadFile` or `<FileUpload>` for files every visitor sees; there is no `ctx.files`. One-shot work uses `ctx.scheduler.runAfter`, `runAt`, or `cancel`; there is no `defineWorkflow` or `defineJob`. Recurring work uses `cron("0 * * * *", "fnName")` in `buildManifest({ crons: [...] })`, imported from `@pylonsync/sdk`. Make the target function `internal: true`. It runs with anonymous auth, but its own `ctx.db.*` calls are server-side and bypass policies. Use `ctx.auth.elevate({ admin: true, reason: "..." })`, with a mandatory reason, only when chaining another internal function through `ctx.scheduler`.
|
|
70
72
|
|
|
73
|
+
## UI: design tokens and components
|
|
74
|
+
|
|
75
|
+
Every screen is built from reusable components. Before you write UI, open `/internal/components` (the component gallery) and `/internal/design` (the design tokens) in the running app.
|
|
76
|
+
|
|
77
|
+
- **Reuse first.** Look in `components/` and on `/internal/components` before you write markup. If a component exists, use it. If it almost fits, extend it with a variant or a prop. Do not copy its markup into a page.
|
|
78
|
+
- **A page composes components.** A `page.tsx` holds data loading and layout. When the same markup appears a second time, move it into a component.
|
|
79
|
+
- **Two levels.** `components/ui/` holds primitives (Button, Dialog, Select). A primitive has no app data and makes no `db.*` or `callFn` call. `components/` holds the components of this product, built from the primitives.
|
|
80
|
+
- **Compose, do not configure.** Build a component from small parts that nest (`Card`, `CardHeader`, `CardTitle`) and accept `children`. Do not add a boolean prop for each layout variation. Each component accepts `className` and passes its other props to its root element. A visual variation is a `cva` variant.
|
|
81
|
+
- **Behavior comes from ui-sdk.** Build interactive primitives (dialogs, menus, selects, tabs, tooltips, comboboxes) on `@ui-sdk/react` parts. Do not write focus handling, keyboard navigation or ARIA attributes by hand, and do not add a second component library. Read `node_modules/@ui-sdk/react/docs/llms.txt` first, then the page of each component you use in `node_modules/@ui-sdk/react/docs/components/`. For a behavior with no ready-made component, read `core.md` and `rendering.md` in the same `docs/` directory.
|
|
82
|
+
- **ui-sdk conventions.** Import each component from its own entry (`@ui-sdk/react/dialog`). The parts have no styles. Style them with Tailwind classes and their state attributes (`data-open`, `data-disabled`, `data-highlighted`, `data-starting-style`, `data-ending-style`). To render a part as a different element, pass the element to `render`: `<Button render={<Link href="/" />}>Home</Button>`. There is no `asChild` prop. `@layer ui-sdk;` stays the first line of `app/globals.css`.
|
|
83
|
+
- **Tokens only.** Colors, radii and shadows come from the tokens in `app/globals.css` (`bg-primary`, `text-muted-foreground`, `rounded-lg`). Do not write a hex color in a new component. To add a token, add it to `app/globals.css` and to `app/internal/design/page.tsx`.
|
|
84
|
+
- **Keep the gallery current.** When you add or change a component, update its `Showcase` in `app/internal/components/page.tsx` and its entry in `app/internal/sections.ts` in the same change. Show each variant and each state.
|
|
85
|
+
|
|
86
|
+
The product does not link to `/internal/*`, and `app/robots.ts` and the page metadata keep search engines out. The pages are open to anyone who has the URL. To restrict them, read `auth` in `app/internal/layout.tsx` and call `response.notFound()`.
|
|
87
|
+
|
|
71
88
|
## Testing
|
|
72
89
|
|
|
73
90
|
`pylon test` discovers every `*.test.ts` / `*.test.tsx` file under `tests/` (or `functions/`) and runs it with **Bun's test runner** (`import { test, expect } from "bun:test"`). Run the suite with `pylon test` (or `npm test`); filter with `pylon test <substring>`. This template ships `bunfig.toml` + `tests/setup.ts` (registers happy-dom) so component tests render out of the box, plus starter tests under `tests/`; replace them with your own.
|
|
@@ -70,7 +70,7 @@ app/
|
|
|
70
70
|
clients/ client list
|
|
71
71
|
login/ email/password auth
|
|
72
72
|
components/ presentational — props in, callbacks out
|
|
73
|
-
ui/
|
|
73
|
+
ui/ primitives built on @ui-sdk/react
|
|
74
74
|
lib/billing.ts money, totals, ageing, numbering — pure
|
|
75
75
|
lib/format.ts time + initials — pure
|
|
76
76
|
functions/ server functions
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/* ui-sdk adds a small amount of CSS in this layer. The layer is declared
|
|
2
|
+
first so that every style in this file wins over it. */
|
|
3
|
+
@layer ui-sdk;
|
|
4
|
+
|
|
1
5
|
@import "tailwindcss";
|
|
2
6
|
@import "tw-animate-css";
|
|
3
7
|
|
|
@@ -14,8 +18,7 @@
|
|
|
14
18
|
still means something. Light is the default; `.dark` holds a complete dark
|
|
15
19
|
set (add `class="dark"` to <html> in app/layout.tsx to switch).
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
`npx shadcn@latest add <component>` drops in already themed.
|
|
21
|
+
`/internal/design` shows every token.
|
|
19
22
|
--------------------------------------------------------------------------- */
|
|
20
23
|
:root {
|
|
21
24
|
/* The brand accent: primary buttons, the brand mark, focus rings, and the
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type Metadata } from "@pylonsync/react";
|
|
3
|
+
import { Badge } from "@/components/ui/badge";
|
|
4
|
+
import { Button } from "@/components/ui/button";
|
|
5
|
+
import {
|
|
6
|
+
Card,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardDescription,
|
|
9
|
+
CardFooter,
|
|
10
|
+
CardHeader,
|
|
11
|
+
CardTitle,
|
|
12
|
+
} from "@/components/ui/card";
|
|
13
|
+
import {
|
|
14
|
+
Dialog,
|
|
15
|
+
DialogClose,
|
|
16
|
+
DialogContent,
|
|
17
|
+
DialogDescription,
|
|
18
|
+
DialogFooter,
|
|
19
|
+
DialogHeader,
|
|
20
|
+
DialogTitle,
|
|
21
|
+
DialogTrigger,
|
|
22
|
+
} from "@/components/ui/dialog";
|
|
23
|
+
import { Input } from "@/components/ui/input";
|
|
24
|
+
import { Label } from "@/components/ui/label";
|
|
25
|
+
import { Select } from "@/components/ui/select";
|
|
26
|
+
import {
|
|
27
|
+
Sheet,
|
|
28
|
+
SheetClose,
|
|
29
|
+
SheetContent,
|
|
30
|
+
SheetDescription,
|
|
31
|
+
SheetTitle,
|
|
32
|
+
SheetTrigger,
|
|
33
|
+
} from "@/components/ui/sheet";
|
|
34
|
+
import {
|
|
35
|
+
Table,
|
|
36
|
+
TableBody,
|
|
37
|
+
TableCell,
|
|
38
|
+
TableHead,
|
|
39
|
+
TableHeader,
|
|
40
|
+
TableRow,
|
|
41
|
+
} from "@/components/ui/table";
|
|
42
|
+
import { Textarea } from "@/components/ui/textarea";
|
|
43
|
+
import { Example, Showcase } from "../showcase";
|
|
44
|
+
|
|
45
|
+
export const metadata: Metadata = {
|
|
46
|
+
title: "Components",
|
|
47
|
+
robots: "noindex, nofollow",
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// `/internal/components` shows every reusable component in `components/`.
|
|
51
|
+
// Look here before you write UI. When you add a component, add a `Showcase`
|
|
52
|
+
// for it in the same commit.
|
|
53
|
+
|
|
54
|
+
const PLANS = [
|
|
55
|
+
{ value: "free", label: "Free" },
|
|
56
|
+
{ value: "pro", label: "Pro" },
|
|
57
|
+
{ value: "team", label: "Team" },
|
|
58
|
+
{ value: "enterprise", label: "Enterprise", disabled: true },
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
const OWNERS = [
|
|
62
|
+
{ value: "", label: "Unassigned" },
|
|
63
|
+
{ value: "ada", label: "Ada" },
|
|
64
|
+
{ value: "grace", label: "Grace" },
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
export default function ComponentsPage() {
|
|
68
|
+
return (
|
|
69
|
+
<div className="flex flex-col gap-10">
|
|
70
|
+
<header className="flex flex-col gap-2">
|
|
71
|
+
<h1 className="text-3xl font-semibold tracking-tight">Components</h1>
|
|
72
|
+
<p className="text-sm text-muted-foreground">
|
|
73
|
+
The reusable components in <code>components/</code>. A page composes
|
|
74
|
+
these components. Behavior comes from <code>@ui-sdk/react</code>.
|
|
75
|
+
Styles come from the design tokens.
|
|
76
|
+
</p>
|
|
77
|
+
</header>
|
|
78
|
+
|
|
79
|
+
<Showcase
|
|
80
|
+
id="button"
|
|
81
|
+
title="Button"
|
|
82
|
+
source="components/ui/button.tsx"
|
|
83
|
+
description="Use a button to start an action. Use the render prop to show a link as a button."
|
|
84
|
+
>
|
|
85
|
+
<Example label="Variants">
|
|
86
|
+
<Button>Default</Button>
|
|
87
|
+
<Button variant="secondary">Secondary</Button>
|
|
88
|
+
<Button variant="outline">Outline</Button>
|
|
89
|
+
<Button variant="ghost">Ghost</Button>
|
|
90
|
+
<Button variant="link">Link</Button>
|
|
91
|
+
<Button variant="destructive">Destructive</Button>
|
|
92
|
+
</Example>
|
|
93
|
+
<Example label="Sizes">
|
|
94
|
+
<Button size="sm">Small</Button>
|
|
95
|
+
<Button>Default</Button>
|
|
96
|
+
<Button size="lg">Large</Button>
|
|
97
|
+
</Example>
|
|
98
|
+
<Example label="States">
|
|
99
|
+
<Button disabled>Disabled</Button>
|
|
100
|
+
<Button
|
|
101
|
+
onClick={() => new Promise((resolve) => setTimeout(resolve, 1500))}
|
|
102
|
+
pendingAnnouncement="Saving"
|
|
103
|
+
>
|
|
104
|
+
Pending for 1.5 s
|
|
105
|
+
</Button>
|
|
106
|
+
<Button variant="outline" render={<a href="/internal/design" />}>
|
|
107
|
+
Link as button
|
|
108
|
+
</Button>
|
|
109
|
+
</Example>
|
|
110
|
+
</Showcase>
|
|
111
|
+
|
|
112
|
+
<Showcase
|
|
113
|
+
id="badge"
|
|
114
|
+
title="Badge"
|
|
115
|
+
source="components/ui/badge.tsx"
|
|
116
|
+
description="Use a badge to show a short status."
|
|
117
|
+
>
|
|
118
|
+
<Example label="Variants">
|
|
119
|
+
<Badge>Default</Badge>
|
|
120
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
121
|
+
<Badge variant="outline">Outline</Badge>
|
|
122
|
+
<Badge variant="destructive">Destructive</Badge>
|
|
123
|
+
</Example>
|
|
124
|
+
</Showcase>
|
|
125
|
+
|
|
126
|
+
<Showcase
|
|
127
|
+
id="text-fields"
|
|
128
|
+
title="Input, Label and Textarea"
|
|
129
|
+
source="components/ui/input.tsx, label.tsx, textarea.tsx"
|
|
130
|
+
description="Use these components for text entry. Give each control a label."
|
|
131
|
+
>
|
|
132
|
+
<Example label="Input">
|
|
133
|
+
<div className="flex w-full flex-col gap-1.5">
|
|
134
|
+
<Label htmlFor="showcase-email">Email</Label>
|
|
135
|
+
<Input id="showcase-email" type="email" placeholder="you@example.com" />
|
|
136
|
+
</div>
|
|
137
|
+
</Example>
|
|
138
|
+
<Example label="Disabled input">
|
|
139
|
+
<Input aria-label="Disabled input" disabled placeholder="Disabled" />
|
|
140
|
+
</Example>
|
|
141
|
+
<Example label="Textarea">
|
|
142
|
+
<div className="flex w-full flex-col gap-1.5">
|
|
143
|
+
<Label htmlFor="showcase-notes">Notes</Label>
|
|
144
|
+
<Textarea id="showcase-notes" placeholder="Write a note" />
|
|
145
|
+
</div>
|
|
146
|
+
</Example>
|
|
147
|
+
</Showcase>
|
|
148
|
+
|
|
149
|
+
<Showcase
|
|
150
|
+
id="select"
|
|
151
|
+
title="Select"
|
|
152
|
+
source="components/ui/select.tsx"
|
|
153
|
+
description="Use a select to pick one value from a list of options."
|
|
154
|
+
>
|
|
155
|
+
<Example label="With a placeholder">
|
|
156
|
+
<div className="flex w-full flex-col gap-1.5">
|
|
157
|
+
<Label htmlFor="showcase-plan">Plan</Label>
|
|
158
|
+
<Select id="showcase-plan" items={PLANS} placeholder="Select a plan" />
|
|
159
|
+
</div>
|
|
160
|
+
</Example>
|
|
161
|
+
<Example label="With a default value">
|
|
162
|
+
<Select aria-label="Plan" items={PLANS} defaultValue="pro" />
|
|
163
|
+
</Example>
|
|
164
|
+
<Example label="With an option for no value">
|
|
165
|
+
<Select aria-label="Owner" items={OWNERS} defaultValue="" />
|
|
166
|
+
</Example>
|
|
167
|
+
<Example label="Disabled">
|
|
168
|
+
<Select aria-label="Plan" items={PLANS} defaultValue="free" disabled />
|
|
169
|
+
</Example>
|
|
170
|
+
</Showcase>
|
|
171
|
+
|
|
172
|
+
<Showcase
|
|
173
|
+
id="dialog"
|
|
174
|
+
title="Dialog"
|
|
175
|
+
source="components/ui/dialog.tsx"
|
|
176
|
+
description="Use a dialog for a task that needs the full attention of the user."
|
|
177
|
+
>
|
|
178
|
+
<Example label="Default">
|
|
179
|
+
<Dialog>
|
|
180
|
+
<DialogTrigger render={<Button variant="outline" />}>
|
|
181
|
+
Open the dialog
|
|
182
|
+
</DialogTrigger>
|
|
183
|
+
<DialogContent>
|
|
184
|
+
<DialogHeader>
|
|
185
|
+
<DialogTitle>Rename the item</DialogTitle>
|
|
186
|
+
<DialogDescription>
|
|
187
|
+
The new name shows in every list.
|
|
188
|
+
</DialogDescription>
|
|
189
|
+
</DialogHeader>
|
|
190
|
+
<div className="flex flex-col gap-1.5">
|
|
191
|
+
<Label htmlFor="showcase-name">Name</Label>
|
|
192
|
+
<Input id="showcase-name" defaultValue="First item" />
|
|
193
|
+
</div>
|
|
194
|
+
<DialogFooter>
|
|
195
|
+
<DialogClose render={<Button variant="outline" />}>
|
|
196
|
+
Cancel
|
|
197
|
+
</DialogClose>
|
|
198
|
+
<DialogClose render={<Button />}>Save</DialogClose>
|
|
199
|
+
</DialogFooter>
|
|
200
|
+
</DialogContent>
|
|
201
|
+
</Dialog>
|
|
202
|
+
</Example>
|
|
203
|
+
</Showcase>
|
|
204
|
+
|
|
205
|
+
<Showcase
|
|
206
|
+
id="sheet"
|
|
207
|
+
title="Sheet"
|
|
208
|
+
source="components/ui/sheet.tsx"
|
|
209
|
+
description="Use a sheet to show navigation on a small screen."
|
|
210
|
+
>
|
|
211
|
+
<Example label="Default">
|
|
212
|
+
<Sheet>
|
|
213
|
+
<SheetTrigger render={<Button variant="outline" />}>
|
|
214
|
+
Open the sheet
|
|
215
|
+
</SheetTrigger>
|
|
216
|
+
<SheetContent className="flex-col gap-2 p-4">
|
|
217
|
+
<SheetTitle className="text-base font-semibold">
|
|
218
|
+
Navigation
|
|
219
|
+
</SheetTitle>
|
|
220
|
+
<SheetDescription className="text-sm text-muted-foreground">
|
|
221
|
+
Links to the sections of the app.
|
|
222
|
+
</SheetDescription>
|
|
223
|
+
<SheetClose render={<Button variant="outline" size="sm" />}>
|
|
224
|
+
Close
|
|
225
|
+
</SheetClose>
|
|
226
|
+
</SheetContent>
|
|
227
|
+
</Sheet>
|
|
228
|
+
</Example>
|
|
229
|
+
</Showcase>
|
|
230
|
+
|
|
231
|
+
<Showcase
|
|
232
|
+
id="card"
|
|
233
|
+
title="Card"
|
|
234
|
+
source="components/ui/card.tsx"
|
|
235
|
+
description="Use a card to group related content."
|
|
236
|
+
>
|
|
237
|
+
<Card className="w-full">
|
|
238
|
+
<CardHeader>
|
|
239
|
+
<CardTitle>Team plan</CardTitle>
|
|
240
|
+
<CardDescription>10 seats. Billed each month.</CardDescription>
|
|
241
|
+
</CardHeader>
|
|
242
|
+
<CardContent className="text-sm">
|
|
243
|
+
The plan renews on the first day of each month.
|
|
244
|
+
</CardContent>
|
|
245
|
+
<CardFooter>
|
|
246
|
+
<Button size="sm">Change the plan</Button>
|
|
247
|
+
</CardFooter>
|
|
248
|
+
</Card>
|
|
249
|
+
</Showcase>
|
|
250
|
+
|
|
251
|
+
<Showcase
|
|
252
|
+
id="table"
|
|
253
|
+
title="Table"
|
|
254
|
+
source="components/ui/table.tsx"
|
|
255
|
+
description="Use a table to show rows of records."
|
|
256
|
+
>
|
|
257
|
+
<Table>
|
|
258
|
+
<TableHeader>
|
|
259
|
+
<TableRow>
|
|
260
|
+
<TableHead>Name</TableHead>
|
|
261
|
+
<TableHead>Status</TableHead>
|
|
262
|
+
</TableRow>
|
|
263
|
+
</TableHeader>
|
|
264
|
+
<TableBody>
|
|
265
|
+
<TableRow>
|
|
266
|
+
<TableCell>First item</TableCell>
|
|
267
|
+
<TableCell>
|
|
268
|
+
<Badge variant="secondary">Open</Badge>
|
|
269
|
+
</TableCell>
|
|
270
|
+
</TableRow>
|
|
271
|
+
<TableRow>
|
|
272
|
+
<TableCell>Second item</TableCell>
|
|
273
|
+
<TableCell>
|
|
274
|
+
<Badge variant="outline">Closed</Badge>
|
|
275
|
+
</TableCell>
|
|
276
|
+
</TableRow>
|
|
277
|
+
</TableBody>
|
|
278
|
+
</Table>
|
|
279
|
+
</Showcase>
|
|
280
|
+
</div>
|
|
281
|
+
);
|
|
282
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type Metadata } from "@pylonsync/react";
|
|
3
|
+
|
|
4
|
+
export const metadata: Metadata = {
|
|
5
|
+
title: "Design tokens",
|
|
6
|
+
robots: "noindex, nofollow",
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// `/internal/design` shows every design token the app uses. The tokens are the
|
|
10
|
+
// CSS variables in `app/globals.css`. When you add or change a token there,
|
|
11
|
+
// add or change its entry here in the same commit.
|
|
12
|
+
|
|
13
|
+
// One entry for each color token in `app/globals.css`. Each class is written in
|
|
14
|
+
// full so that Tailwind finds it.
|
|
15
|
+
const COLORS = [
|
|
16
|
+
{ token: "background", swatch: "bg-background" },
|
|
17
|
+
{ token: "foreground", swatch: "bg-foreground" },
|
|
18
|
+
{ token: "card", swatch: "bg-card" },
|
|
19
|
+
{ token: "popover", swatch: "bg-popover" },
|
|
20
|
+
{ token: "primary", swatch: "bg-primary" },
|
|
21
|
+
{ token: "secondary", swatch: "bg-secondary" },
|
|
22
|
+
{ token: "muted", swatch: "bg-muted" },
|
|
23
|
+
{ token: "accent", swatch: "bg-accent" },
|
|
24
|
+
{ token: "destructive", swatch: "bg-destructive" },
|
|
25
|
+
{ token: "border", swatch: "bg-border" },
|
|
26
|
+
{ token: "input", swatch: "bg-input" },
|
|
27
|
+
{ token: "ring", swatch: "bg-ring" },
|
|
28
|
+
{ token: "surface-1", swatch: "bg-surface-1" },
|
|
29
|
+
{ token: "surface-2", swatch: "bg-surface-2" },
|
|
30
|
+
{ token: "stage-lead", swatch: "bg-stage-lead" },
|
|
31
|
+
{ token: "stage-qualified", swatch: "bg-stage-qualified" },
|
|
32
|
+
{ token: "stage-proposal", swatch: "bg-stage-proposal" },
|
|
33
|
+
{ token: "stage-negotiation", swatch: "bg-stage-negotiation" },
|
|
34
|
+
{ token: "stage-won", swatch: "bg-stage-won" },
|
|
35
|
+
{ token: "stage-lost", swatch: "bg-stage-lost" },
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const TYPE_SCALE = [
|
|
39
|
+
{ name: "text-4xl", className: "text-4xl font-semibold tracking-tight" },
|
|
40
|
+
{ name: "text-3xl", className: "text-3xl font-semibold tracking-tight" },
|
|
41
|
+
{ name: "text-2xl", className: "text-2xl font-semibold tracking-tight" },
|
|
42
|
+
{ name: "text-xl", className: "text-xl font-semibold" },
|
|
43
|
+
{ name: "text-lg", className: "text-lg font-semibold" },
|
|
44
|
+
{ name: "text-base", className: "text-base" },
|
|
45
|
+
{ name: "text-sm", className: "text-sm" },
|
|
46
|
+
{ name: "text-xs", className: "text-xs" },
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const RADII = [
|
|
50
|
+
{ name: "rounded-sm", className: "rounded-sm" },
|
|
51
|
+
{ name: "rounded-md", className: "rounded-md" },
|
|
52
|
+
{ name: "rounded-lg", className: "rounded-lg" },
|
|
53
|
+
{ name: "rounded-xl", className: "rounded-xl" },
|
|
54
|
+
{ name: "rounded-full", className: "rounded-full" },
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const SPACING = [
|
|
58
|
+
{ name: "1", className: "w-1" },
|
|
59
|
+
{ name: "2", className: "w-2" },
|
|
60
|
+
{ name: "3", className: "w-3" },
|
|
61
|
+
{ name: "4", className: "w-4" },
|
|
62
|
+
{ name: "6", className: "w-6" },
|
|
63
|
+
{ name: "8", className: "w-8" },
|
|
64
|
+
{ name: "12", className: "w-12" },
|
|
65
|
+
{ name: "16", className: "w-16" },
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const SHADOWS = [
|
|
69
|
+
{ name: "shadow-sm", className: "shadow-sm" },
|
|
70
|
+
{ name: "shadow-md", className: "shadow-md" },
|
|
71
|
+
{ name: "shadow-lg", className: "shadow-lg" },
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
function Section({
|
|
75
|
+
id,
|
|
76
|
+
title,
|
|
77
|
+
children,
|
|
78
|
+
}: {
|
|
79
|
+
/** The section id from `sections.ts`. */
|
|
80
|
+
id: string;
|
|
81
|
+
title: string;
|
|
82
|
+
children: React.ReactNode;
|
|
83
|
+
}) {
|
|
84
|
+
return (
|
|
85
|
+
<section id={id} className="flex scroll-mt-10 flex-col gap-3">
|
|
86
|
+
<h2 className="text-lg font-semibold tracking-tight">{title}</h2>
|
|
87
|
+
{children}
|
|
88
|
+
</section>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export default function DesignPage() {
|
|
93
|
+
return (
|
|
94
|
+
<div className="flex flex-col gap-10">
|
|
95
|
+
<header className="flex flex-col gap-2">
|
|
96
|
+
<h1 className="text-3xl font-semibold tracking-tight">Design tokens</h1>
|
|
97
|
+
<p className="text-sm text-muted-foreground">
|
|
98
|
+
The tokens are CSS variables in <code>app/globals.css</code>. Use a
|
|
99
|
+
token class such as <code>bg-primary</code>. Do not write a raw color,
|
|
100
|
+
a raw radius or a raw shadow in a component.
|
|
101
|
+
</p>
|
|
102
|
+
</header>
|
|
103
|
+
|
|
104
|
+
<Section id="color" title="Color">
|
|
105
|
+
<div className="grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4">
|
|
106
|
+
{COLORS.map((color) => (
|
|
107
|
+
<div key={color.token} className="flex flex-col gap-1.5">
|
|
108
|
+
<div className={`h-14 rounded-lg border ${color.swatch}`} />
|
|
109
|
+
<div className="flex flex-col text-xs">
|
|
110
|
+
<span className="font-medium">{color.token}</span>
|
|
111
|
+
<code className="text-muted-foreground">{color.swatch}</code>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
))}
|
|
115
|
+
</div>
|
|
116
|
+
</Section>
|
|
117
|
+
|
|
118
|
+
<Section id="type" title="Type">
|
|
119
|
+
<div className="flex flex-col gap-3">
|
|
120
|
+
{TYPE_SCALE.map((step) => (
|
|
121
|
+
<div key={step.name} className="flex flex-col gap-0.5">
|
|
122
|
+
<span className="text-xs text-muted-foreground">{step.name}</span>
|
|
123
|
+
<span className={step.className}>The quick brown fox</span>
|
|
124
|
+
</div>
|
|
125
|
+
))}
|
|
126
|
+
</div>
|
|
127
|
+
</Section>
|
|
128
|
+
|
|
129
|
+
<Section id="radius" title="Radius">
|
|
130
|
+
<div className="flex flex-wrap gap-4">
|
|
131
|
+
{RADII.map((radius) => (
|
|
132
|
+
<div key={radius.name} className="flex flex-col items-center gap-1.5">
|
|
133
|
+
<div className={`size-14 border bg-muted ${radius.className}`} />
|
|
134
|
+
<span className="text-xs text-muted-foreground">{radius.name}</span>
|
|
135
|
+
</div>
|
|
136
|
+
))}
|
|
137
|
+
</div>
|
|
138
|
+
</Section>
|
|
139
|
+
|
|
140
|
+
<Section id="spacing" title="Spacing">
|
|
141
|
+
<div className="flex flex-col gap-2">
|
|
142
|
+
{SPACING.map((space) => (
|
|
143
|
+
<div key={space.name} className="flex items-center gap-3">
|
|
144
|
+
<span className="w-6 text-xs text-muted-foreground">{space.name}</span>
|
|
145
|
+
<div className={`h-3 rounded-sm bg-primary ${space.className}`} />
|
|
146
|
+
</div>
|
|
147
|
+
))}
|
|
148
|
+
</div>
|
|
149
|
+
</Section>
|
|
150
|
+
|
|
151
|
+
<Section id="shadow" title="Shadow">
|
|
152
|
+
<div className="flex flex-wrap gap-6">
|
|
153
|
+
{SHADOWS.map((shadow) => (
|
|
154
|
+
<div key={shadow.name} className="flex flex-col items-center gap-1.5">
|
|
155
|
+
<div className={`size-14 rounded-lg border bg-card ${shadow.className}`} />
|
|
156
|
+
<span className="text-xs text-muted-foreground">{shadow.name}</span>
|
|
157
|
+
</div>
|
|
158
|
+
))}
|
|
159
|
+
</div>
|
|
160
|
+
</Section>
|
|
161
|
+
</div>
|
|
162
|
+
);
|
|
163
|
+
}
|