diff --git a/src/components/planes/wizard/PasoBasicosForm.tsx b/src/components/planes/wizard/PasoBasicosForm.tsx deleted file mode 100644 index 8892b5a..0000000 --- a/src/components/planes/wizard/PasoBasicosForm.tsx +++ /dev/null @@ -1,182 +0,0 @@ -import type { CARRERAS } from '@/features/planes/nuevo/catalogs' -import type { NewPlanWizardState } from '@/features/planes/nuevo/types' - -import { Input } from '@/components/ui/input' -import { Label } from '@/components/ui/label' -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from '@/components/ui/select' -import { - FACULTADES, - NIVELES, - TIPOS_CICLO, -} from '@/features/planes/nuevo/catalogs' - -export function PasoBasicosForm({ - wizard, - onChange, - carrerasFiltradas, -}: { - wizard: NewPlanWizardState - onChange: React.Dispatch> - carrerasFiltradas: typeof CARRERAS -}) { - return ( -
-
- - ) => - onChange((w) => ({ - ...w, - datosBasicos: { ...w.datosBasicos, nombrePlan: e.target.value }, - })) - } - /> -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - ) => - onChange((w) => ({ - ...w, - datosBasicos: { - ...w.datosBasicos, - numCiclos: Number(e.target.value || 1), - }, - })) - } - placeholder="1" - /> -
-
- ) -} diff --git a/src/components/planes/wizard/PasoBasicosForm/PasoBasicosForm.tsx b/src/components/planes/wizard/PasoBasicosForm/PasoBasicosForm.tsx new file mode 100644 index 0000000..2a1fdd8 --- /dev/null +++ b/src/components/planes/wizard/PasoBasicosForm/PasoBasicosForm.tsx @@ -0,0 +1,202 @@ +import { TemplateSelectorCard } from './TemplateSelectorCard' + +import type { CARRERAS } from '@/features/planes/nuevo/catalogs' +import type { NewPlanWizardState } from '@/features/planes/nuevo/types' + +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' +import { Separator } from '@/components/ui/separator' +import { + FACULTADES, + NIVELES, + TIPOS_CICLO, + PLANTILLAS_ANEXO_1, + PLANTILLAS_ANEXO_2, +} from '@/features/planes/nuevo/catalogs' + +export function PasoBasicosForm({ + wizard, + onChange, + carrerasFiltradas, +}: { + wizard: NewPlanWizardState + onChange: React.Dispatch> + carrerasFiltradas: typeof CARRERAS +}) { + return ( +
+
+
+ + ) => + onChange((w) => ({ + ...w, + datosBasicos: { ...w.datosBasicos, nombrePlan: e.target.value }, + })) + } + /> +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + ) => + onChange((w) => ({ + ...w, + datosBasicos: { + ...w.datosBasicos, + numCiclos: Number(e.target.value || 1), + }, + })) + } + placeholder="1" + /> +
+
+ +
+ + +
+
+ ) +} diff --git a/src/components/planes/wizard/PasoBasicosForm/TemplateSelectorCard.tsx b/src/components/planes/wizard/PasoBasicosForm/TemplateSelectorCard.tsx new file mode 100644 index 0000000..e7510f1 --- /dev/null +++ b/src/components/planes/wizard/PasoBasicosForm/TemplateSelectorCard.tsx @@ -0,0 +1,172 @@ +import { useState } from 'react' + +import { + Card, + CardContent, + CardHeader, + CardTitle, + CardDescription, +} from '@/components/ui/card' +import { Label } from '@/components/ui/label' +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' +import { cn } from '@/lib/utils' + +type TemplateData = { + id: string + name: string + versions: Array +} + +// Default data (kept for backward compatibility if caller doesn't pass templates) +const DEFAULT_TEMPLATES_DATA: Array = [ + { + id: 'sep-2025', + name: 'Licenciatura RVOE SEP', + versions: ['v2025.2 (Vigente)', 'v2025.1', 'v2024.Final'], + }, + { + id: 'interno-mix', + name: 'Estándar Institucional Mixto', + versions: ['v2.0', 'v1.5', 'v1.0-beta'], + }, + { + id: 'conacyt', + name: 'Formato Posgrado CONAHCYT', + versions: ['v3.0 (2025)', 'v2.8'], + }, +] + +interface Props { + cardTitle?: string + cardDescription?: string + templatesData?: Array +} + +export function TemplateSelectorCard({ + cardTitle = 'Configuración del Documento', + cardDescription = 'Selecciona la base para tu nuevo plan.', + templatesData = DEFAULT_TEMPLATES_DATA, +}: Props) { + const [selectedTemplate, setSelectedTemplate] = useState('') + const [selectedVersion, setSelectedVersion] = useState('') + + // Buscamos las versiones de la plantilla seleccionada + const currentTemplateData = templatesData.find( + (t) => t.id === selectedTemplate, + ) + const availableVersions = currentTemplateData?.versions || [] + + const handleTemplateChange = (value: string) => { + setSelectedTemplate(value) + // Buscamos los datos de esta plantilla + const template = templatesData.find((t) => t.id === value) + + // Si tiene versiones, seleccionamos la primera automáticamente + if (template && template.versions.length > 0) { + setSelectedVersion(template.versions[0]) + } else { + setSelectedVersion('') + } + } + + return ( + + + {cardTitle} + {cardDescription} + + + + {/* SELECT 1: PRIMARIO (Llamativo) */} +
+ + +
+ + {/* SELECT 2: SECUNDARIO (Sutil) */} +
+
+ +
+ + +
+
+
+ ) +} diff --git a/src/components/planes/wizard/PasoDetallesPanel.tsx b/src/components/planes/wizard/PasoDetallesPanel/PasoDetallesPanel.tsx similarity index 99% rename from src/components/planes/wizard/PasoDetallesPanel.tsx rename to src/components/planes/wizard/PasoDetallesPanel/PasoDetallesPanel.tsx index b4ead0f..8889484 100644 --- a/src/components/planes/wizard/PasoDetallesPanel.tsx +++ b/src/components/planes/wizard/PasoDetallesPanel/PasoDetallesPanel.tsx @@ -1,4 +1,4 @@ -import ReferenciasParaIA from './PasoDetallesPanel/ReferenciasParaIA' +import ReferenciasParaIA from './ReferenciasParaIA' import type { NewPlanWizardState } from '@/features/planes/nuevo/types' diff --git a/src/features/planes/nuevo/NuevoPlanModalContainer.tsx b/src/features/planes/nuevo/NuevoPlanModalContainer.tsx index 8f985da..2ca1e57 100644 --- a/src/features/planes/nuevo/NuevoPlanModalContainer.tsx +++ b/src/features/planes/nuevo/NuevoPlanModalContainer.tsx @@ -3,8 +3,8 @@ import * as Icons from 'lucide-react' import { useNuevoPlanWizard } from './hooks/useNuevoPlanWizard' -import { PasoBasicosForm } from '@/components/planes/wizard/PasoBasicosForm' -import { PasoDetallesPanel } from '@/components/planes/wizard/PasoDetallesPanel' +import { PasoBasicosForm } from '@/components/planes/wizard/PasoBasicosForm/PasoBasicosForm' +import { PasoDetallesPanel } from '@/components/planes/wizard/PasoDetallesPanel/PasoDetallesPanel' import { PasoModoCardGroup } from '@/components/planes/wizard/PasoModoCardGroup' import { PasoResumenCard } from '@/components/planes/wizard/PasoResumenCard' import { WizardControls } from '@/components/planes/wizard/WizardControls' diff --git a/src/features/planes/nuevo/catalogs.ts b/src/features/planes/nuevo/catalogs.ts index 28c3d57..b9bffa8 100644 --- a/src/features/planes/nuevo/catalogs.ts +++ b/src/features/planes/nuevo/catalogs.ts @@ -114,3 +114,53 @@ export const REPOSITORIOS = [ cantidadArchivos: 23, }, ]; + +export const ESTRUCTURAS_PLAN_ESTUDIO = [ + { + id: "estruc-1", + nombre: "Estructura RVOE 2017.docx", + versiones: ["v1.0", "v1.1", "v2.0"], + }, + { + id: "estruc-2", + nombre: "Estructura RVOE 2026.docx", + versiones: ["v1.0", "v1.1"], + }, + { id: "estruc-3", nombre: "Estructura ULSA 2022.docx", versiones: ["v1.0"] }, +]; + +export const PLANTILLAS_ANEXO_1 = [ + { + id: "sep-2025", + name: "Licenciatura RVOE SEP.docx", + versions: ["v2025.2 (Vigente)", "v2025.1", "v2024.Final"], + }, + { + id: "interno-mix", + name: "Estándar Institucional Mixto.docx", + versions: ["v2.0", "v1.5", "v1.0-beta"], + }, + { + id: "conacyt", + name: "Formato Posgrado CONAHCYT.docx", + versions: ["v3.0 (2025)", "v2.8"], + }, +]; + +export const PLANTILLAS_ANEXO_2 = [ + { + id: "sep-2017-xlsx", + name: "Licenciatura RVOE 2017.xlsx", + versions: ["v2017.0", "v2018.1", "v2019.2", "v2020.Final"], + }, + { + id: "interno-mix-xlsx", + name: "Estándar Institucional Mixto.xlsx", + versions: ["v1.0", "v1.5"], + }, + { + id: "conacyt-xlsx", + name: "Formato Posgrado CONAHCYT.xlsx", + versions: ["v1.0", "v2.0"], + }, +];