feat: migrate Accordion to Blend Design System#4405
Open
kanikabansal08 wants to merge 9 commits intoblend-phase2-rangesliderfrom
Open
feat: migrate Accordion to Blend Design System#4405kanikabansal08 wants to merge 9 commits intoblend-phase2-rangesliderfrom
kanikabansal08 wants to merge 9 commits intoblend-phase2-rangesliderfrom
Conversation
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add AccordionBinding.res with Blend Accordion + AccordionItem bindings - Add AccordionAdapter.res with feature flag (devBlendEnabled) support - Preserve renderContentOnTop, onItemExpandClick, onItemCollapseClick, currentAccordianState, closeAccordionFn and initialOpenIndex in Blend branch - Update all 13 call sites to use AccordionAdapter - Update Accordion.accordion type annotations to AccordionAdapter.accordion Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…center into blend-phase2-accordion
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Migrates the
Accordioncomponent to the Blend Design System as part of Phase 2 of the Blend migration. This PR introduces two new files and updates 15 call-site files:New files:
src/blend/bindings/AccordionBinding.res— Raw external binding forAccordionandAccordionItemfrom@juspay/blend-design-system. IncludesValuemodule withfromString/fromArray/toArrayhelpers to handle Blend's union type (stringfor single mode,array<string>for multi mode),accordionType(Border/NoBorder), andaccordionChevronPosition(Left/Right).src/blend/adapters/AccordionAdapter.res— Feature-flagged adapter that readsBlendContext.blendEnabledContext. When blend is enabled, renders the Blend accordion in controlled mode (usingvalue+onValueChange). When disabled, passes all props through to the legacyAccordionunchanged.Updated call sites (13 usages across 12 files):
ConnectorAuthKeysHelper.res— CashToCode country select accordionOtherPaymentMethod.res— Payment method additional details accordionWorkflowSideDrawer.res— Workflow steps side drawerEditCheckoutDetails.res— Authorization & Capture Settings accordionOrderUIUtils.res— Order details accordionReconEngineDataOverview.res/ReconEngineDataOverviewHelper.res— Recon data overviewReconEngineDataSources.res— Recon data sources listReconEngineDataTransformation.res— Recon data transformation listAcquirerConfigSettings.res/AcquirerConfigSettingsRevamp.res— Developer → Acquirer ConfigConnectorAccountDetailsHelper.res(2 usages) — Connector credentials accordionPaymentMethod.res— Bank debit / wallet payment method accordionSbxOnboardingSurvey.res— Sandbox onboarding business detailsExample:

Before:
After:
Motivation and Context
Part of the Blend Design System Phase 2 migration. The adapter pattern keeps the legacy component untouched — toggling
dev_blend_enabled=falsein config instantly reverts to the legacy accordion with no code changes.Accordion is classified as a complex component because several call sites use:
renderContentOnTop— custom JSX rendered in the accordion headeronItemExpandClick/onItemCollapseClick— per-item side-effect callbackscloseAccordionFn— programmatic close from inside the contentsingleOpen— only one item open at a timeAll of the above are fully preserved in the Blend branch. The adapter uses controlled mode (
value+onValueChange) so it can track open state, fire callbacks on diff, and pass a realcloseAccordionFnthat removes the item from state.Props dropped in Blend branch (Blend handles styling internally):
accordianTopContainerCss,accordianBottomContainerCss,contentExpandCss,titleStyle,accordionHeaderTextClass,expandedTitleStyle,arrowFillColor(already dead in legacy — accepted but never rendered).How did you test it?
Tested manually by toggling
dev_blend_enabled=trueinconfig/config.toml:ConnectorAuthKeysHelperPaymentMethodConnectorAccountDetailsHelperOrderUIUtilsinitialExpandedArrayopens correctlyAcquirerConfigSettingsrenderContentOnTopAcquirerConfigSettingsRevampEditCheckoutDetailsWorkflowSideDrawerReconEngineDataSourcesrenderContentOnTopcustom header rendersReconEngineDataTransformationSbxOnboardingSurveyAlso verified legacy branch is untouched by disabling the flag on each flow above.
Where to test it?
Checklist
npm run re:build