Skip to content

Commit a3d9fde

Browse files
authored
Migrate components to Base UI (#65)
* feat(components): migrate dialog from radix to base-ui * feat(components): migrate select from radix to base-ui * refactor(appointments): reorganize and integrate appointment modal * feat(referrals): add base referral types * refactor(patients): reorganize patients list table to module * chore(patient-requirements): use new dialog component * feat(baseui): migrate components and modules to BaseUI - Convert Select components to use BaseUI Select - Update calendar dropdown navigation with BaseUI components - Migrate data table status filters to BaseUI Select - Refactor patient form and modals with BaseUI integration - Update appointment modal components - Migrate patient history and documents views - Reorganize inactivate button to modules/patients - Update patient list table with BaseUI Select - Refactor period selector with BaseUI - Update gender chart filters - Migrate gender and city patient charts - Update query types and cache constants * refactor(patients): add patient status select and update modals - Create use-patient-options hook for status filtering - Update dialog component with BaseUI integration - Migrate patient requirements modals to BaseUI - Refactor patient list table and actions - Add patient status type definitions - Update patient form and sidebar components - Enhance patient data fetching - Add mock data for patient testing * refactor(types): standardize status type definitions across modules - Add Status enum to patient-requirements, patients, and referrals types - Update user roles and support status types - Migrate dropdown components to use status enums - Update patient form and data table with type-safe status handling - Refactor patient support and team type definitions - Enhance type safety for order and query parameters * refactor: reorganize modules into dedicated folders - Move dashboard cards to modules/dashboard - Move patient components to modules/patients - Move teams table to modules/teams - Consolidate patient form and modals in modules - Remove mock data from referrals - Update import paths across components - Improve module organization and structure
1 parent bddae9d commit a3d9fde

81 files changed

Lines changed: 1006 additions & 1770 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 0 additions & 393 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919
"@base-ui-components/react": "1.0.0-beta.6",
2020
"@hookform/resolvers": "5.0.1",
2121
"@radix-ui/react-checkbox": "1.2.2",
22-
"@radix-ui/react-dialog": "1.1.14",
2322
"@radix-ui/react-dropdown-menu": "2.1.15",
2423
"@radix-ui/react-popover": "1.1.14",
2524
"@radix-ui/react-radio-group": "1.3.6",
26-
"@radix-ui/react-select": "2.2.2",
2725
"@radix-ui/react-slot": "1.2.0",
2826
"@tanstack/react-query": "5.83.0",
2927
"class-variance-authority": "0.7.1",

src/actions/patients/get-patient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import { NEXT_CACHE_TAGS } from '@/constants/cache'
44
import { api } from '@/lib/api'
5-
import type { PatientType } from '@/types/patients'
5+
import type { Patient } from '@/types/patients'
66

77
export async function getPatient(id: string) {
88
const REVALIDATE_IN_SECONDS = 3600
99

1010
try {
11-
const response = await api<PatientType>(`/patients/${id}`, {
11+
const response = await api<Patient>(`/patients/${id}`, {
1212
includeCookies: true,
1313
cache: 'force-cache',
1414
next: {

src/actions/users.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { redirect } from 'next/navigation'
55
import { NEXT_CACHE_TAGS } from '@/constants/cache'
66
import { ROUTES } from '@/constants/routes'
77
import { api } from '@/lib/api'
8-
import type { UserType } from '@/types/users'
8+
import type { User } from '@/types/users'
99

1010
import { getDataFromToken } from './token'
1111

@@ -16,7 +16,7 @@ export async function getProfile() {
1616

1717
if (!data?.userId) return null
1818

19-
const response = await api<UserType>('/users/profile', {
19+
const response = await api<User>('/users/profile', {
2020
includeCookies: true,
2121
cache: 'force-cache',
2222
next: {

src/app/(dashboard)/_sidebar/account.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import { NEXT_CACHE_TAGS } from '@/constants/cache'
1616
import { ROUTES } from '@/constants/routes'
1717
import { api } from '@/lib/api'
1818
import { useSidebar } from '@/store/sidebar'
19-
import type { UserType } from '@/types/users'
19+
import type { User } from '@/types/users'
2020

2121
interface SidebarAccountProps {
22-
user: UserType
22+
user: User
2323
}
2424

2525
export function SidebarAccount({ user }: Readonly<SidebarAccountProps>) {

src/app/(dashboard)/_sidebar/container.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function DashboardSidebarContainer({
2020
className={cn(
2121
'border-border flex h-screen shrink-0 flex-col gap-8 overflow-x-hidden overflow-y-auto border-r py-6 transition-all duration-500',
2222
className,
23-
expanded ? 'w-56 px-6' : 'w-18 px-4',
23+
expanded ? 'w-60 px-6' : 'w-18 px-4',
2424
)}
2525
{...props}
2626
/>
@@ -30,7 +30,7 @@ export function DashboardSidebarContainer({
3030
variant='outline'
3131
data-expanded={expanded}
3232
className={cn(
33-
'text-disabled hover:text-foreground-soft absolute top-20 -right-4 z-50 size-8 rounded-full transition-all delay-75 duration-300 [&_svg]:size-5',
33+
'text-disabled hover:text-foreground-soft absolute top-20 -right-4 z-10 size-8 rounded-full transition-all delay-75 duration-300 [&_svg]:size-5',
3434
'data-[expanded=true]:rotate-180',
3535
)}
3636
onClick={toogleSidebar}

src/app/(dashboard)/encaminhados/_cards/mock-data.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { Metadata } from 'next'
22

3+
import { TeamListTable } from '@/modules/teams/table'
4+
35
export const metadata: Metadata = {
4-
title: 'Equipes',
6+
title: 'Equipe',
57
}
68

7-
import { MembersListTable } from './table'
8-
99
export default function Page() {
10-
return <MembersListTable />
10+
return <TeamListTable />
1111
}

src/app/(dashboard)/pacientes/(patients-list)/page.tsx

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/app/(dashboard)/pacientes/[id]/documentos/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PatientsDocuments } from './patients-documents'
1+
import { PatientDocuments } from '../../../../../modules/patients/documents'
22

33
const PATIENT_SECTIONS = [
44
{
@@ -46,5 +46,5 @@ export default function Page() {
4646
return <p className='text-foreground-soft'>Nenhum documento encontrado.</p>
4747
}
4848

49-
return <PatientsDocuments sections={PATIENT_SECTIONS} />
49+
return <PatientDocuments sections={PATIENT_SECTIONS} />
5050
}

0 commit comments

Comments
 (0)