Skip to content

Commit aba8050

Browse files
authored
feat(FilteredSearch): remove support for sx and styled (#6840)
1 parent fa70b5e commit aba8050

File tree

3 files changed

+36
-25
lines changed

3 files changed

+36
-25
lines changed

.changeset/rotten-carpets-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': major
3+
---
4+
5+
Remove support for `sx` prop from `deprecated/FilteredSearch`
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.FilteredSearch {
2+
display: flex;
3+
align-items: stretch;
4+
5+
& summary,
6+
& > button {
7+
border-radius: 0;
8+
border-top-left-radius: var(--borderRadius-medium);
9+
border-bottom-left-radius: var(--borderRadius-medium);
10+
border-right: 0;
11+
}
12+
13+
/* stylelint-disable-next-line selector-class-pattern */
14+
& :global(.TextInput-wrapper) {
15+
border-radius: 0;
16+
border-top-right-radius: var(--borderRadius-medium);
17+
border-bottom-right-radius: var(--borderRadius-medium);
18+
}
19+
}
Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,19 @@
1-
import styled from 'styled-components'
2-
import {get} from '../../constants'
3-
import type {SxProp} from '../../sx'
4-
import sx from '../../sx'
5-
import type {ComponentProps} from '../../utils/types'
1+
import {clsx} from 'clsx'
2+
import classes from './FilteredSearch.module.css'
3+
4+
type FilteredSearchProps = React.HTMLAttributes<HTMLElement>
65

76
/**
87
* @deprecated A new filter component is in progress.
98
* Until the new filter component is ready, you can use Button + TextInput + ActionList to reproduce this pattern.
109
*/
11-
const FilteredSearch = styled.div<SxProp>`
12-
display: flex;
13-
align-items: stretch;
14-
15-
summary,
16-
> button {
17-
border-radius: 0;
18-
border-top-left-radius: ${get('radii.2')};
19-
border-bottom-left-radius: ${get('radii.2')};
20-
border-right: 0;
21-
}
22-
.TextInput-wrapper {
23-
border-radius: 0;
24-
border-top-right-radius: ${get('radii.2')};
25-
border-bottom-right-radius: ${get('radii.2')};
26-
}
27-
28-
${sx}
29-
`
10+
function FilteredSearch({children, className, ...rest}: FilteredSearchProps) {
11+
return (
12+
<div {...rest} className={clsx(classes.FilteredSearch, className)}>
13+
{children}
14+
</div>
15+
)
16+
}
3017

31-
export type FilteredSearchProps = ComponentProps<typeof FilteredSearch>
18+
export type {FilteredSearchProps}
3219
export default FilteredSearch

0 commit comments

Comments
 (0)