create-huenei-template 0.2.13 → 0.2.15
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/dist/config/templates.js +7 -0
- package/dist/templates/cursor/.cursor/agents/config-drift-analyzer.md +152 -0
- package/dist/templates/cursor/.cursor/commands/actualizar-reglas.md +580 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
- package/dist/templates/frontend/react-ssr/.dockerignore +14 -0
- package/dist/templates/frontend/react-ssr/.env.example +9 -0
- package/dist/templates/frontend/react-ssr/.husky/pre-commit +1 -0
- package/dist/templates/frontend/react-ssr/Dockerfile +41 -0
- package/dist/templates/frontend/react-ssr/README.md +121 -0
- package/dist/templates/frontend/react-ssr/components.json +22 -0
- package/dist/templates/frontend/react-ssr/docker-compose.yml +21 -0
- package/dist/templates/frontend/react-ssr/eslint.config.mjs +26 -0
- package/dist/templates/frontend/react-ssr/next.config.ts +7 -0
- package/dist/templates/frontend/react-ssr/package.json +86 -0
- package/dist/templates/frontend/react-ssr/postcss.config.mjs +5 -0
- package/dist/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
- package/dist/templates/frontend/react-ssr/prisma/seed.ts +109 -0
- package/dist/templates/frontend/react-ssr/prisma.config.ts +17 -0
- package/dist/templates/frontend/react-ssr/skills-lock.json +65 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
- package/dist/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
- package/dist/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
- package/dist/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
- package/dist/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
- package/dist/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
- package/dist/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
- package/dist/templates/frontend/react-ssr/src/app/globals.css +99 -0
- package/dist/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
- package/dist/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
- package/dist/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
- package/dist/templates/frontend/react-ssr/src/app/page.tsx +331 -0
- package/dist/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
- package/dist/templates/frontend/react-ssr/src/auth.ts +64 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
- package/dist/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
- package/dist/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
- package/dist/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
- package/dist/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
- package/dist/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
- package/dist/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
- package/dist/templates/frontend/react-ssr/src/proxy.ts +31 -0
- package/dist/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
- package/dist/templates/frontend/react-ssr/src/test/setup.ts +1 -0
- package/dist/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
- package/dist/templates/frontend/react-ssr/src/types/index.ts +36 -0
- package/dist/templates/frontend/react-ssr/tsconfig.json +41 -0
- package/dist/templates/frontend/react-ssr/vitest.config.ts +41 -0
- package/package.json +1 -1
- package/templates/cursor/.cursor/agents/config-drift-analyzer.md +152 -0
- package/templates/cursor/.cursor/commands/actualizar-reglas.md +580 -0
- package/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
- package/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
- package/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
- package/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
- package/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
- package/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
- package/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
- package/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
- package/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
- package/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
- package/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
- package/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
- package/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
- package/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
- package/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
- package/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
- package/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
- package/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
- package/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
- package/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
- package/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
- package/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
- package/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
- package/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
- package/templates/frontend/react-ssr/.dockerignore +14 -0
- package/templates/frontend/react-ssr/.env.example +9 -0
- package/templates/frontend/react-ssr/.husky/pre-commit +1 -0
- package/templates/frontend/react-ssr/Dockerfile +41 -0
- package/templates/frontend/react-ssr/README.md +121 -0
- package/templates/frontend/react-ssr/components.json +22 -0
- package/templates/frontend/react-ssr/docker-compose.yml +21 -0
- package/templates/frontend/react-ssr/eslint.config.mjs +26 -0
- package/templates/frontend/react-ssr/next.config.ts +7 -0
- package/templates/frontend/react-ssr/package.json +86 -0
- package/templates/frontend/react-ssr/postcss.config.mjs +5 -0
- package/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
- package/templates/frontend/react-ssr/prisma/seed.ts +109 -0
- package/templates/frontend/react-ssr/prisma.config.ts +17 -0
- package/templates/frontend/react-ssr/skills-lock.json +65 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
- package/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
- package/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
- package/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
- package/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
- package/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
- package/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
- package/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
- package/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
- package/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
- package/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
- package/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
- package/templates/frontend/react-ssr/src/app/globals.css +99 -0
- package/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
- package/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
- package/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
- package/templates/frontend/react-ssr/src/app/page.tsx +331 -0
- package/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
- package/templates/frontend/react-ssr/src/auth.ts +64 -0
- package/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
- package/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
- package/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
- package/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
- package/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
- package/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
- package/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
- package/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
- package/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
- package/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
- package/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
- package/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
- package/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
- package/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
- package/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
- package/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
- package/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
- package/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
- package/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
- package/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
- package/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
- package/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
- package/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
- package/templates/frontend/react-ssr/src/proxy.ts +31 -0
- package/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
- package/templates/frontend/react-ssr/src/test/setup.ts +1 -0
- package/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
- package/templates/frontend/react-ssr/src/types/index.ts +36 -0
- package/templates/frontend/react-ssr/tsconfig.json +41 -0
- package/templates/frontend/react-ssr/vitest.config.ts +41 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: daisyui-5
|
|
3
|
+
description: >
|
|
4
|
+
DaisyUI 5 component library best practices, patterns, and usage for Tailwind CSS 4.
|
|
5
|
+
Use when building UI with daisyUI class names, creating daisyUI-based layouts,
|
|
6
|
+
styling HTML with daisyUI components, creating React wrapper components for daisyUI,
|
|
7
|
+
or any task involving daisyUI (.html, .jsx, .tsx, .vue, .svelte files). Triggers on:
|
|
8
|
+
daisyUI components (btn, card, modal, drawer, navbar, etc.), daisyUI color names
|
|
9
|
+
(primary, secondary, base-100, etc.), daisyUI config (@plugin "daisyui"), daisy-meta.ts,
|
|
10
|
+
generate-daisy-safelist, compound components wrapping daisyUI, or any UI task in a
|
|
11
|
+
project using daisyUI/Tailwind CSS 4.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# daisyUI 5
|
|
15
|
+
|
|
16
|
+
CSS component library for Tailwind CSS 4. Provides semantic class names for common UI components.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
1. Requires Tailwind CSS 4. No `tailwind.config.js` (deprecated in v4).
|
|
21
|
+
2. Install: `npm i -D daisyui@latest`
|
|
22
|
+
3. CSS file:
|
|
23
|
+
```css
|
|
24
|
+
@import "tailwindcss";
|
|
25
|
+
@plugin "daisyui";
|
|
26
|
+
```
|
|
27
|
+
4. CDN alternative:
|
|
28
|
+
```html
|
|
29
|
+
<link href="https://cdn.jsdelivr.net/npm/daisyui@5" rel="stylesheet" type="text/css" />
|
|
30
|
+
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage Rules
|
|
34
|
+
|
|
35
|
+
1. Style elements by combining: component class + part classes + modifier classes
|
|
36
|
+
2. Customize with Tailwind utility classes when daisyUI classes aren't sufficient (e.g. `btn px-10`)
|
|
37
|
+
3. Use `!` suffix on utilities as last resort for specificity (e.g. `btn bg-red-500!`)
|
|
38
|
+
4. If a component doesn't exist in daisyUI, build it with Tailwind utilities
|
|
39
|
+
5. Use Tailwind responsive prefixes for `flex`/`grid` layouts
|
|
40
|
+
6. Only use daisyUI class names or Tailwind utility classes — no custom CSS
|
|
41
|
+
7. Use `https://picsum.photos/{w}/{h}` for placeholder images
|
|
42
|
+
8. Don't add custom fonts unless necessary
|
|
43
|
+
9. Don't add `bg-base-100 text-base-content` to body unless necessary
|
|
44
|
+
10. Follow Refactoring UI best practices for design decisions
|
|
45
|
+
|
|
46
|
+
## Class Name Categories
|
|
47
|
+
|
|
48
|
+
- `component`: Required component class
|
|
49
|
+
- `part`: Child part of a component
|
|
50
|
+
- `style`: Sets specific style
|
|
51
|
+
- `behavior`: Changes behavior
|
|
52
|
+
- `color`: Sets specific color
|
|
53
|
+
- `size`: Sets specific size
|
|
54
|
+
- `placement`/`direction`: Sets position/direction
|
|
55
|
+
- `modifier`: Modifies component
|
|
56
|
+
- `variant`: Conditional prefix (`variant:utility-class`)
|
|
57
|
+
|
|
58
|
+
## Colors
|
|
59
|
+
|
|
60
|
+
### Semantic Color Names
|
|
61
|
+
| Color | Purpose |
|
|
62
|
+
|-------|---------|
|
|
63
|
+
| `primary` / `primary-content` | Main brand color / foreground on primary |
|
|
64
|
+
| `secondary` / `secondary-content` | Secondary brand color / foreground |
|
|
65
|
+
| `accent` / `accent-content` | Accent brand color / foreground |
|
|
66
|
+
| `neutral` / `neutral-content` | Non-saturated UI / foreground |
|
|
67
|
+
| `base-100/200/300` / `base-content` | Surface colors (light to dark) / foreground |
|
|
68
|
+
| `info` / `info-content` | Informative messages / foreground |
|
|
69
|
+
| `success` / `success-content` | Success messages / foreground |
|
|
70
|
+
| `warning` / `warning-content` | Warning messages / foreground |
|
|
71
|
+
| `error` / `error-content` | Error messages / foreground |
|
|
72
|
+
|
|
73
|
+
### Color Rules
|
|
74
|
+
1. Use daisyUI color names in Tailwind utilities: `bg-primary`, `text-base-content`
|
|
75
|
+
2. Colors change automatically per theme — no `dark:` prefix needed
|
|
76
|
+
3. Avoid Tailwind color names (e.g. `text-gray-800`) — they don't adapt to themes
|
|
77
|
+
4. Use `base-*` colors for page majority, `primary` for important elements
|
|
78
|
+
5. `*-content` colors must contrast well against their associated colors
|
|
79
|
+
|
|
80
|
+
## Config
|
|
81
|
+
|
|
82
|
+
```css
|
|
83
|
+
@plugin "daisyui"; /* no config */
|
|
84
|
+
|
|
85
|
+
@plugin "daisyui" {
|
|
86
|
+
themes: light --default, dark --prefersdark;
|
|
87
|
+
root: ":root";
|
|
88
|
+
include: ;
|
|
89
|
+
exclude: ;
|
|
90
|
+
prefix: ;
|
|
91
|
+
logs: true;
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Config options: `themes` (enable/set default), `root`, `include`/`exclude` (components), `prefix` (e.g. `daisy-`), `logs`.
|
|
96
|
+
|
|
97
|
+
## Custom Themes
|
|
98
|
+
|
|
99
|
+
```css
|
|
100
|
+
@plugin "daisyui/theme" {
|
|
101
|
+
name: "mytheme";
|
|
102
|
+
default: true;
|
|
103
|
+
prefersdark: false;
|
|
104
|
+
color-scheme: light;
|
|
105
|
+
--color-base-100: oklch(98% 0.02 240);
|
|
106
|
+
--color-base-200: oklch(95% 0.03 240);
|
|
107
|
+
--color-base-300: oklch(92% 0.04 240);
|
|
108
|
+
--color-base-content: oklch(20% 0.05 240);
|
|
109
|
+
--color-primary: oklch(55% 0.3 240);
|
|
110
|
+
--color-primary-content: oklch(98% 0.01 240);
|
|
111
|
+
--color-secondary: oklch(70% 0.25 200);
|
|
112
|
+
--color-secondary-content: oklch(98% 0.01 200);
|
|
113
|
+
--color-accent: oklch(65% 0.25 160);
|
|
114
|
+
--color-accent-content: oklch(98% 0.01 160);
|
|
115
|
+
--color-neutral: oklch(50% 0.05 240);
|
|
116
|
+
--color-neutral-content: oklch(98% 0.01 240);
|
|
117
|
+
--color-info: oklch(70% 0.2 220);
|
|
118
|
+
--color-info-content: oklch(98% 0.01 220);
|
|
119
|
+
--color-success: oklch(65% 0.25 140);
|
|
120
|
+
--color-success-content: oklch(98% 0.01 140);
|
|
121
|
+
--color-warning: oklch(80% 0.25 80);
|
|
122
|
+
--color-warning-content: oklch(20% 0.05 80);
|
|
123
|
+
--color-error: oklch(65% 0.3 30);
|
|
124
|
+
--color-error-content: oklch(98% 0.01 30);
|
|
125
|
+
--radius-selector: 1rem;
|
|
126
|
+
--radius-field: 0.25rem;
|
|
127
|
+
--radius-box: 0.5rem;
|
|
128
|
+
--size-selector: 0.25rem;
|
|
129
|
+
--size-field: 0.25rem;
|
|
130
|
+
--border: 1px;
|
|
131
|
+
--depth: 1;
|
|
132
|
+
--noise: 0;
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
All CSS variables above are required. Colors can be OKLCH, hex, or other formats.
|
|
137
|
+
|
|
138
|
+
## Creating DaisyUI Components
|
|
139
|
+
|
|
140
|
+
Follow this workflow when creating or extending React components that wrap daisyUI. See [references/creating-components.md](references/creating-components.md) for detailed patterns, compound component examples, and test templates.
|
|
141
|
+
|
|
142
|
+
### 1. Resolve the components directory
|
|
143
|
+
Check `AGENTS.md` or `CLAUDE.md` for a `DAISY_COMPONENTS_DIR` variable. If not found, use `src/components/daisy`.
|
|
144
|
+
|
|
145
|
+
### 2. Ensure foundational files exist
|
|
146
|
+
Before creating any component, verify the project has the required infrastructure. If any are missing, create them from the bundled `scripts/` templates. See [references/creating-components.md](references/creating-components.md) for the full bootstrapping checklist and file contents.
|
|
147
|
+
|
|
148
|
+
Required files:
|
|
149
|
+
- `<DAISY_COMPONENTS_DIR>/daisy-meta.ts` — from bundled `scripts/daisy-meta.ts`
|
|
150
|
+
- `generators/daisy/generate-daisy-safelist.ts` — from bundled `scripts/generate-daisy-safelist.ts` (update the import path to point to daisy-meta.ts)
|
|
151
|
+
- `src/app/styles/daisy.css` — must import daisyUI plugin and the generated safelist
|
|
152
|
+
- `package.json` script `"generate:safelist"` — must run the generator
|
|
153
|
+
- The `daisy.css` file must be imported in the root layout or global CSS entry point
|
|
154
|
+
|
|
155
|
+
### 3. Register in daisy-meta.ts
|
|
156
|
+
Add the new component's capabilities to `COMPONENT_CAPABILITIES` in `<DAISY_COMPONENTS_DIR>/daisy-meta.ts`. Reference the daisyUI docs (see Component Reference below) for which modifiers it supports.
|
|
157
|
+
|
|
158
|
+
### 4. Create the component
|
|
159
|
+
- Follow patterns in existing `<DAISY_COMPONENTS_DIR>/daisy*` files
|
|
160
|
+
- Prefer compound components for multi-part daisyUI components (card, modal, dropdown, etc.)
|
|
161
|
+
- Each sub-component in a compound component gets its own file
|
|
162
|
+
- See [references/creating-components.md](references/creating-components.md) for compound component structure
|
|
163
|
+
|
|
164
|
+
### 5. Generate safelist
|
|
165
|
+
```bash
|
|
166
|
+
npm run generate:safelist
|
|
167
|
+
```
|
|
168
|
+
Generates `src/app/styles/daisy-safelist.css`.
|
|
169
|
+
|
|
170
|
+
### 6. Add tests
|
|
171
|
+
Use the project's test framework (check `package.json` for jest/vitest). Default to Jest + React Testing Library. Test: rendering, prop variations (colors, sizes, variants), compound component composition, and accessibility.
|
|
172
|
+
|
|
173
|
+
### 7. Extend the safelist generator
|
|
174
|
+
If the new component introduces a capability modifier not yet handled in `generate-daisy-safelist.ts`, update `buildClassList()` to iterate over it.
|
|
175
|
+
|
|
176
|
+
## Component Reference
|
|
177
|
+
|
|
178
|
+
Component docs are split by category. Read only the relevant file:
|
|
179
|
+
|
|
180
|
+
- **Layout components**: See [references/layout.md](references/layout.md)
|
|
181
|
+
drawer, navbar, footer, hero, dock, divider, indicator, join, stack, fab
|
|
182
|
+
- **Data display**: See [references/data-display.md](references/data-display.md)
|
|
183
|
+
card, list, table, stat, badge, avatar, chat, timeline, countdown, diff, carousel, hover-3d, hover-gallery, text-rotate
|
|
184
|
+
- **Input components**: See [references/input.md](references/input.md)
|
|
185
|
+
button, input, textarea, select, checkbox, radio, toggle, range, rating, file-input, filter, fieldset, label, validator, calendar
|
|
186
|
+
- **Feedback & overlay**: See [references/feedback.md](references/feedback.md)
|
|
187
|
+
alert, modal, toast, loading, skeleton, progress, radial-progress, status, steps, swap, tab
|
|
188
|
+
- **Navigation & chrome**: See [references/navigation.md](references/navigation.md)
|
|
189
|
+
accordion, collapse, breadcrumbs, dropdown, tooltip, link, kbd, menu, mask, mockup-browser, mockup-code, mockup-phone, mockup-window, pagination, theme-controller
|
package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
# Creating DaisyUI Components
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
- [Bootstrapping Foundational Files](#bootstrapping-foundational-files)
|
|
5
|
+
- [Directory Structure](#directory-structure)
|
|
6
|
+
- [Simple Component Pattern](#simple-component-pattern)
|
|
7
|
+
- [Compound Component Pattern](#compound-component-pattern)
|
|
8
|
+
- [Registering in daisy-meta.ts](#registering-in-daisy-metats)
|
|
9
|
+
- [Safelist Integration](#safelist-integration)
|
|
10
|
+
- [Testing Components](#testing-components)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Bootstrapping Foundational Files
|
|
15
|
+
|
|
16
|
+
Before creating any component, verify these files exist. If missing, create them from the bundled `scripts/` templates.
|
|
17
|
+
|
|
18
|
+
### Checklist
|
|
19
|
+
|
|
20
|
+
| File | Source | Purpose |
|
|
21
|
+
|------|--------|---------|
|
|
22
|
+
| `<DAISY_COMPONENTS_DIR>/daisy-meta.ts` | Bundled `scripts/daisy-meta.ts` | Central metadata & types |
|
|
23
|
+
| `generators/daisy/generate-daisy-safelist.ts` | Bundled `scripts/generate-daisy-safelist.ts` | Safelist CSS generator |
|
|
24
|
+
| `src/app/styles/daisy-safelist.css` | Auto-generated | Prevents Tailwind tree-shaking |
|
|
25
|
+
| `src/app/styles/daisy.css` | Create manually | daisyUI plugin + safelist import |
|
|
26
|
+
| `package.json` `"generate:safelist"` script | Add manually | Runs the generator |
|
|
27
|
+
|
|
28
|
+
### 1. Create daisy-meta.ts
|
|
29
|
+
|
|
30
|
+
Copy the bundled `scripts/daisy-meta.ts` to `<DAISY_COMPONENTS_DIR>/daisy-meta.ts`. No modifications needed — it works as-is.
|
|
31
|
+
|
|
32
|
+
### 2. Create generate-daisy-safelist.ts
|
|
33
|
+
|
|
34
|
+
Copy the bundled `scripts/generate-daisy-safelist.ts` to `generators/daisy/generate-daisy-safelist.ts`. **Update the import path** to point to the actual `daisy-meta.ts` location:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
// Before (bundled path):
|
|
38
|
+
import { ... } from "./daisy-meta.ts";
|
|
39
|
+
|
|
40
|
+
// After (adjust to match your project structure):
|
|
41
|
+
import { ... } from "../../src/components/daisy/daisy-meta.ts";
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 3. Create daisy.css
|
|
45
|
+
|
|
46
|
+
Create `src/app/styles/daisy.css`:
|
|
47
|
+
|
|
48
|
+
```css
|
|
49
|
+
@plugin "daisyui" {
|
|
50
|
+
themes: light --default, dark --prefersdark;
|
|
51
|
+
}
|
|
52
|
+
@import 'daisy-safelist.css';
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Adjust the `themes` line to match project requirements. This file must be imported in the root layout or global CSS entry point (e.g. `layout.tsx` or `globals.css`).
|
|
56
|
+
|
|
57
|
+
### 4. Add npm script
|
|
58
|
+
|
|
59
|
+
Add to `package.json`:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"scripts": {
|
|
64
|
+
"generate:safelist": "npx tsx generators/daisy/generate-daisy-safelist.ts"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 5. Generate initial safelist
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm run generate:safelist
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This creates `src/app/styles/daisy-safelist.css` with all registered component classes.
|
|
76
|
+
|
|
77
|
+
### Keeping files updated
|
|
78
|
+
|
|
79
|
+
When adding a new component:
|
|
80
|
+
1. Add its entry to `COMPONENT_CAPABILITIES` in `daisy-meta.ts`
|
|
81
|
+
2. Run `npm run generate:safelist` to regenerate the safelist
|
|
82
|
+
3. If the component uses a new capability type not in `ComponentCapability`, update both `daisy-meta.ts` (add the type) and `generate-daisy-safelist.ts` (add iteration in `buildClassList()`)
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Directory Structure
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
<DAISY_COMPONENTS_DIR>/
|
|
90
|
+
├── daisy-meta.ts # Central metadata (source of truth)
|
|
91
|
+
├── daisy-badge.tsx # Simple component (single file)
|
|
92
|
+
├── daisy-card/ # Compound component (directory)
|
|
93
|
+
│ ├── index.ts # Public barrel export
|
|
94
|
+
│ ├── daisy-card.tsx # Root compound component
|
|
95
|
+
│ ├── daisy-card-body.tsx # Sub-component
|
|
96
|
+
│ ├── daisy-card-title.tsx # Sub-component
|
|
97
|
+
│ ├── daisy-card-actions.tsx # Sub-component
|
|
98
|
+
│ └── daisy-card.test.tsx # Tests
|
|
99
|
+
├── daisy-modal/ # Another compound component
|
|
100
|
+
│ ├── index.ts
|
|
101
|
+
│ ├── daisy-modal.tsx
|
|
102
|
+
│ ├── daisy-modal-box.tsx
|
|
103
|
+
│ ├── daisy-modal-action.tsx
|
|
104
|
+
│ ├── daisy-modal-backdrop.tsx
|
|
105
|
+
│ └── daisy-modal.test.tsx
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- Simple components: single `.tsx` file (e.g. `daisy-badge.tsx`)
|
|
109
|
+
- Compound components: directory with one file per sub-component + barrel `index.ts`
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Simple Component Pattern
|
|
114
|
+
|
|
115
|
+
Use for single-element daisyUI components (badge, loading, status, kbd, link, etc.).
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
// daisy-badge.tsx
|
|
119
|
+
import { type HTMLAttributes, forwardRef } from "react";
|
|
120
|
+
import { type DaisyColor, type DaisySize } from "./daisy-meta";
|
|
121
|
+
|
|
122
|
+
export interface DaisyBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
123
|
+
color?: DaisyColor;
|
|
124
|
+
size?: DaisySize;
|
|
125
|
+
variant?: "outline" | "dash" | "soft" | "ghost";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export const DaisyBadge = forwardRef<HTMLSpanElement, DaisyBadgeProps>(
|
|
129
|
+
({ color, size, variant, className = "", children, ...props }, ref) => {
|
|
130
|
+
const classes = [
|
|
131
|
+
"badge",
|
|
132
|
+
color && `badge-${color}`,
|
|
133
|
+
size && `badge-${size}`,
|
|
134
|
+
variant && `badge-${variant}`,
|
|
135
|
+
className,
|
|
136
|
+
]
|
|
137
|
+
.filter(Boolean)
|
|
138
|
+
.join(" ");
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<span ref={ref} className={classes} {...props}>
|
|
142
|
+
{children}
|
|
143
|
+
</span>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
DaisyBadge.displayName = "DaisyBadge";
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Key rules:**
|
|
151
|
+
- Use `forwardRef` for all components
|
|
152
|
+
- Set `displayName` explicitly
|
|
153
|
+
- Spread `...props` and merge `className`
|
|
154
|
+
- Build class strings from props using the `component-modifier` pattern
|
|
155
|
+
- Import types from `daisy-meta.ts`
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Compound Component Pattern
|
|
160
|
+
|
|
161
|
+
Use for multi-part daisyUI components (card, modal, dropdown, navbar, drawer, alert, chat, stat, etc.). Each sub-component is a separate file.
|
|
162
|
+
|
|
163
|
+
### Root component file
|
|
164
|
+
|
|
165
|
+
```tsx
|
|
166
|
+
// daisy-card/daisy-card.tsx
|
|
167
|
+
import { type HTMLAttributes, forwardRef } from "react";
|
|
168
|
+
import { type DaisySize } from "../daisy-meta";
|
|
169
|
+
|
|
170
|
+
export interface DaisyCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
171
|
+
size?: DaisySize;
|
|
172
|
+
variant?: "border" | "dash";
|
|
173
|
+
imageFull?: boolean;
|
|
174
|
+
horizontal?: boolean;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export const DaisyCard = forwardRef<HTMLDivElement, DaisyCardProps>(
|
|
178
|
+
({ size, variant, imageFull, horizontal, className = "", children, ...props }, ref) => {
|
|
179
|
+
const classes = [
|
|
180
|
+
"card",
|
|
181
|
+
size && `card-${size}`,
|
|
182
|
+
variant && `card-${variant}`,
|
|
183
|
+
imageFull && "image-full",
|
|
184
|
+
horizontal && "card-side",
|
|
185
|
+
className,
|
|
186
|
+
]
|
|
187
|
+
.filter(Boolean)
|
|
188
|
+
.join(" ");
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<div ref={ref} className={classes} {...props}>
|
|
192
|
+
{children}
|
|
193
|
+
</div>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
DaisyCard.displayName = "DaisyCard";
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Sub-component files
|
|
201
|
+
|
|
202
|
+
```tsx
|
|
203
|
+
// daisy-card/daisy-card-body.tsx
|
|
204
|
+
import { type HTMLAttributes, forwardRef } from "react";
|
|
205
|
+
|
|
206
|
+
export interface DaisyCardBodyProps extends HTMLAttributes<HTMLDivElement> {}
|
|
207
|
+
|
|
208
|
+
export const DaisyCardBody = forwardRef<HTMLDivElement, DaisyCardBodyProps>(
|
|
209
|
+
({ className = "", children, ...props }, ref) => {
|
|
210
|
+
return (
|
|
211
|
+
<div ref={ref} className={`card-body ${className}`.trim()} {...props}>
|
|
212
|
+
{children}
|
|
213
|
+
</div>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
DaisyCardBody.displayName = "DaisyCardBody";
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
// daisy-card/daisy-card-title.tsx
|
|
222
|
+
import { type HTMLAttributes, forwardRef } from "react";
|
|
223
|
+
|
|
224
|
+
export interface DaisyCardTitleProps extends HTMLAttributes<HTMLHeadingElement> {}
|
|
225
|
+
|
|
226
|
+
export const DaisyCardTitle = forwardRef<HTMLHeadingElement, DaisyCardTitleProps>(
|
|
227
|
+
({ className = "", children, ...props }, ref) => {
|
|
228
|
+
return (
|
|
229
|
+
<h2 ref={ref} className={`card-title ${className}`.trim()} {...props}>
|
|
230
|
+
{children}
|
|
231
|
+
</h2>
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
DaisyCardTitle.displayName = "DaisyCardTitle";
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
// daisy-card/daisy-card-actions.tsx
|
|
240
|
+
import { type HTMLAttributes, forwardRef } from "react";
|
|
241
|
+
import { type DaisyAlignment } from "../daisy-meta";
|
|
242
|
+
|
|
243
|
+
export interface DaisyCardActionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
244
|
+
align?: DaisyAlignment;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export const DaisyCardActions = forwardRef<HTMLDivElement, DaisyCardActionsProps>(
|
|
248
|
+
({ align = "end", className = "", children, ...props }, ref) => {
|
|
249
|
+
const classes = [
|
|
250
|
+
"card-actions",
|
|
251
|
+
align && `justify-${align}`,
|
|
252
|
+
className,
|
|
253
|
+
]
|
|
254
|
+
.filter(Boolean)
|
|
255
|
+
.join(" ");
|
|
256
|
+
|
|
257
|
+
return (
|
|
258
|
+
<div ref={ref} className={classes} {...props}>
|
|
259
|
+
{children}
|
|
260
|
+
</div>
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
DaisyCardActions.displayName = "DaisyCardActions";
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Barrel export (index.ts)
|
|
268
|
+
|
|
269
|
+
```tsx
|
|
270
|
+
// daisy-card/index.ts
|
|
271
|
+
export { DaisyCard, type DaisyCardProps } from "./daisy-card";
|
|
272
|
+
export { DaisyCardBody, type DaisyCardBodyProps } from "./daisy-card-body";
|
|
273
|
+
export { DaisyCardTitle, type DaisyCardTitleProps } from "./daisy-card-title";
|
|
274
|
+
export { DaisyCardActions, type DaisyCardActionsProps } from "./daisy-card-actions";
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Usage example
|
|
278
|
+
|
|
279
|
+
```tsx
|
|
280
|
+
import { DaisyCard, DaisyCardBody, DaisyCardTitle, DaisyCardActions } from "@/components/daisy/daisy-card";
|
|
281
|
+
|
|
282
|
+
<DaisyCard size="md" className="bg-base-100 shadow-sm w-96">
|
|
283
|
+
<figure><img src="https://picsum.photos/400/200" alt="Cover" /></figure>
|
|
284
|
+
<DaisyCardBody>
|
|
285
|
+
<DaisyCardTitle>Product Name</DaisyCardTitle>
|
|
286
|
+
<p>Product description here.</p>
|
|
287
|
+
<DaisyCardActions align="end">
|
|
288
|
+
<button className="btn btn-primary">Buy Now</button>
|
|
289
|
+
</DaisyCardActions>
|
|
290
|
+
</DaisyCardBody>
|
|
291
|
+
</DaisyCard>
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### When to use compound vs simple
|
|
295
|
+
|
|
296
|
+
| Pattern | Use when |
|
|
297
|
+
|---------|----------|
|
|
298
|
+
| **Simple** (single file) | Component is one element with modifiers: badge, loading, status, kbd, divider, progress |
|
|
299
|
+
| **Compound** (directory) | Component has named child parts in daisyUI docs: card (card-body, card-title, card-actions), modal (modal-box, modal-action, modal-backdrop), alert (with icon + text + actions), stat (stat-title, stat-value, stat-desc), chat (chat-bubble, chat-header, chat-footer), navbar (navbar-start, navbar-center, navbar-end), dropdown (dropdown-content), collapse (collapse-title, collapse-content), steps (step) |
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Registering in daisy-meta.ts
|
|
304
|
+
|
|
305
|
+
Every new component must be added to `COMPONENT_CAPABILITIES` in `daisy-meta.ts`. Reference the daisyUI component docs for supported modifiers.
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
// Example: adding alert
|
|
309
|
+
export const COMPONENT_CAPABILITIES: Partial<Record<string, ComponentCapability>> = {
|
|
310
|
+
// ... existing entries ...
|
|
311
|
+
alert: {
|
|
312
|
+
colors: true, // alert-info, alert-success, etc.
|
|
313
|
+
variants: ["outline", "dash", "soft"],
|
|
314
|
+
orientation: true, // alert-horizontal, alert-vertical
|
|
315
|
+
},
|
|
316
|
+
steps: {
|
|
317
|
+
colors: true, // step-primary, step-secondary, etc.
|
|
318
|
+
orientation: true, // steps-horizontal, steps-vertical
|
|
319
|
+
},
|
|
320
|
+
toggle: {
|
|
321
|
+
colors: true,
|
|
322
|
+
sizes: true,
|
|
323
|
+
},
|
|
324
|
+
loading: {
|
|
325
|
+
sizes: true,
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**Rules:**
|
|
331
|
+
- Set `colors: true` if the component supports `component-primary`, `component-secondary`, etc.
|
|
332
|
+
- Set `sizes: true` if it supports `component-xs` through `component-xl`
|
|
333
|
+
- Use an array for `variants` if only a subset applies: `["ghost", "outline"]`
|
|
334
|
+
- Set `variants: true` if all standard variants apply (dash, outline, ghost, link, soft)
|
|
335
|
+
- Set `orientation: true` if it supports `component-horizontal`/`component-vertical`
|
|
336
|
+
- Set `placement` array for positional modifiers: `["top", "bottom", "left", "right"]`
|
|
337
|
+
- Omit properties that don't apply — don't set them to `false`
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## Safelist Integration
|
|
342
|
+
|
|
343
|
+
After registering the component in `daisy-meta.ts` and creating the component files:
|
|
344
|
+
|
|
345
|
+
1. Run the safelist generator:
|
|
346
|
+
```bash
|
|
347
|
+
npm run generate:safelist
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
2. Verify the generated `src/app/styles/daisy-safelist.css` includes your new component classes.
|
|
351
|
+
|
|
352
|
+
3. Ensure the import chain is intact:
|
|
353
|
+
```css
|
|
354
|
+
/* src/app/styles/daisy.css */
|
|
355
|
+
@plugin "daisyui" {
|
|
356
|
+
themes: "theme-name --default, theme-dark --prefersdark;";
|
|
357
|
+
}
|
|
358
|
+
@import 'daisy-safelist.css';
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
4. The `daisy.css` file must be imported in the root layout or a global CSS entry point.
|
|
362
|
+
|
|
363
|
+
If your component uses a new capability type not yet in `ComponentCapability`, update both `daisy-meta.ts` (add the type) and `generate-daisy-safelist.ts` (add iteration in `buildClassList()`).
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Testing Components
|
|
368
|
+
|
|
369
|
+
Use the project's existing test framework. Check `package.json` for `jest`, `vitest`, or `@testing-library/react`. Default to Jest + React Testing Library.
|
|
370
|
+
|
|
371
|
+
### Example test pattern
|
|
372
|
+
|
|
373
|
+
```tsx
|
|
374
|
+
import { render, screen } from "@testing-library/react";
|
|
375
|
+
import { DaisyBadge } from "./daisy-badge";
|
|
376
|
+
|
|
377
|
+
describe("DaisyBadge", () => {
|
|
378
|
+
it("renders with base class", () => {
|
|
379
|
+
render(<DaisyBadge>Test</DaisyBadge>);
|
|
380
|
+
expect(screen.getByText("Test")).toHaveClass("badge");
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
it("applies color prop", () => {
|
|
384
|
+
render(<DaisyBadge color="primary">Test</DaisyBadge>);
|
|
385
|
+
expect(screen.getByText("Test")).toHaveClass("badge", "badge-primary");
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
it("merges custom className", () => {
|
|
389
|
+
render(<DaisyBadge className="mt-4">Test</DaisyBadge>);
|
|
390
|
+
expect(screen.getByText("Test")).toHaveClass("badge", "mt-4");
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
it("forwards ref", () => {
|
|
394
|
+
const ref = { current: null } as React.RefObject<HTMLSpanElement>;
|
|
395
|
+
render(<DaisyBadge ref={ref}>Test</DaisyBadge>);
|
|
396
|
+
expect(ref.current).toBeInstanceOf(HTMLSpanElement);
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### What to test
|
|
402
|
+
|
|
403
|
+
For every component, cover:
|
|
404
|
+
- Base class always present on render
|
|
405
|
+
- Each prop variation (color, size, variant, shape, placement) applies correct class
|
|
406
|
+
- Custom `className` merges without overwriting base class
|
|
407
|
+
- `ref` forwarding returns correct element type
|
|
408
|
+
|
|
409
|
+
For compound components, additionally test:
|
|
410
|
+
- Each sub-component renders its part class (`card-body`, `modal-box`, etc.)
|
|
411
|
+
- Full composition renders all parts together correctly
|
|
412
|
+
- Accessibility attributes (`role`, `aria-*`) where applicable
|