Skip to content

Commit d508ed3

Browse files
swapnil-kr1Copilot
andauthored
feat(blade): removed padding prop from FilterChipGroup (#3012)
* feat(blade): removed padding prop from FilterChipGroup * Create odd-beans-dress.md * Update odd-beans-dress.md * Update odd-beans-dress.md * Update odd-beans-dress.md * Update .changeset/odd-beans-dress.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 17e980e commit d508ed3

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

.changeset/odd-beans-dress.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@razorpay/blade": minor
3+
---
4+
5+
feat(blade): remove padding prop from FilterChipGroup
6+
7+
We have removed the `padding` prop from the `FilterChipGroup` component, which was introduced in the previous version. Padding is now handled internally as part of the global spacing update.
8+
9+
#### Impact
10+
11+
If your code was using the `padding` prop, you might notice spacing differences or snapshot changes in your tests. No functional changes are required otherwise.
12+
13+
#### How to Upgrade
14+
15+
Remove the `padding` prop usage from `FilterChipGroup`. The component will now automatically apply the correct spacing as per the new global layout rules.

packages/blade/src/components/Dropdown/FilterChipGroup.web.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const FilterChipGroup = ({
1212
children,
1313
showClearButton = true,
1414
onClearButtonClick,
15-
padding = 'spacing.4',
1615
...rest
1716
}: FilterChipGroupProps): React.ReactElement => {
1817
const [filterChipGroupSelectedFilters, setFilterChipGroupSelectedFilters] = useState<string[]>(
@@ -39,7 +38,7 @@ const FilterChipGroup = ({
3938
{...metaAttribute({ name: MetaConstants.FilterChipGroup, testID })}
4039
{...makeAnalyticsAttribute(rest)}
4140
display="flex"
42-
padding={padding}
41+
padding={['spacing.4', 'spacing.1']}
4342
alignItems="center"
4443
justifyContent="flex-start"
4544
width="100%"

packages/blade/src/components/Dropdown/types.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ type FilterChipGroupProps = TestID &
9090
*
9191
*/
9292
showClearButton?: boolean;
93-
/**
94-
* Padding for the FilterChipGroup
95-
*/
96-
padding?: BoxProps['padding'];
9793
};
9894

9995
type FilterChipGroupContextType = {

packages/blade/src/components/ListView/ListViewFilters.web.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ const ListViewFilters = ({
8989
<StyledQuickFilterContainer
9090
overflow="scroll"
9191
width="100%"
92-
paddingY="spacing.4"
92+
paddingTop={isMobile ? 'spacing.4' : 'spacing.1'}
93+
paddingBottom="spacing.1"
9394
paddingLeft="spacing.1"
9495
>
9596
{quickFilters}

packages/blade/src/components/ListView/docs/ListView.stories.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ const Page = (): React.ReactElement => {
327327
setFilterDateRange(undefined);
328328
setSelectedQuickFilter('All');
329329
}}
330-
padding={['spacing.0', 'spacing.1', 'spacing.4']}
331330
>
332331
<Dropdown selectionType="single">
333332
<FilterChipSelectInput
@@ -799,7 +798,6 @@ const DefaultExample: StoryFn<typeof ListView> = (args) => {
799798
setFilterDateRange(undefined);
800799
setSelectedQuickFilter('All');
801800
}}
802-
padding={['spacing.0', 'spacing.1', 'spacing.4']}
803801
>
804802
<Dropdown selectionType="single">
805803
<FilterChipSelectInput
@@ -1136,7 +1134,6 @@ const ControlledExample: StoryFn<typeof ListView> = (args) => {
11361134
setFilterDateRange(undefined);
11371135
setSelectedQuickFilter('All');
11381136
}}
1139-
padding={['spacing.0', 'spacing.1', 'spacing.4']}
11401137
>
11411138
<Dropdown selectionType="single">
11421139
<FilterChipSelectInput
@@ -1481,7 +1478,6 @@ const WithBulkActionExample: StoryFn<typeof ListView> = (args) => {
14811478
setFilterDateRange(undefined);
14821479
setSelectedQuickFilter('All');
14831480
}}
1484-
padding={['spacing.0', 'spacing.1', 'spacing.4']}
14851481
>
14861482
<Dropdown selectionType="single">
14871483
<FilterChipSelectInput
@@ -1893,7 +1889,6 @@ const MultiSelectQuickFilter: StoryFn<typeof ListView> = (args) => {
18931889
const searchValueData = getSearchedData(data, searchValue);
18941890
setListViewTableData(searchValueData);
18951891
}}
1896-
padding={['spacing.0', 'spacing.1', 'spacing.4']}
18971892
>
18981893
<Dropdown selectionType="single">
18991894
<FilterChipSelectInput
@@ -2188,7 +2183,6 @@ const WithoutSearchExample: StoryFn<typeof ListView> = (args) => {
21882183
setFilterDateRange(undefined);
21892184
setSelectedQuickFilter('All');
21902185
}}
2191-
padding={['spacing.0', 'spacing.1', 'spacing.4']}
21922186
>
21932187
<Dropdown selectionType="single">
21942188
<FilterChipSelectInput
@@ -2541,7 +2535,6 @@ const WithDropDownSearchExample: StoryFn<typeof ListView> = (args) => {
25412535
setFilterDateRange(undefined);
25422536
setSelectedQuickFilter('All');
25432537
}}
2544-
padding={['spacing.0', 'spacing.1', 'spacing.4']}
25452538
>
25462539
<Dropdown selectionType="single">
25472540
<FilterChipSelectInput

0 commit comments

Comments
 (0)