Skip to content

Component Library Audit — Visual Refresh Tracker ​

Part of #3167 — UI Design Direction: "Medical Professional"

Generated 2026-03-24 | fixes #3686

Executive Summary ​

Audit of 95 shared component entries in instances/ppp/src/components/ and 43 module directories in instances/ppp/src/modules/. The MUI theme (src/themes/index.tsx) already covers Card, Button, Chip, Dialog, OutlinedInput, InputLabel, FormLabel, and AppBar overrides using the "Medical Professional" design tokens (src/themes/colors.ts). However, many components still use hardcoded hex values and inline sx styles instead of theme tokens, and a significant number of shared components lack Storybook coverage.

Key Metrics ​

MetricCount
Shared component entries (files + directories)95
Module directories43
Components with Storybook stories~30 of 95 shared
Components with hardcoded hex colours37 files in components/, 40+ files in modules/
Components with heavy inline sx usage40 files in components/

Priority Tier Definitions ​

TierDescriptionCriteria
P0Visible on every pageNavigation, layout shells, page headers, cards, global banners
P1Core feature pagesDashboard, CPD, Logbook, Wellness, Profile, Reviews
P2Secondary feature pagesTimesheets, WBA, MSF, Billing, Support
P3Admin / settingsHospital Admin, Super Admin, Settings, Signup flows

P0 — Global Components (visible on every page) ​

ComponentPathDesign Tokens?Matches Direction?Storybook?StatusNotes
PppAppContainercomponents/PppAppContainer/PartialNeeds workNoNEEDS REFRESH10 hardcoded hex colours; main app shell
PageLayoutcomponents/PageLayout/YesAlignedNoAlignedUses theme spacing; test exists
PageHeadercomponents/PageHeader/YesAlignedYesAlignedStories exist
PppBrandHeadercomponents/PppBrandHeader.tsxPartialNeeds workYesNEEDS REFRESHInline colour overrides in stories
BaseDialogcomponents/BaseDialog.tsxYesAlignedNoAlignedUses MuiDialog theme overrides
DialogTitlecomponents/DialogTitle.tsxNoNeeds workNoNEEDS REFRESH3 hardcoded hex colours
DialogTitleV2components/DialogTitleV2.tsxLikely yesReviewNoReview neededV2 replacement for DialogTitle
ConfirmDialogcomponents/ConfirmDialog/YesAlignedNoAlignedHas overview doc but no .stories.tsx
RoleSwitchercomponents/RoleSwitcher/NoNeeds workNoNEEDS REFRESH5 hardcoded colours in sx props
RouteTitlecomponents/RouteTitle.tsxYesAlignedNoAlignedSimple wrapper
AppErrorBoundarycomponents/AppErrorBoundary/PartialNeeds workNoNEEDS REFRESHPaymentErrorFallback has inline styles
ScrollToTopcomponents/ScrollToTop.tsxN/AN/ANoAlignedUtility, no visual

P0 — Dashboard Widgets ​

ComponentPathDesign Tokens?Matches Direction?Storybook?StatusNotes
BaseWidgetcomponents/widgets/BaseWidget.tsxNoNeeds workNoNEEDS REFRESH20 hardcoded hex colours; foundation for all widgets
WidgetSectioncomponents/widgets/WidgetSection.tsxNoNeeds workNoNEEDS REFRESH13 inline sx colour values
CPDWidgetcomponents/widgets/CPDWidget.tsxNoNeeds workYesNEEDS REFRESH7+ hardcoded colours
OverallCPDWidgetcomponents/widgets/components/OverallCPDWidget.tsxNoNeeds workYesNEEDS REFRESH40+ hardcoded hex colours; heavy charting
CategoryWidgetcomponents/widgets/components/CategoryWidget.tsxNoNeeds workNoNEEDS REFRESH21+ inline colour values
StyledComponentscomponents/widgets/components/StyledComponents.tsxNoNeeds workNoNEEDS REFRESHShared styled utils with hardcoded colours
DashboardWidgetscomponents/widgets/DashboardWidgets.tsxPartialReviewNoReview neededOrchestrator component
MobileDashboardWidgetscomponents/widgets/MobileDashboardWidgets.tsxNoNeeds workNoNEEDS REFRESH26 inline colour values
MobileDashboardCardcomponents/widgets/MobileDashboardCard.tsxNoNeeds workNoNEEDS REFRESHHardcoded background colour
RetrospectiveWidgetcomponents/widgets/RetrospectiveWidget.tsxPartialNeeds workYesNEEDS REFRESH5 hardcoded colours
SurgicalCasesWidgetcomponents/widgets/SurgicalLogbookWidgets/PartialReviewYesReview neededStories exist
CompetencyTargetWidgetcomponents/widgets/SurgicalLogbookWidgets/NoNeeds workYesNEEDS REFRESHHardcoded colour
CumulativeProgressWidgetcomponents/widgets/SurgicalLogbookWidgets/PartialReviewYesReview needed—
JCSTCompetencyWidgetcomponents/widgets/SurgicalLogbookWidgets/PartialReviewYesReview needed—
TargetGaugeWidgetcomponents/widgets/SurgicalLogbookWidgets/PartialReviewYesReview needed—
AppraisalsSummaryWidgetcomponents/widgets/AppraisalsWidgets/NoNeeds workYesNEEDS REFRESH5 hardcoded colours
WBASummaryWidgetcomponents/widgets/WBAWidgets/PartialReviewYesReview needed—
WBAWidgetscomponents/widgets/WBAWidgets/PartialReviewYesReview needed—
AppraisalsReceivedWidgetcomponents/widgets/WBAWidgets/PartialReviewYesReview needed—
TimesheetWidgetscomponents/widgets/TimesheetWidgets/PartialReviewYesReview neededMonthSelector + TimeAtWork stories
TimezoneSelectcomponents/widgets/components/TimezoneSelect.tsxNoNeeds workNoNEEDS REFRESH3 hardcoded colours

P1 — Core Feature Page Components ​

ComponentPathDesign Tokens?Matches Direction?Storybook?StatusNotes
DataGrid (DefaultStyledDataGrid)components/DataGrid/DefaultStyledDataGrid.tsxNoNeeds workNoNEEDS REFRESH2 hardcoded colours; used across all list views
CustomHeaderTablecomponents/DataGrid/CustomHeaderTable.tsxNoNeeds workNoNEEDS REFRESH4 hardcoded colours
UserEntityCellcomponents/DataGrid/UserEntityCell.tsxLikely yesAlignedYesAligned—
HoverActionsCellcomponents/DataGrid/HoverActionsCell.tsxReviewReviewNoReview needed—
VisibilityActioncomponents/DataGrid/VisibilityAction.tsxReviewReviewNoReview needed—
HospitalCellcomponents/DataGrid/HospitalCell.tsxReviewReviewNoReview needed—
ProcedureCellcomponents/DataGrid/ProcedureCell.tsxReviewReviewNoReview needed—
RelatedCategoryCellcomponents/DataGrid/RelatedCategoryCell.tsxReviewReviewNoReview needed—
FeedbackCardcomponents/FeedbackCard.tsxNoNeeds workYesNEEDS REFRESH4 hardcoded colours
ListViewcomponents/ListView.tsxNoNeeds workNoNEEDS REFRESH5 sx colour values
MobileListcomponents/MobileList.tsxNoNeeds workNoNEEDS REFRESH10 inline sx values, 4 hardcoded colours
GenericFilterBarcomponents/filters/GenericFilterBar.tsxPartialNeeds workYesNEEDS REFRESHHardcoded colour in stories
ExportButtoncomponents/export/ExportButton.tsxReviewAlignedYesAligned—
CadenceTrackercomponents/CadenceTracker.tsxReviewReviewYesReview needed—
CategoryColorIndicatorcomponents/CategoryColorIndicator.tsxReviewReviewYesReview needed—
CategorySelectorcomponents/CategorySelector.tsxReviewReviewNoReview needed—
ChartNavigationBannercomponents/ChartNavigationBanner.tsxNoNeeds workNoNEEDS REFRESH2 hardcoded colours
FormFieldContainercomponents/FormFieldContainer.tsxPartialNeeds workNoNEEDS REFRESHInline styles
FormLayoutcomponents/FormLayout/YesAlignedYesAligned—
FieldGroupContainercomponents/FieldGroupContainer.tsxReviewReviewNoReview needed—
ProfilePictureFieldcomponents/ProfilePictureField.tsxPartialReviewYesReview needed—
ProfileCompletionStatuscomponents/ProfileCompletionStatus.tsxReviewReviewNoReview needed—
ProfileCompletionGuardcomponents/ProfileCompletionGuard/ReviewReviewYesReview needed—
LogbookImageUploadercomponents/LogbookImageUploader.tsxNoNeeds workYesNEEDS REFRESH4+ hardcoded colours, 2 hardcoded in component
RatingRadioGroupcomponents/RatingRadioGroup.tsxReviewReviewNoReview needed—
RatingScalecomponents/RatingScale.tsxNoNeeds workNoNEEDS REFRESH2 hardcoded colours
UnsavedChangesDialogcomponents/UnsavedChangesDialog.tsxYesAlignedYesAligned—
GuidanceModalcomponents/GuidanceModal.tsxReviewReviewNoReview needed—

P1 — Key Module Pages ​

ModulePathDesign Tokens?Matches Direction?Storybook?StatusNotes
PPPDashboardmodules/PPPDashboard/NoNeeds workYes (index)NEEDS REFRESHDashboardScoreCards (2 hex), DashboardActivitiesTable (3 hex), DashboardDonutChart (1 hex); 16 hardcoded colours in stories
CPDActivitiesListmodules/CPDActivitiesList/NoNeeds workNoNEEDS REFRESH9 hardcoded hex colours
CPDActivitiesmodules/CPDActivities/NoNeeds workNoNEEDS REFRESHApproveCPD (9 hex), columnDefinition (3 hex)
CPDPlansmodules/CPDPlans/PartialNeeds workYes (partial)NEEDS REFRESHCPDPlanStatusBadge has 4 hardcoded colours
LogbookCasemodules/LogbookCase/PartialNeeds workYesReview neededStories exist for list, card, filter bar
WellnessScoremodules/WellnessScore/YesAlignedYesAlignedUses wellness design tokens properly
MyProfilemodules/MyProfile/PartialNeeds workYes (UpdateCV)NEEDS REFRESHMCRSummary has 4 hardcoded colours
Reviews (Feedback)modules/Reviews/NoNeeds workNoNEEDS REFRESH2 hardcoded colours in column config
EndOfYearReflectionmodules/EndOfYearReflection/ReviewReviewNoReview needed—

P2 — Secondary Feature Modules ​

Module / ComponentPathDesign Tokens?Matches Direction?Storybook?StatusNotes
Timesheetmodules/Timesheet/PartialReviewYesReview neededTimesheetModal + BatchReview stories exist
WBAmodules/WBA/PartialNeeds workYesNEEDS REFRESHhelper.tsx has 3 hardcoded colours
MSFmodules/MSF/NoNeeds workNoNEEDS REFRESHhelper.tsx has 3 hardcoded colours
MSFReportmodules/MSFReport/ReviewReviewNoReview needed—
MultiConsultantReportmodules/MultiConsultantReport/ReviewReviewNoReview needed—
PPP360Reviewsmodules/PPP360Reviews/ReviewReviewNoReview needed—
Notificationsmodules/Notifications/ReviewReviewNoReview needed—
Billing / PlansAndPricingmodules/Billing/, modules/PlansAndPricing/ReviewReviewNoReview needed—
Supportmodules/Support/PartialReviewYes (CPDResourceLibrary)Review needed—
UniversalSearchmodules/UniversalSearch/ReviewReviewNoReview needed—
HrPassportmodules/HrPassport/ReviewReviewNoReview needed—
MedicalPassportmodules/MedicalPassport/ReviewReviewNoReview needed—
Reportsmodules/Reports/ReviewReviewNoReview needed—
MakeCpdPlanmodules/MakeCpdPlan/NoNeeds workYes (partial)NEEDS REFRESHActivitiesSelectorModal (4 hex), ProgressInPoints (1 hex); stories have 14+ hardcoded colours
Development (Dev Tools)modules/Development/NoNeeds workYesNEEDS REFRESHconstants.ts has 3 hardcoded colours; column config has 2
Roadmap componentscomponents/roadmap/ReviewReviewYes (RoadmapTimeline)Review needed—
SelectMealBreakcomponents/SelectMealBreak/ReviewReviewYesReview needed—
PaymentSectioncomponents/PaymentSection/ReviewReviewNoReview needed—
PaymentStatusBannercomponents/PaymentStatusBanner/ReviewReviewYesReview needed—
PaymentStatusGuardcomponents/PaymentStatusGuard/ReviewReviewNoReview needed—
SignatureCanvascomponents/SignatureCanvas/NoNeeds workYesNEEDS REFRESH2 inline colours
SignatureModalcomponents/SignatureModal/NoNeeds workYesNEEDS REFRESH6 inline colours
HospitalSelectorcomponents/HospitalSelector/ReviewReviewNoReview needed—
HospitalApproverTablecomponents/HospitalApproverTable/NoNeeds workYes (Row)NEEDS REFRESHHospitalApproverRow (19 sx values), HospitalApproverTable (10 sx values)

P3 — Admin & Settings ​

Module / ComponentPathDesign Tokens?Matches Direction?Storybook?StatusNotes
Admin (Hospitals)modules/Admin/Hospitals/NoNeeds workNoNEEDS REFRESH4 hex in index, 3 in HospitalDetail
HospitalAdminmodules/HospitalAdmin/NoNeeds workNoNEEDS REFRESHDashboard (7 hex), CpdComplianceCard (8 hex), WellnessTrendsCard (5 hex), Settings (3 hex)
HospitalExecutiveAdminmodules/HospitalExecutiveAdmin/NoNeeds workNoNEEDS REFRESHDashboard (11 hardcoded colours)
HospitalSuperAdminmodules/HospitalSuperAdmin/NoNeeds workNoNEEDS REFRESHDashboard (3 hex), CpdComplianceOverview (8 hex), WorkHoursSummary (1 hex), WellnessTrendsChart (5 hex), FeatureToggles (2 hex)
HospitalStaffmodules/HospitalStaff/ReviewReviewNoReview needed—
Settingsmodules/Settings/ReviewReviewNoReview needed—
Usersmodules/Users/ReviewReviewNoReview needed—
WorkQueuemodules/WorkQueue/ReviewReviewYes (hook)Review needed—
AdminPageLayoutcomponents/AdminPageLayout/YesAlignedYesAlignedStories exist
AdminCardcomponents/admin/AdminCard.tsxPartialNeeds workYesNEEDS REFRESH1 hardcoded colour
StatusChipcomponents/admin/StatusChip.tsxNoNeeds workYesNEEDS REFRESH10 hardcoded hex colours
InlineTipcomponents/admin/InlineTip.tsxYesAlignedYesAligned—
StatsBarcomponents/admin/StatsBar.tsxReviewReviewYesReview needed—
AdminRoutecomponents/AdminRoute/N/AN/ANoAlignedAuth guard, no visual
Signupmodules/Signup/ReviewReviewYesReview needed—

P1 — Form Components ​

ComponentPathDesign Tokens?Matches Direction?Storybook?StatusNotes
LoginFormcomponents/LoginForm.tsxReviewReviewNoReview needed—
ForgotPasswordFormcomponents/ForgotPasswordForm.tsxNoNeeds workNoNEEDS REFRESH10 inline sx colour values
ChangePasswordFormcomponents/ChangePasswordForm.tsxReviewReviewNoReview needed—
SsoButtonscomponents/SsoButtons.tsxNoNeeds workNoNEEDS REFRESH5 sx values, 3 hardcoded colours
FormCheckboxcomponents/FormCheckbox.tsxReviewReviewNoReview needed—
HighLevelRequirementsSelectorcomponents/HighLevelRequirementsSelector.tsxReviewReviewNoReview needed—
CPDActivityProviderAutocompletecomponents/CPDActivityProviderAutocomplete.tsxReviewReviewNoReview needed—
CriticalConditionFieldcomponents/CriticalConditionField.tsxReviewReviewNoReview needed—
EditableFieldcomponents/EditableField.tsxReviewReviewNoReview needed—
NormalFormTreecomponents/NormalFormTree/NoNeeds workNoNEEDS REFRESHTreeNode.tsx has 13 hardcoded colours
UrnSearchFieldcomponents/UrnSearchField/NoNeeds workNoNEEDS REFRESH11 inline sx colour values
ExternalSurgeryLookupcomponents/ExternalSurgeryLookup/ReviewReviewNoReview needed—
ConceptDetailscomponents/ConceptDetails/ReviewReviewNoReview needed—
ActivityMasterListModalcomponents/ActivityMasterListModal.tsxNoNeeds workNoNEEDS REFRESH2 inline sx colours
AppraisalTypeSelectionModalcomponents/AppraisalTypeSelectionModal.tsxReviewReviewNoReview needed—
AuditEventCardcomponents/AuditEventCard.tsxReviewReviewNoReview needed—
AuditEventsBadgecomponents/AuditEventsBadge/ReviewReviewYesReview needed—

Utility / Non-Visual Components (No refresh needed) ​

ComponentPathNotes
ScrollToTopcomponents/ScrollToTop.tsxScroll utility
AdminRoutecomponents/AdminRoute/Auth guard
DrawerContentcomponents/DrawerContent.tsxLayout utility
EmptyRowscomponents/EmptyRows.tsxDataGrid spacer
HelpButtoncomponents/HelpButton/Minimal visual, 1 hardcoded colour
icons/ (22 custom icons)components/icons/SVG icons — review for colour consistency
shared/SurgerySectioncomponents/shared/SurgerySection.tsxForm section wrapper
ProcedureInformationcomponents/ProcedureInformation/Display component

Missing Storybook Stories — Complete List ​

The following shared components in instances/ppp/src/components/ have no .stories.tsx file:

P0 (must add first) ​

  1. PppAppContainer — main app shell
  2. BaseDialog — modal foundation
  3. DialogTitle / DialogTitleV2 — dialog headers
  4. ConfirmDialog — confirmation modal (has overview doc only)
  5. RoleSwitcher — role selector in nav
  6. AppErrorBoundary (+ CameraErrorFallback, ModalFormErrorFallback, PaymentErrorFallback)

P1 ​

  1. DataGrid/DefaultStyledDataGrid — base data grid (has overview doc only)
  2. DataGrid/CustomHeaderTable — custom header grid (has overview doc only)
  3. DataGrid/HoverActionsCell
  4. DataGrid/VisibilityAction
  5. DataGrid/HospitalCell (has overview doc only)
  6. DataGrid/ProcedureCell (has overview doc only)
  7. DataGrid/RelatedCategoryCell (has overview doc only)
  8. ListView
  9. MobileList
  10. ForgotPasswordForm
  11. LoginForm
  12. ChangePasswordForm
  13. SsoButtons
  14. FormFieldContainer
  15. FormCheckbox
  16. NormalFormTree
  17. UrnSearchField
  18. ExternalSurgeryLookup
  19. ConceptDetails
  20. CategorySelector
  21. ChartNavigationBanner
  22. FieldGroupContainer
  23. EditableField
  24. GuidanceModal
  25. RatingRadioGroup
  26. RatingScale
  27. ProfileCompletionStatus
  28. ActivityMasterListModal
  29. AppraisalTypeSelectionModal
  30. AuditEventCard
  31. HighLevelRequirementsSelector
  32. CPDActivityProviderAutocomplete
  33. CriticalConditionField

P2 ​

  1. HospitalSelector
  2. HospitalApproverTable (Row has stories, Table does not)
  3. PaymentSection (GenericPaymentForm, ApplePayButton, WalletPaymentButton)
  4. PaymentStatusGuard

Module-level pages with no stories ​

  1. modules/CPDActivities/
  2. modules/CPDActivitiesList/
  3. modules/Reviews/
  4. modules/MSF/
  5. modules/MSFReport/
  6. modules/MultiConsultantReport/
  7. modules/PPP360Reviews/
  8. modules/Notifications/
  9. modules/Billing/
  10. modules/PlansAndPricing/
  11. modules/Reports/
  12. modules/UniversalSearch/
  13. modules/HrPassport/
  14. modules/MedicalPassport/
  15. modules/Settings/
  16. modules/Users/
  17. modules/Admin/
  18. modules/HospitalAdmin/
  19. modules/HospitalExecutiveAdmin/
  20. modules/HospitalSuperAdmin/
  21. modules/HospitalStaff/
  22. modules/EndOfYearReflection/
  23. modules/MyProfile/ (only UpdateCV has stories)
  24. modules/AcceptInvite/
  25. modules/AwaitingActivation/
  26. modules/CompletePayment/
  27. modules/Guide/
  28. modules/PPPDashboard/ (index only)
  29. modules/Dashboard/

Summary of Findings ​

Refresh Status Distribution ​

StatusCount
NEEDS REFRESH (confirmed hardcoded colours / inline styles)~40 components/modules
Review needed (may need refresh, needs manual visual inspection)~35 components/modules
Aligned (uses theme tokens correctly)~15 components
N/A (utility / non-visual)~8 components

Top Issues ​

  1. Hardcoded hex colours are pervasive — 37 component files and 40+ module files contain color: '#...' or backgroundColor: '#...' outside the theme. The worst offenders are the dashboard widgets (BaseWidget, OverallCPDWidget, CategoryWidget, MobileDashboardWidgets), Hospital Admin dashboards, and the NormalFormTree.

  2. Storybook coverage gap — Only ~30 of 95 shared component entries have stories. Zero module-level pages (Dashboard, CPD list, Logbook list, etc.) have meaningful page-level stories. 72 items are missing stories entirely.

  3. Widget system is the largest debt — The components/widgets/ directory contains the most hardcoded colours (100+ across all widget files) and needs a systematic token migration before individual widget refreshes.

  4. Admin dashboards are entirely un-tokenised — HospitalAdmin, HospitalExecutiveAdmin, and HospitalSuperAdmin dashboards collectively contain 40+ hardcoded hex values with no Storybook stories.

  5. Wellness module is well-aligned — The WellnessScore module correctly uses the dedicated wellness palette tokens and has good Storybook coverage. This should be the reference implementation.

  1. Create per-component refresh issues for all items marked "NEEDS REFRESH", starting with P0 tier
  2. Migrate widget colour constants to src/themes/colors.ts as a batch (widget tokens PR)
  3. Add Storybook stories for all P0 components before visual refresh work begins
  4. Use WellnessScore module as the gold standard for how modules should adopt design tokens
  5. Admin dashboards can be refreshed as a single batch since they share the same chart/card patterns

Internal documentation — org members only