Skip to content

Commit d629808

Browse files
committed
Some styling improvements
1 parent 455895c commit d629808

File tree

3 files changed

+20
-33
lines changed

3 files changed

+20
-33
lines changed

src/components/search/DefaultFacet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export function DefaultFacet(props: FacetViewProps & { config: FairDOConfigBuild
3838
}, [props.optionView])
3939

4040
return (
41-
<div className="rounded-lg p-4">
42-
<div className="flex min-h-[40px] items-center justify-between">
41+
<div className="rounded-lg px-4 pt-0 pb-8">
42+
<div className="flex items-center justify-between pb-2">
4343
<div className="text-sm font-bold">{props.label}</div>
4444
{props.showSearch && (
4545
<Popover>

src/components/search/DefaultSearchBox.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,21 @@
11
import type { InputViewProps } from "@elastic/react-search-ui-views"
22
import { Button } from "@/components/ui/button"
3-
import {
4-
DropdownMenu,
5-
DropdownMenuContent,
6-
DropdownMenuItem,
7-
DropdownMenuTrigger
8-
} from "@/components/ui/dropdown-menu"
3+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"
94
import { Input } from "@/components/ui/input"
105
import { ChevronDown, ExternalLink, SearchIcon } from "lucide-react"
116

127
export function DefaultSearchBox(props: InputViewProps) {
138
return (
14-
<div className="relative flex w-full max-w-[1300px] flex-col items-center gap-4 md:flex-row">
15-
<SearchIcon className="absolute left-4 top-3 size-4 text-muted-foreground md:top-auto" />
16-
<Input
17-
{...props.getInputProps()}
18-
placeholder="Search for something..."
19-
className="h-11 pl-10"
20-
/>
9+
<div className="relative flex w-full max-w-[1300px] px-[15px] md:px-[calc(24px+0.5rem)] flex-col items-center gap-4 md:flex-row">
10+
<SearchIcon className="absolute left-12 top-3 size-4 text-muted-foreground md:top-auto" />
11+
<Input {...props.getInputProps()} placeholder="Search for something..." className="h-11 pl-10" />
2112
<div className="flex w-full items-center md:h-full md:w-auto">
2213
<Button {...props.getButtonProps()} className="grow rounded-r-none" size="lg">
2314
Search
2415
</Button>
2516
<DropdownMenu>
2617
<DropdownMenuTrigger asChild>
27-
<Button
28-
size="icon"
29-
className="h-full rounded-l-none border-l border-l-background"
30-
>
18+
<Button size="icon" className="h-full rounded-l-none border-l border-l-background">
3119
<ChevronDown className="size-4" />
3220
</Button>
3321
</DropdownMenuTrigger>

src/elastic-ui.css

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
* Header / Searchbox
99
*/
1010
.sui-layout-header {
11-
padding: 32px 24px;
12-
border-bottom: 1px solid hsl(var(--muted));
11+
padding-top: 32px;
1312
}
1413

1514
/**
@@ -265,7 +264,7 @@
265264
}
266265

267266
.sui-facet-search {
268-
margin: 6px 0px 0px 0px;
267+
margin: 6px 0 0 0;
269268
}
270269

271270
.sui-facet-search__text-input {
@@ -409,7 +408,7 @@
409408
min-width: 28px;
410409
height: 28px;
411410
margin-right: 8px;
412-
font-family: Arial;
411+
font-family: Arial, sans-serif;
413412
line-height: 26px;
414413
text-align: center;
415414
vertical-align: middle;
@@ -499,7 +498,7 @@
499498
min-width: 28px;
500499
height: 28px;
501500
color: rgba(0, 0, 0, 0.85);
502-
font-family: Arial;
501+
font-family: Arial, sans-serif;
503502
line-height: 28px;
504503
text-align: center;
505504
vertical-align: middle;
@@ -793,7 +792,7 @@
793792
border: 1px solid #f0f0f0;
794793
background: white;
795794
border-radius: 4px;
796-
box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
795+
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.1);
797796
overflow-wrap: break-word;
798797
overflow: hidden;
799798
}
@@ -947,19 +946,19 @@
947946
font-size: 14px;
948947
padding: 16px;
949948
margin-left: 10px;
950-
text-shadow: rgba(0, 0, 0, 0.05) 0px 1px 2px;
949+
text-shadow: rgba(0, 0, 0, 0.05) 0 1px 2px;
951950
color: white;
952951
border: none;
953-
box-shadow: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px inset,
954-
rgba(59, 69, 79, 0.05) 0px 1px 0px;
952+
box-shadow: rgba(0, 0, 0, 0.05) 0 0 0 1px inset,
953+
rgba(59, 69, 79, 0.05) 0 1px 0;
955954
background: linear-gradient(#2da0fa, #3158ee) #2f7cf4;
956955
cursor: pointer;
957956
border-radius: 4px;
958957
}
959958

960959
.sui-search-box__submit:hover {
961-
box-shadow: rgba(0, 0, 0, 0.3) 0px 0px 0px 1px inset,
962-
rgba(59, 69, 79, 0.3) 0px 2px 4px;
960+
box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px inset,
961+
rgba(59, 69, 79, 0.3) 0 2px 4px;
963962
background: linear-gradient(#3cabff, #4063f0) #3d84f7;
964963
}
965964

@@ -990,15 +989,15 @@
990989
}
991990

992991
.sui-search-box__text-input:focus {
993-
box-shadow: rgba(59, 69, 79, 0.3) 0px 2px 4px;
992+
box-shadow: rgba(59, 69, 79, 0.3) 0 2px 4px;
994993
border-top: 1px solid #3a56e4;
995994
border-left: 1px solid #3a56e4;
996995
border-right: 1px solid #3a56e4;
997996
border-bottom: 1px solid #3a56e4;
998997
}
999998

1000999
.autocomplete .sui-search-box__text-input {
1001-
box-shadow: rgba(59, 69, 79, 0.3) 0px 2px 4px;
1000+
box-shadow: rgba(59, 69, 79, 0.3) 0 2px 4px;
10021001
}
10031002

10041003
.sui-search-box__autocomplete-container {
@@ -1012,7 +1011,7 @@
10121011
line-height: 1.5;
10131012
background: white;
10141013
position: absolute;
1015-
box-shadow: rgba(59, 69, 79, 0.3) 0px 2px 4px;
1014+
box-shadow: rgba(59, 69, 79, 0.3) 0 2px 4px;
10161015
border-top: 1px solid #ccc;
10171016
border-left: 1px solid #ccc;
10181017
border-right: 1px solid #ccc;

0 commit comments

Comments
 (0)