Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions packages/ui-patterns/src/projects/ProjectSearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface ProjectSearchInputProps {
}

/**
* A rounded search box with a leading icon and a clear button while there
* A search box with a leading icon and a clear button while there
* is text. Clearing returns focus to the box.
*/
export const ProjectSearchInput = ({
Expand All @@ -45,7 +45,7 @@ export const ProjectSearchInput = ({
return (
<InputGroup className={className}>
<InputStartElement pointerEvents="none">
<Icon as={RiSearch2Line} css={{ color: "gray.800" }} />
<Icon as={RiSearch2Line} />
</InputStartElement>
<Input
ref={ref}
Expand All @@ -56,14 +56,9 @@ export const ProjectSearchInput = ({
type="search"
css={{
// We draw our own clear button.
appearance: "none",
"&::-webkit-search-cancel-button": { display: "none" },
ps: 10,
pe: 10,
fontSize: "lg",
_placeholder: { color: "gray.500" },
borderRadius: "20px",
background: "white",
}}
/>
{value && (
Expand All @@ -74,7 +69,6 @@ export const ProjectSearchInput = ({
uiPatternsMessage("ui-patterns.clear-action"),
)}
onPress={handleClear}
css={{ fontSize: "2xl", color: "gray.500" }}
>
<Icon as={RiCloseLine} />
</IconButton>
Expand Down
5 changes: 1 addition & 4 deletions packages/ui-patterns/src/projects/ProjectSortInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const ProjectSortInput = ({
disabled={hasSearchQuery}
// Lets the select shrink below its longest option when space is
// tight, clipping the text.
css={{ fontSize: "lg", background: "white", flex: 1, minW: 0 }}
css={{ flex: 1, minW: 0 }}
>
{hasSearchQuery ? (
<option value="relevance">
Expand All @@ -76,15 +76,12 @@ export const ProjectSortInput = ({
onPress={onToggleDirection}
isDisabled={hasSearchQuery}
css={{
background: "white",
fontSize: "2xl",
// Poses as the second half of the attached select, so the border
// tracks the input recipe's resting border; the divider between
// the two is ButtonGroup's hairline.
border: "2px solid",
borderColor: "gray.300",
_hover: { borderColor: "gray.500" },
color: "gray.500",
borderRadius: "md",
}}
>
Expand Down
6 changes: 4 additions & 2 deletions packages/ui-patterns/stories/ProjectsPageExample.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ const ProjectsPageExample = () => {
}
setQuery(value);
}}
className={css({ maxW: "30ch" })}
// Fields inherit their surface colour; the page is grey, so
// the wrapper supplies white, shaped to the field's radius.
className={css({ maxW: "30ch", bg: "white", borderRadius: "md" })}
/>
{selection.hasSelection && (
<Box
Expand All @@ -170,7 +172,7 @@ const ProjectsPageExample = () => {
)}
<ProjectSortInput
className={cx(
css({ ml: "auto" }),
css({ ml: "auto", bg: "white", borderRadius: "md" }),
selection.hasSelection
? css({ display: { base: "flex", lg: "none" } })
: undefined,
Expand Down