adilallo/maintanence/ComponentOrganizationPolish #40
Reference in New Issue
Block a user
Delete Branch "adilallo/maintanence/ComponentOrganizationPolish"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Component Reorganization, Figma Prop Alignment, and TopNav Consolidation
Overview
This PR implements a comprehensive reorganization of the component library, aligns all component props with Figma design specifications, consolidates navigation components into a unified TopNav, and restructures the app using Next.js route groups. This work establishes a cleaner, more maintainable codebase with a single source of truth for component APIs aligned with design specifications.
Changes
Component Reorganization
buttons/- Button componentscards/- Card components (IconCard, MiniCard, NumberCard, RuleCard)content/- Content-related components (ContentContainer, ContentThumbnailTemplate)controls/- Form controls (Checkbox, MultiSelect, SelectInput, Switch, TextArea, TextInput, Toggle, etc.)ContextMenu/- Context menu componentsicons/- Icon componentslocalization/- Localization components (LanguageSwitcher)modals/- Modal components (Alert, Create, Tooltip)navigation/- Navigation components (Footer, MenuBar, MenuBarItem, TopNav)progress/- Progress components (ProportionBar, Stepper)sections/- Section components (AskOrganizer, FeatureGrid, HeroBanner, NumberedCards, QuoteBlock, RelatedArticles, RuleStack)type/- Typography components (ContentLockup)utility/- Utility components (InputLabel, ModalFooter, ModalHeader, Separator)TopNav Consolidation
Header,HomeHeader,ConditionalHeader, andHeaderTabcomponentsTopNavcomponentTopNavnow handles all variants (folderTop true/false, loggedIn states, responsive breakpoints)TopNavWithPathnamewrapper for client-side pathname handlingTopNavcomponentFigma Prop Alignment
Button Component:
variantprop withbuttonType+palettepropsbuttonState,hasIconLeading,hasIconFollowing,hasTextpropsSwitch Component:
checkedandlabelprops withpropSwitchandtextpropsMultiSelect Component:
showAddButtonprop withaddButtonpropSelectInput Component:
labelstring prop withlabelText+showLabelpropsasterisk,iconHelp,textOptional,textData,iconRight,textHint,showLabel,stateTextInput Component:
textHintandformHeaderprops (Figma alignment)TextArea Component:
textHint,formHeader, andshowHelpIconprops (Figma alignment)Alert Component:
hasLeadingIconandhasBodyTextprops (Figma alignment)Create Modal Component:
createBlockArray,textInput,textArea,multiSelect,upload,proportionModalFooter Component:
stepperprop (Figma alignment)Backward Compatibility Removal
variantprop support from Button (now usesbuttonType+palette)checkedandlabelprops from Switch (now usespropSwitch+text)showAddButtonprop from MultiSelect (now usesaddButton)labelprop from SelectInput (now useslabelText+showLabel)normalizeVariantfunction andVariantValuetype from propNormalizationProgress → ProportionBar Rename
progress/Progress/→progress/ProportionBar/Next.js Route Groups
(marketing)/- Marketing pages (home, blog, learn)(admin)/- Admin pages (monitor)(dev)/- Development pages (components-preview)Prop Normalization Updates
normalizeButtonType,normalizeButtonPalette,normalizeButtonStatefunctionsButtonTypeValue,ButtonPaletteValue,ButtonStateValuetypesnormalizeVariantfunction andVariantValuetypeStory Updates
buttonType+paletteprops (56+ usages updated)propSwitch+textpropsaddButtonpropTest Updates
buttonType+palettepropSwitch+textaddButtonlabelText+showLabelImport Path Fixes
app/(admin)/monitor/page.tsx- Fixed component importsapp/(marketing)/learn/page.tsx- Fixed ContentThumbnailTemplate import