From e6127f1a3ff92d68de43c1e3b71cdfb74a57f2e0 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Wed, 29 Apr 2026 07:20:16 -0600 Subject: [PATCH] Component cleanup --- .cursor/rules/component-props.mdc | 5 +- .cursor/rules/component-structure.mdc | 47 ++++- .cursor/rules/create-flow.mdc | 2 +- .cursor/rules/routes.mdc | 8 +- AGENTS.md | 5 + README.md | 4 +- app/(admin)/monitor/MonitorPageContent.tsx | 6 +- .../WebVitalsDashboard.container.tsx | 5 +- .../WebVitalsDashboard.types.ts | 2 +- .../WebVitalsDashboard.view.tsx | 0 .../_components}/WebVitalsDashboard/index.tsx | 0 app/(app)/create/CreateFlowLayoutClient.tsx | 4 +- .../components/ApplicableScopeField.tsx | 2 +- .../CreateFlowLockupCardStepShell.tsx | 4 +- .../create/components/ModalTextAreaField.tsx | 2 +- .../create/review-template/[slug]/page.tsx | 4 +- .../card/CommunicationMethodsScreen.tsx | 2 +- .../screens/card/ConflictManagementScreen.tsx | 2 +- .../screens/card/MembershipMethodsScreen.tsx | 2 +- .../screens/completed/CompletedScreen.tsx | 10 +- .../screens/review/CommunityReviewScreen.tsx | 10 +- .../screens/review/FinalReviewScreen.tsx | 17 +- .../right-rail/DecisionApproachesScreen.tsx | 33 +-- .../profile/_components/ProfilePage.view.tsx | 16 +- app/(marketing)/page.tsx | 36 ++-- app/(marketing)/rules/[id]/page.tsx | 4 +- .../{icons => asset/Avatar}/Avatar.tsx | 0 app/components/asset/Avatar/index.tsx | 2 + .../AvatarContainer/AvatarContainer.tsx | 0 .../AvatarContainer/index.tsx | 0 app/components/asset/{ => icon}/Icon.tsx | 20 +- app/components/asset/icon/index.tsx | 3 + app/components/asset/index.tsx | 3 - .../buttons/{ => Button}/Button.tsx | 2 +- app/components/buttons/Button/index.tsx | 1 + .../InlineTextButton.tsx | 0 .../buttons/InlineTextButton/index.tsx | 2 + app/components/cards/Card/Card.view.tsx | 101 --------- app/components/cards/Card/index.tsx | 2 - .../CardStack/CardStack.container.tsx | 3 +- .../CardStack/CardStack.types.ts | 0 .../CardStack/CardStack.view.tsx | 32 +-- .../{utility => cards}/CardStack/index.tsx | 0 .../Icon.container.tsx} | 12 +- .../IconCard.types.ts => Icon/Icon.types.ts} | 4 +- .../IconCard.view.tsx => Icon/Icon.view.tsx} | 6 +- app/components/cards/Icon/index.tsx | 2 + app/components/cards/IconCard/index.tsx | 2 - .../Mini.container.tsx} | 14 +- .../MiniCard.types.ts => Mini/Mini.types.ts} | 4 +- .../MiniCard.view.tsx => Mini/Mini.view.tsx} | 10 +- app/components/cards/Mini/index.tsx | 2 + app/components/cards/MiniCard/index.tsx | 2 - .../Rule.container.tsx} | 12 +- .../RuleCard.types.ts => Rule/Rule.types.ts} | 15 +- .../RuleCard.view.tsx => Rule/Rule.view.tsx} | 8 +- app/components/cards/Rule/index.tsx | 2 + app/components/cards/RuleCard/index.tsx | 5 - .../Selection.container.tsx} | 16 +- .../Selection.types.ts} | 6 +- .../cards/Selection/Selection.view.tsx | 104 ++++++++++ app/components/cards/Selection/index.tsx | 2 + .../cards/{NumberCard.tsx => Step/Step.tsx} | 15 +- app/components/cards/Step/index.tsx | 2 + .../TemplateChipDetailModal.tsx | 2 +- .../TemplateReviewCard/TemplateReviewCard.tsx | 19 +- .../controls/Checkbox/Checkbox.container.tsx | 2 +- .../CheckboxGroup/CheckboxGroup.container.tsx | 2 +- .../controls/Chip/Chip.container.tsx | 2 +- .../IncrementerBlock.types.ts | 2 +- .../IncrementerBlock.view.tsx | 2 +- .../InfoMessageBox.container.tsx | 5 +- .../InfoMessageBox/InfoMessageBox.types.ts | 0 .../InfoMessageBox/InfoMessageBox.view.tsx | 2 +- .../InfoMessageBox/index.tsx | 0 .../InputWithCounter.container.tsx | 2 +- .../MultiSelect/MultiSelect.container.tsx | 2 +- .../controls/MultiSelect/MultiSelect.view.tsx | 4 +- .../RadioGroup/RadioGroup.container.tsx | 2 +- .../SelectInput/SelectInput.container.tsx | 2 +- .../SelectOption/SelectOption.container.tsx | 2 +- .../controls/Switch/Switch.container.tsx | 2 +- .../controls/TextArea/TextArea.container.tsx | 2 +- .../TextInput/TextInput.container.tsx | 2 +- .../controls/Toggle/Toggle.container.tsx | 2 +- .../ToggleGroup/ToggleGroup.container.tsx | 2 +- .../controls/Upload/Upload.container.tsx | 2 +- .../controls/Upload/Upload.view.tsx | 2 +- app/components/layout/List/List.types.ts | 2 +- .../layout/ListEntry/ListEntry.types.ts | 2 +- .../layout/ListEntry/ListEntry.view.tsx | 2 +- .../modals/ContextMenu/ContextMenu.tsx | 41 ---- .../modals/ContextMenu/ContextMenuDivider.tsx | 27 --- .../modals/ContextMenu/ContextMenuSection.tsx | 36 ---- .../ContextMenuItem.container.tsx | 101 --------- .../ContextMenuItem/ContextMenuItem.types.ts | 27 --- .../ContextMenuItem/ContextMenuItem.view.tsx | 71 ------- .../modals/ContextMenuItem/index.tsx | 2 - app/components/modals/Create/Create.view.tsx | 4 +- .../modals/Create/useCreateModalA11y.ts | 2 +- .../modals/Dialog/Dialog.container.tsx | 5 +- app/components/modals/Dialog/Dialog.view.tsx | 4 +- app/components/modals/Login/Login.view.tsx | 2 +- .../ModalFooter/ModalFooter.container.tsx | 2 +- .../ModalFooter/ModalFooter.types.ts | 0 .../ModalFooter/ModalFooter.view.tsx | 0 .../{utility => modals}/ModalFooter/index.tsx | 0 .../ModalHeader/ModalHeader.container.tsx | 2 +- .../ModalHeader/ModalHeader.types.ts | 0 .../ModalHeader/ModalHeader.view.tsx | 0 .../{utility => modals}/ModalHeader/index.tsx | 0 .../ConditionalNavigationClient.tsx | 4 +- .../CreateFlowFooter.container.tsx | 2 +- .../CreateFlowFooter.types.ts | 0 .../CreateFlowFooter.view.tsx | 0 .../CreateFlowFooter/index.tsx | 0 .../CreateFlowTopNav.container.tsx | 4 +- .../CreateFlowTopNav.types.ts | 0 .../CreateFlowTopNav.view.tsx | 6 +- .../CreateFlowTopNav/index.tsx | 0 app/components/navigation/Footer.tsx | 6 +- .../navigation/{MenuBar.tsx => Menu.tsx} | 16 +- .../navigation/MenuBarItem/index.tsx | 2 - .../MenuItem.container.tsx} | 14 +- .../MenuItem.types.ts} | 22 +- .../MenuItem.view.tsx} | 10 +- app/components/navigation/MenuItem/index.tsx | 2 + .../Top.container.tsx} | 91 ++++----- .../TopNav.types.ts => Top/Top.types.ts} | 4 +- .../TopNav.view.tsx => Top/Top.view.tsx} | 84 ++++---- .../TopWithPathname.tsx} | 18 +- app/components/navigation/Top/index.tsx | 3 + app/components/navigation/TopNav/index.tsx | 3 - .../CardSteps/CardSteps.container.tsx | 40 ++++ .../sections/CardSteps/CardSteps.types.ts | 18 ++ .../sections/CardSteps/CardSteps.view.tsx | 61 ++++++ app/components/sections/CardSteps/index.tsx | 2 + .../CommunityRuleDocument.types.ts | 16 -- .../CommunityRuleDocument.view.tsx | 65 ------ .../sections/CommunityRuleDocument/index.tsx | 2 - .../sections/FeatureGrid/FeatureGrid.view.tsx | 6 +- .../GovernanceTemplateGrid.tsx | 4 +- .../NumberedCards/NumberedCards.container.tsx | 35 ---- .../NumberedCards/NumberedCards.types.ts | 15 -- .../NumberedCards/NumberedCards.view.tsx | 70 ------- .../sections/NumberedCards/index.tsx | 2 - .../sections/RuleStack/RuleStack.view.tsx | 2 +- .../type/CommunityRule/CommunityRule.types.ts | 28 +++ .../type/CommunityRule/CommunityRule.view.tsx | 56 +++++ app/components/type/CommunityRule/index.tsx | 7 + .../type/HeaderLockup/HeaderLockup.view.tsx | 15 +- .../InputLabel/InputLabel.container.tsx | 3 +- .../InputLabel/InputLabel.types.ts | 0 .../InputLabel/InputLabel.view.tsx | 0 .../{utility => type}/InputLabel/index.tsx | 0 app/components/type/Section/Section.types.ts | 10 + app/components/type/Section/Section.view.tsx | 55 +++++ app/components/type/Section/index.tsx | 2 + .../SectionHeader}/SectionHeader.tsx | 50 +++-- app/components/type/SectionHeader/index.tsx | 2 + .../type/TextBlock/TextBlock.types.ts | 11 + .../type/TextBlock/TextBlock.view.tsx | 71 +++++++ app/components/type/TextBlock/index.tsx | 2 + .../DecisionMakingSidebar.container.tsx | 44 ---- .../DecisionMakingSidebar.types.ts | 33 --- .../DecisionMakingSidebar.view.tsx | 76 ------- .../utility/DecisionMakingSidebar/index.tsx | 2 - .../utility/Scrollbar/Scrollbar.container.tsx | 2 +- .../utility/Separator/Separator.tsx | 13 -- app/components/utility/Separator/index.tsx | 1 - app/components/utility/Tag/Tag.container.tsx | 2 +- app/components/utility/Tag/Tag.view.tsx | 15 +- app/not-found.tsx | 4 +- docs/README.md | 3 + docs/create-flow.md | 4 +- docs/figma-component-registry.md | 192 +++++++++++++++++- docs/guides/backend-linear-tickets.md | 20 +- lib/assetUtils.ts | 9 + lib/create/buildFinalReviewCategories.ts | 2 +- lib/create/buildPublishPayload.ts | 17 +- lib/create/documentEntryGuards.ts | 26 +++ lib/create/templateReviewMapping.ts | 26 +-- lib/propNormalization.ts | 34 ++-- messages/en/components/cardSteps.json | 7 + .../en/components/{menuBar.json => menu.json} | 0 messages/en/components/numberedCards.json | 8 - messages/en/create/topNav.json | 2 + messages/en/index.ts | 8 +- messages/en/pages/home.json | 5 +- next.config.mjs | 2 +- prisma/seed.ts | 2 +- .../assets/{Vector_Dao.svg => vector/dao.svg} | 0 .../default.svg} | 0 .../mutual-aid.svg} | 0 .../open-source.svg} | 0 .../{Vector_Shapes.svg => vector/shapes.svg} | 0 .../worker-coop.svg} | 0 stories/ContextMenu/ContextMenu.stories.js | 138 ------------- stories/WebVitalsDashboard.stories.js | 4 +- stories/{icons => asset}/Avatar.stories.js | 6 +- .../AvatarContainer.stories.js | 8 +- stories/asset/Icon.stories.js | 4 +- stories/{icons => asset}/Logo.stories.js | 10 +- .../CardStack.stories.js | 6 +- .../{IconCard.stories.js => Icon.stories.js} | 10 +- .../{MiniCard.stories.js => Mini.stories.js} | 14 +- .../{RuleCard.stories.js => Rule.stories.js} | 14 +- .../{Card.stories.js => Selection.stories.js} | 14 +- ...{NumberCard.stories.js => Step.stories.js} | 44 ++-- stories/cards/TemplateReviewCard.stories.js | 4 +- .../InfoMessageBox.stories.js | 4 +- .../RailLockupAndInfoBox.stories.js} | 27 ++- .../ModalFooter.stories.js | 4 +- .../ModalHeader.stories.js | 4 +- .../CreateFlowFooter.stories.js | 4 +- .../CreateFlowTopNav.stories.js | 4 +- stories/navigation/Menu.stories.js | 101 +++++++++ stories/navigation/MenuBar.stories.js | 101 --------- ...BarItem.stories.js => MenuItem.stories.js} | 74 +++---- .../{TopNav.stories.js => Top.stories.js} | 10 +- stories/pages/CompletedPage.stories.js | 2 +- stories/pages/FinalReviewPage.stories.js | 2 +- ...dCards.stories.js => CardSteps.stories.js} | 23 ++- .../sections/CommunityRuleDocument.stories.js | 58 ------ stories/sections/FeatureGrid.stories.js | 6 +- .../GovernanceTemplateGrid.stories.js | 2 +- stories/sections/RuleStack.stories.js | 2 +- stories/type/CommunityRule.stories.js | 85 ++++++++ stories/type/Section.stories.tsx | 56 +++++ .../SectionHeader.stories.js | 34 +++- stories/type/TextBlock.stories.js | 35 ++++ stories/utility/Separator.stories.js | 28 --- ...cument.test.tsx => CommunityRule.test.tsx} | 10 +- tests/components/ContextMenu.test.tsx | 23 --- tests/components/ContextMenuItem.test.tsx | 25 --- tests/components/CreateFlowFooter.test.tsx | 2 +- tests/components/CreateFlowTopNav.test.tsx | 2 +- .../components/DecisionMakingSidebar.test.tsx | 38 ---- tests/components/FinalReviewPage.test.tsx | 12 +- tests/components/Icon.test.tsx | 108 +++++++++- tests/components/IconCard.test.tsx | 112 ---------- tests/components/InfoMessageBox.test.tsx | 2 +- tests/components/InputLabel.test.tsx | 2 +- tests/components/Logo.test.tsx | 2 +- tests/components/ModalFooter.test.tsx | 2 +- tests/components/ModalHeader.test.tsx | 2 +- tests/components/ReviewPage.test.tsx | 6 +- tests/components/Section.test.tsx | 30 +++ tests/components/SectionHeader.test.tsx | 2 +- tests/components/Separator.test.tsx | 22 -- tests/components/TemplateReviewCard.test.tsx | 4 +- tests/components/TextBlock.test.tsx | 26 +++ .../{TopNav.test.tsx => Top.test.tsx} | 28 +-- tests/e2e/critical-journeys.spec.ts | 8 +- tests/pages/decision-approaches.test.jsx | 17 +- tests/pages/home.test.jsx | 16 +- tests/pages/page-flow.test.jsx | 13 +- tests/pages/user-journey.test.jsx | 22 +- tests/unit/CardStack.test.jsx | 2 +- ...beredCards.test.jsx => CardSteps.test.jsx} | 96 ++++----- .../unit/{RuleCard.test.jsx => Rule.test.jsx} | 42 ++-- tests/unit/RuleStack.test.jsx | 2 +- .../{Card.test.jsx => Selection.test.jsx} | 26 +-- .../{NumberCard.test.jsx => Step.test.jsx} | 54 ++--- tests/unit/buildPublishPayload.test.ts | 33 +++ tests/unit/templateReviewMapping.test.ts | 2 +- tests/utils/test-utils.tsx | 2 +- 267 files changed, 2087 insertions(+), 2196 deletions(-) rename app/{components/sections => (admin)/monitor/_components}/WebVitalsDashboard/WebVitalsDashboard.container.tsx (95%) rename app/{components/sections => (admin)/monitor/_components}/WebVitalsDashboard/WebVitalsDashboard.types.ts (92%) rename app/{components/sections => (admin)/monitor/_components}/WebVitalsDashboard/WebVitalsDashboard.view.tsx (100%) rename app/{components/sections => (admin)/monitor/_components}/WebVitalsDashboard/index.tsx (100%) rename app/components/{icons => asset/Avatar}/Avatar.tsx (100%) create mode 100644 app/components/asset/Avatar/index.tsx rename app/components/{utility => asset}/AvatarContainer/AvatarContainer.tsx (100%) rename app/components/{utility => asset}/AvatarContainer/index.tsx (100%) rename app/components/asset/{ => icon}/Icon.tsx (83%) create mode 100644 app/components/asset/icon/index.tsx delete mode 100644 app/components/asset/index.tsx rename app/components/buttons/{ => Button}/Button.tsx (99%) create mode 100644 app/components/buttons/Button/index.tsx rename app/components/buttons/{ => InlineTextButton}/InlineTextButton.tsx (100%) create mode 100644 app/components/buttons/InlineTextButton/index.tsx delete mode 100644 app/components/cards/Card/Card.view.tsx delete mode 100644 app/components/cards/Card/index.tsx rename app/components/{utility => cards}/CardStack/CardStack.container.tsx (96%) rename app/components/{utility => cards}/CardStack/CardStack.types.ts (100%) rename app/components/{utility => cards}/CardStack/CardStack.view.tsx (97%) rename app/components/{utility => cards}/CardStack/index.tsx (100%) rename app/components/cards/{IconCard/IconCard.container.tsx => Icon/Icon.container.tsx} (70%) rename app/components/cards/{IconCard/IconCard.types.ts => Icon/Icon.types.ts} (80%) rename app/components/cards/{IconCard/IconCard.view.tsx => Icon/Icon.view.tsx} (91%) create mode 100644 app/components/cards/Icon/index.tsx delete mode 100644 app/components/cards/IconCard/index.tsx rename app/components/cards/{MiniCard/MiniCard.container.tsx => Mini/Mini.container.tsx} (90%) rename app/components/cards/{MiniCard/MiniCard.types.ts => Mini/Mini.types.ts} (90%) rename app/components/cards/{MiniCard/MiniCard.view.tsx => Mini/Mini.view.tsx} (93%) create mode 100644 app/components/cards/Mini/index.tsx delete mode 100644 app/components/cards/MiniCard/index.tsx rename app/components/cards/{RuleCard/RuleCard.container.tsx => Rule/Rule.container.tsx} (90%) rename app/components/cards/{RuleCard/RuleCard.types.ts => Rule/Rule.types.ts} (86%) rename app/components/cards/{RuleCard/RuleCard.view.tsx => Rule/Rule.view.tsx} (98%) create mode 100644 app/components/cards/Rule/index.tsx delete mode 100644 app/components/cards/RuleCard/index.tsx rename app/components/cards/{Card/Card.container.tsx => Selection/Selection.container.tsx} (61%) rename app/components/cards/{Card/Card.types.ts => Selection/Selection.types.ts} (76%) create mode 100644 app/components/cards/Selection/Selection.view.tsx create mode 100644 app/components/cards/Selection/index.tsx rename app/components/cards/{NumberCard.tsx => Step/Step.tsx} (90%) create mode 100644 app/components/cards/Step/index.tsx rename app/components/{utility => controls}/InfoMessageBox/InfoMessageBox.container.tsx (90%) rename app/components/{utility => controls}/InfoMessageBox/InfoMessageBox.types.ts (100%) rename app/components/{utility => controls}/InfoMessageBox/InfoMessageBox.view.tsx (97%) rename app/components/{utility => controls}/InfoMessageBox/index.tsx (100%) delete mode 100644 app/components/modals/ContextMenu/ContextMenu.tsx delete mode 100644 app/components/modals/ContextMenu/ContextMenuDivider.tsx delete mode 100644 app/components/modals/ContextMenu/ContextMenuSection.tsx delete mode 100644 app/components/modals/ContextMenuItem/ContextMenuItem.container.tsx delete mode 100644 app/components/modals/ContextMenuItem/ContextMenuItem.types.ts delete mode 100644 app/components/modals/ContextMenuItem/ContextMenuItem.view.tsx delete mode 100644 app/components/modals/ContextMenuItem/index.tsx rename app/components/{utility => modals}/ModalFooter/ModalFooter.container.tsx (83%) rename app/components/{utility => modals}/ModalFooter/ModalFooter.types.ts (100%) rename app/components/{utility => modals}/ModalFooter/ModalFooter.view.tsx (100%) rename app/components/{utility => modals}/ModalFooter/index.tsx (100%) rename app/components/{utility => modals}/ModalHeader/ModalHeader.container.tsx (83%) rename app/components/{utility => modals}/ModalHeader/ModalHeader.types.ts (100%) rename app/components/{utility => modals}/ModalHeader/ModalHeader.view.tsx (100%) rename app/components/{utility => modals}/ModalHeader/index.tsx (100%) rename app/components/{utility => navigation}/CreateFlowFooter/CreateFlowFooter.container.tsx (92%) rename app/components/{utility => navigation}/CreateFlowFooter/CreateFlowFooter.types.ts (100%) rename app/components/{utility => navigation}/CreateFlowFooter/CreateFlowFooter.view.tsx (100%) rename app/components/{utility => navigation}/CreateFlowFooter/index.tsx (100%) rename app/components/{utility => navigation}/CreateFlowTopNav/CreateFlowTopNav.container.tsx (88%) rename app/components/{utility => navigation}/CreateFlowTopNav/CreateFlowTopNav.types.ts (100%) rename app/components/{utility => navigation}/CreateFlowTopNav/CreateFlowTopNav.view.tsx (96%) rename app/components/{utility => navigation}/CreateFlowTopNav/index.tsx (100%) rename app/components/navigation/{MenuBar.tsx => Menu.tsx} (81%) delete mode 100644 app/components/navigation/MenuBarItem/index.tsx rename app/components/navigation/{MenuBarItem/MenuBarItem.container.tsx => MenuItem/MenuItem.container.tsx} (93%) rename app/components/navigation/{MenuBarItem/MenuBarItem.types.ts => MenuItem/MenuItem.types.ts} (61%) rename app/components/navigation/{MenuBarItem/MenuBarItem.view.tsx => MenuItem/MenuItem.view.tsx} (74%) create mode 100644 app/components/navigation/MenuItem/index.tsx rename app/components/navigation/{TopNav/TopNav.container.tsx => Top/Top.container.tsx} (77%) rename app/components/navigation/{TopNav/TopNav.types.ts => Top/Top.types.ts} (94%) rename app/components/navigation/{TopNav/TopNav.view.tsx => Top/Top.view.tsx} (87%) rename app/components/navigation/{TopNav/TopNavWithPathname.tsx => Top/TopWithPathname.tsx} (77%) create mode 100644 app/components/navigation/Top/index.tsx delete mode 100644 app/components/navigation/TopNav/index.tsx create mode 100644 app/components/sections/CardSteps/CardSteps.container.tsx create mode 100644 app/components/sections/CardSteps/CardSteps.types.ts create mode 100644 app/components/sections/CardSteps/CardSteps.view.tsx create mode 100644 app/components/sections/CardSteps/index.tsx delete mode 100644 app/components/sections/CommunityRuleDocument/CommunityRuleDocument.types.ts delete mode 100644 app/components/sections/CommunityRuleDocument/CommunityRuleDocument.view.tsx delete mode 100644 app/components/sections/CommunityRuleDocument/index.tsx delete mode 100644 app/components/sections/NumberedCards/NumberedCards.container.tsx delete mode 100644 app/components/sections/NumberedCards/NumberedCards.types.ts delete mode 100644 app/components/sections/NumberedCards/NumberedCards.view.tsx delete mode 100644 app/components/sections/NumberedCards/index.tsx create mode 100644 app/components/type/CommunityRule/CommunityRule.types.ts create mode 100644 app/components/type/CommunityRule/CommunityRule.view.tsx create mode 100644 app/components/type/CommunityRule/index.tsx rename app/components/{utility => type}/InputLabel/InputLabel.container.tsx (89%) rename app/components/{utility => type}/InputLabel/InputLabel.types.ts (100%) rename app/components/{utility => type}/InputLabel/InputLabel.view.tsx (100%) rename app/components/{utility => type}/InputLabel/index.tsx (100%) create mode 100644 app/components/type/Section/Section.types.ts create mode 100644 app/components/type/Section/Section.view.tsx create mode 100644 app/components/type/Section/index.tsx rename app/components/{sections => type/SectionHeader}/SectionHeader.tsx (53%) create mode 100644 app/components/type/SectionHeader/index.tsx create mode 100644 app/components/type/TextBlock/TextBlock.types.ts create mode 100644 app/components/type/TextBlock/TextBlock.view.tsx create mode 100644 app/components/type/TextBlock/index.tsx delete mode 100644 app/components/utility/DecisionMakingSidebar/DecisionMakingSidebar.container.tsx delete mode 100644 app/components/utility/DecisionMakingSidebar/DecisionMakingSidebar.types.ts delete mode 100644 app/components/utility/DecisionMakingSidebar/DecisionMakingSidebar.view.tsx delete mode 100644 app/components/utility/DecisionMakingSidebar/index.tsx delete mode 100644 app/components/utility/Separator/Separator.tsx delete mode 100644 app/components/utility/Separator/index.tsx create mode 100644 lib/create/documentEntryGuards.ts create mode 100644 messages/en/components/cardSteps.json rename messages/en/components/{menuBar.json => menu.json} (100%) delete mode 100644 messages/en/components/numberedCards.json rename public/assets/{Vector_Dao.svg => vector/dao.svg} (100%) rename public/assets/{Vector_Default.svg => vector/default.svg} (100%) rename public/assets/{Vector_MutualAid.svg => vector/mutual-aid.svg} (100%) rename public/assets/{Vector_OpenSource.svg => vector/open-source.svg} (100%) rename public/assets/{Vector_Shapes.svg => vector/shapes.svg} (100%) rename public/assets/{Vector_WorkerCoop.svg => vector/worker-coop.svg} (100%) delete mode 100644 stories/ContextMenu/ContextMenu.stories.js rename stories/{icons => asset}/Avatar.stories.js (93%) rename stories/{utility => asset}/AvatarContainer.stories.js (95%) rename stories/{icons => asset}/Logo.stories.js (94%) rename stories/{create-flow => cards}/CardStack.stories.js (94%) rename stories/cards/{IconCard.stories.js => Icon.stories.js} (88%) rename stories/cards/{MiniCard.stories.js => Mini.stories.js} (90%) rename stories/cards/{RuleCard.stories.js => Rule.stories.js} (98%) rename stories/cards/{Card.stories.js => Selection.stories.js} (95%) rename stories/cards/{NumberCard.stories.js => Step.stories.js} (79%) rename stories/{utility => controls}/InfoMessageBox.stories.js (86%) rename stories/{utility/DecisionMakingSidebar.stories.js => controls/RailLockupAndInfoBox.stories.js} (52%) rename stories/{utility => modals}/ModalFooter.stories.js (93%) rename stories/{utility => modals}/ModalHeader.stories.js (87%) rename stories/{utility => navigation}/CreateFlowFooter.stories.js (89%) rename stories/{utility => navigation}/CreateFlowTopNav.stories.js (91%) create mode 100644 stories/navigation/Menu.stories.js delete mode 100644 stories/navigation/MenuBar.stories.js rename stories/navigation/{MenuBarItem.stories.js => MenuItem.stories.js} (64%) rename stories/navigation/{TopNav.stories.js => Top.stories.js} (97%) rename stories/sections/{NumberedCards.stories.js => CardSteps.stories.js} (68%) delete mode 100644 stories/sections/CommunityRuleDocument.stories.js create mode 100644 stories/type/CommunityRule.stories.js create mode 100644 stories/type/Section.stories.tsx rename stories/{sections => type}/SectionHeader.stories.js (71%) create mode 100644 stories/type/TextBlock.stories.js delete mode 100644 stories/utility/Separator.stories.js rename tests/components/{CommunityRuleDocument.test.tsx => CommunityRule.test.tsx} (69%) delete mode 100644 tests/components/ContextMenu.test.tsx delete mode 100644 tests/components/ContextMenuItem.test.tsx delete mode 100644 tests/components/DecisionMakingSidebar.test.tsx delete mode 100644 tests/components/IconCard.test.tsx create mode 100644 tests/components/Section.test.tsx delete mode 100644 tests/components/Separator.test.tsx create mode 100644 tests/components/TextBlock.test.tsx rename tests/components/{TopNav.test.tsx => Top.test.tsx} (80%) rename tests/unit/{NumberedCards.test.jsx => CardSteps.test.jsx} (55%) rename tests/unit/{RuleCard.test.jsx => Rule.test.jsx} (80%) rename tests/unit/{Card.test.jsx => Selection.test.jsx} (76%) rename tests/unit/{NumberCard.test.jsx => Step.test.jsx} (81%) diff --git a/.cursor/rules/component-props.mdc b/.cursor/rules/component-props.mdc index 200beec..dcc5917 100644 --- a/.cursor/rules/component-props.mdc +++ b/.cursor/rules/component-props.mdc @@ -34,8 +34,9 @@ export type ChipPaletteValue = (typeof CHIP_PALETTE_OPTIONS)[number]; distinct Figma node. - For create-flow screens, node ids come from `CREATE_FLOW_SCREEN_REGISTRY` in `app/(app)/create/utils/createFlowScreenRegistry.ts`. For everything else, - pull the node id from the Figma file directly. Use `TODO(figma)` as a - placeholder rather than omitting the docstring entirely. + prefer `Figma: "" ()` from the file. If the node id is not + wired yet, use `Figma: ""` plus a short note (e.g. *canonical code under + \`controls/\`*) rather than omitting the docstring. ```typescript /** diff --git a/.cursor/rules/component-structure.mdc b/.cursor/rules/component-structure.mdc index 449befe..f64dcc9 100644 --- a/.cursor/rules/component-structure.mdc +++ b/.cursor/rules/component-structure.mdc @@ -51,13 +51,48 @@ export { default } from "./.container"; export type { Props } from "./.types"; ``` -## Single-file pattern (exception) +## Small presentational packages (buttons) -`app/components/buttons/*.tsx` and other trivially-presentational components -can stay as a single file when they have **no derived state and only a -handful of props** (e.g. `Button.tsx`, `InlineTextButton.tsx`). If you find -yourself adding state, side effects, or enum logic, promote it to the split -pattern. +`app/components/buttons//` holds **`index.tsx`** plus **`.tsx`** +(the **`Button`**, **`InlineTextButton`** packages today). Promote to the full +container/view/types split when state or logic outgrows a single module (like **`controls/TextInput`**). + +## `cards/` packages + +Prefer the **container / view / types** layout for **`Selection/`**, **`CardStack/`**, **`Rule/`**, +**`Icon/`**, **`Mini/`**, **`TemplateReviewCard/`**. **`Step/`** keeps a single +**`.tsx`** next to **`index.tsx`** until complexity justifies a split. + +## `modals/` packages + +Use the same **container / view / types** split where those files exist (**`Alert`**, **`Create`**, **`Dialog`**, **`Login`**, **`Tooltip`**, **`ModalHeader`**, **`ModalFooter`**). + +## `navigation/` packages + +Use the **container / view / types** split + per-package **`index.tsx`** for **`Top/`**, **`CreateFlowTopNav/`**, **`CreateFlowFooter/`**, **`NavigationItem/`**, **`Link/`**, **`MenuItem/`**. **`TopWithPathname.tsx`** lives inside **`Top/`** as the pathname + session wrapper. + +**Root-level** **`Menu.tsx`**, **`Footer.tsx`**, **`ConditionalNavigation.tsx`**, and **`ConditionalNavigationClient.tsx`** sit beside those folders—no bucket-level barrel. Figma **Navigation / Menu** maps to **`Menu`** + **`MenuItem`** (see **`docs/figma-component-registry.md`**, Navigation conventions) and **`routes.mdc`** for shell behavior. + +## `progress/` packages + +Use the **container / view / types** split + **`index.tsx`** for **`Stepper/`** and **`ProportionBar/`** (same shape as **`controls/`**). See **`docs/figma-component-registry.md`** — **Progress conventions** for Figma **Progress** vs **Control / Proportion**. + +## `sections/` packages + +Section-level compositions are **mixed**: many folders use **`container` / `view` / `types`** (**`FeatureGrid/`**, **`QuoteBlock/`**, …), while **`ContentBanner.tsx`** and **`SectionNumber.tsx`** are **single modules** at the bucket root. Prefer the **split** for **new** composites; see **`docs/figma-component-registry.md`** — **Sections conventions**. **`SectionHeader/`** lives under **`type/`** (Figma Type / SectionHeader). Published rule typography body **`CommunityRule/`** lives under **`type/`** (see **Type conventions**). + +## `type/` packages + +**`type/`** is mostly **`container` / `view` / `types`** + **`index.tsx`** (**`HeaderLockup/`**, **`ContentLockup/`**, **`NumberedList/`**, **`InputLabel/`**). **`SectionHeader/`** is a small presentational package (**`SectionHeader.tsx`** + **`index.tsx`**) for the Figma Type SectionHeader lockup. **`CommunityRule/`**, **`Section/`**, and **`TextBlock/`** are **view + types** packages (Community Rule document tree). See **`docs/figma-component-registry.md`** — **Type conventions**. + +## No package-level barrels + +Do **not** add **`app/components//index.tsx`** that re-exports every +sibling under that bucket (there is no `buttons/index.tsx` or `asset/index.tsx`). +Import **`…/buttons/Button`**, **`…/asset/icon`**, **`…/asset/Logo`**, etc.—same +mental model everywhere. + +**Per-component** **`index.tsx`** entrypoints (**`Logo/index.tsx`**, **`controls/TextInput/index.tsx`**, …) stay as documented above—aggregating an entire **`buttons/`** or **`asset/`** tier in one file does not. ## Wrapper / group components diff --git a/.cursor/rules/create-flow.mdc b/.cursor/rules/create-flow.mdc index caa10b8..d9ffda7 100644 --- a/.cursor/rules/create-flow.mdc +++ b/.cursor/rules/create-flow.mdc @@ -29,7 +29,7 @@ Reach for these before writing new markup: | Toggle-chip row + inline "+ Add" input | `app/(app)/create/components/ApplicableScopeField` | | `[– value +]` numeric stepper (± label) | `app/components/controls/Incrementer` / `IncrementerBlock` | | Mid-paragraph "expand / see all" link button | `app/components/buttons/InlineTextButton` | -| Help-icon + label above a control | `app/components/utility/InputLabel` (`helpIcon` prop) | +| Help-icon + label above a control | `app/components/type/InputLabel` (`helpIcon` prop) | | Toggle chip (dim-but-clickable) | `Chip` with `state="Disabled" disabled={false}` | | Card-click → structured creation modal | `Create` with `backdropVariant="blurredYellow"` | diff --git a/.cursor/rules/routes.mdc b/.cursor/rules/routes.mdc index 9d253ed..8ad772d 100644 --- a/.cursor/rules/routes.mdc +++ b/.cursor/rules/routes.mdc @@ -14,10 +14,10 @@ the file tree without affecting URLs. | Group | URL surface | Audience | Chrome | |---|---|---|---| -| `app/(marketing)/` | `/`, `/learn`, `/blog`, `/templates`, future public pages | Public, indexable | TopNav (via root) + marketing `