-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Accordion): add new filled variant (#2065)
* feat: add new accordion props * feat: update Accordion API * feat: add alternate api * feat: add bordered variant * feat: add baseheader to accordion * feat: allow multiple items * fix: remove border gap * feat: add size in context * feat: add new API * feat: update for new changes * feat: add open question * feat: replace JSX with ReactNode * feat: add size prop on BaseHeader * feat: adjust centerbox for baseheader size * feat: keep old description API working * feat: add size to deprecated icon * feat: add jsdoc for accordion * fix: showNumberPrefix prop * fix: react-native-reanimated bug * fix: Accordion for React Native * feat: update docs example * fix: example api * tests: update snapshots * fix: weird ts error * feat: add stopPropagation to link * fix: baseheader test * feat: align chevron correctly * fix: icon alignment in react native * fix: snapshots * revert rn sb change * feat: update to solid | transparent variant naming * feat: rename variant values * fix: ts * fix: remove isExpanded from header * fix: add disabled prop to BaseHeader * fix: add disabled item * feat: add disabled to accordionitem * feat: handle cursor on web * resolve anurag's comments * docs: add real world examples * feat: add validation * feat: add metaAttributes * feat: update variant value names * Create late-planes-destroy.md * docs: reword migration list * remove code tag
- Loading branch information
1 parent
a4f5e4f
commit 524fa92
Showing
43 changed files
with
8,071 additions
and
1,666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
'@razorpay/blade': minor | ||
--- | ||
|
||
feat(Accordion): add new `filled` variant | ||
|
||
New variant can be used to build individual filled Accordions like these | ||
|
||
<img width="400" alt="image" src="https://github.com/razorpay/blade/assets/30949385/7f3d737f-149a-42b0-be1b-1c86d5a0fd83"> | ||
|
||
> [!Warning] | ||
> | ||
> Accordion has a new API and the current API will be deprecated and removed in next major version | ||
#### Migration from existing API | ||
|
||
We have added `AccordionItemHeader` and `AccordionItemBody` components. | ||
|
||
Props like `icon`, `title`, `description` from AccordionItem are deprecated. | ||
|
||
- `icon` on AccordionItem can be replicated with `leading` on AccordionItemHeader | ||
- `title` moves from AccordionItem to AccordionItemHeader | ||
- `description` from AccordionItem can be passed to AccordionItemBody as children | ||
|
||
##### Diff | ||
|
||
```diff | ||
<Accordion> | ||
<AccordionItem | ||
- icon={StarIcon} | ||
- title="This is title" | ||
- description="Body content of Accordion" | ||
/> | ||
</Accordion> | ||
``` | ||
|
||
```diff | ||
<Accordion> | ||
<AccordionItem> | ||
+ <AccordionItemHeader leading={<StarIcon size="large" />} title="This is title" /> | ||
+ <AccordionItemBody>Body content of Accordion</AccordionItemBody> | ||
</AccordionItem> | ||
</Accordion> | ||
``` | ||
|
||
Checkout full documentation at https://blade.razorpay.com/?path=/docs/components-accordion--docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.