Commit f7fb00d
authored
chore: Added all headers to components temp (#25751)
## **Description**
This PR adds a comprehensive set of header components to
`components-temp` as part of the ongoing header component library
development. These components provide flexible, reusable header patterns
for various screen layouts including collapsible scroll-linked headers
and static stacked headers.
**Components added:**
1. **HeaderCollapsible** - Base collapsing header that smoothly
transitions between expanded and compact states based on scroll position
using Reanimated for performant scroll-linked animations. Includes a
custom hook (`useHeaderCollapsible`) for easy ScrollView integration.
2. **HeaderCollapsibleStandard** - Extends HeaderCollapsible with
TitleStandard content in the expanded section, suitable for
main/top-level screens.
3. **HeaderCollapsibleSubpage** - Extends HeaderCollapsible with
TitleSubpage content in the expanded section, suitable for
secondary/nested screens.
4. **HeaderCompactSearch** - A compact search header with two variants:
- `Screen` variant: Renders a back button (ArrowLeft) on the left side
- `Inline` variant: Renders a cancel button on the right side
5. **HeaderStackedStandard** - A static (non-collapsible) header that
combines HeaderBase with TitleStandard below, including React Navigation
integration helper (`getHeaderStackedStandardNavbarOptions`).
6. **HeaderStackedSubpage** - A static header that combines HeaderBase
with TitleSubpage below, suitable for secondary/nested screens.
All components include full TypeScript support, comprehensive unit
tests, and Storybook stories for documentation and visual testing.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
https://consensyssoftware.atlassian.net/jira/software/c/projects/MDP/boards/2972?assignee=62afb43d33a882e2be47c36f&quickFilter=3325&selectedIssue=MDP-702
## **Manual testing steps**
```gherkin
Feature: Header components in Storybook
Scenario: User views HeaderCollapsible in Storybook
Given the app is running in Storybook mode
When user navigates to HeaderCollapsible stories
Then user should see the collapsible header expand and collapse on scroll
Scenario: User views HeaderStackedStandard in Storybook
Given the app is running in Storybook mode
When user navigates to HeaderStackedStandard stories
Then user should see a static stacked header with back button and title section
Scenario: User views HeaderCompactSearch in Storybook
Given the app is running in Storybook mode
When user navigates to HeaderCompactSearch stories
Then user should see both Screen and Inline search header variants
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
N/A - New components
### **After**
HeaderCollapsible
https://github.com/user-attachments/assets/e54baf08-d3d7-463d-9f9c-38cfc37f5ad3
HeaderCollapsibleStandard
https://github.com/user-attachments/assets/015f7c71-9b41-4671-b016-ca1193761807
HeaderCollapsibleSubpage
https://github.com/user-attachments/assets/5bc9dc72-a65d-4cf2-baf1-f8ee50af2f14
HeaderCompactSearch
https://github.com/user-attachments/assets/06787417-a2fe-41c3-ac57-520f79ba4003
HeaderStackedStandard
https://github.com/user-attachments/assets/0de09449-8be8-41a1-bc0d-47219eecdd54
HeaderStackedSubpage
https://github.com/user-attachments/assets/b3446d48-bb02-4ae0-b0df-043e7fddd258
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Mostly additive UI work, but introduces new scroll-linked Reanimated
behavior and dynamic layout measurement that could cause
visual/interaction regressions if adopted by screens.
>
> **Overview**
> Introduces a new set of reusable header components under
`components-temp`, including `HeaderCollapsible` (scroll-linked
collapsing header with dynamic height measurement + safe-area
positioning) and a companion `useHeaderCollapsible` hook.
>
> Adds wrapper variants
`HeaderCollapsibleStandard`/`HeaderCollapsibleSubpage` and static
`HeaderStackedStandard`/`HeaderStackedSubpage`, plus a
`HeaderCompactSearch` header supporting *screen* (back button) and
*inline* (cancel button) modes. Each new component is wired into
Storybook and covered by dedicated unit tests.
>
> Also normalizes `twClassName` handling by defaulting it to `''` in
`HeaderCompactStandard`, `TitleStandard`, and `TitleSubpage` and
simplifying class concatenation.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ed7c2fd. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 4ba008a commit f7fb00d
35 files changed
Lines changed: 4173 additions & 6 deletions
File tree
- .storybook
- app/component-library/components-temp
- HeaderCollapsibleStandard
- HeaderCollapsibleSubpage
- HeaderCollapsible
- HeaderCompactSearch
- HeaderCompactStandard
- HeaderStackedStandard
- HeaderStackedSubpage
- TitleStandard
- TitleSubpage
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 275 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
0 commit comments