Commit ad76c6a
authored
feat: compound
## 📜 Description
Added compound pattern to `KeyboardToolbar` component.
## 💡 Motivation and Context
This component started as a very simple component with limited
customization. However, over the time it got many new props, such as
`onNextCallback` etc. and right now we have too many props for
customization.
Since I'm planning to add
#881
I decided that it'll be a good time to refactor the component and apply
compound pattern. So in the end I come up with next API design:
```tsx
<KeyboardToolbar>
<KeyboardToolbar.Background />
<KeyboardToolbar.Prev />
<KeyboardToolbar.Next />
<KeyboardToolbar.Content />
<KeyboardToolbar.Done />
</KeyboardToolbar>
```
> I intentionally changed `blur` prop to `background`, because with iOS
26 we may use liquid glass as a container
Closes
#1121
## 📢 Changelog
<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->
### JS
- added new compound `KeyboardToolbar` API;
- moved props declaration into `types.ts` file.
### Docs
- added new API reference;
- added migration guide.
## 🤔 How Has This Been Tested?
- tested that old code works with new API and doesn't introduce visual
regressions (via e2e tests)
- started to use new API and assure that it doesn't break e2e tests.
## 📸 Screenshots (if appropriate):
<img width="614" height="422" alt="image"
src="https://github.com/user-attachments/assets/8d2cc932-7fd8-4f29-89d4-bf4961bd97dc"
/>
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changedKeyboardToolbar (#1125)1 parent 5c8faca commit ad76c6a
File tree
14 files changed
+772
-306
lines changed- FabricExample/src/screens/Examples
- AwareScrollView
- Toolbar
- docs/docs/api/components/keyboard-toolbar
- example/src/screens/Examples/Toolbar
- src/components/KeyboardToolbar
- compound
- components
14 files changed
+772
-306
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | 159 | | |
166 | 160 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
171 | 179 | | |
172 | 180 | | |
173 | 181 | | |
| |||
238 | 246 | | |
239 | 247 | | |
240 | 248 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
0 commit comments