File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { useVirtualizer } from "@tanstack/react-virtual"
4
4
import Flex from "src/components/templates/flex"
5
5
import Search from "src/components/search"
6
6
import Box from "src/components/templates/box"
7
+ import { TextSmall } from "src/components/typography"
7
8
8
9
const Container = styled ( Flex ) `
9
10
${ ( { hideShadow } ) =>
@@ -19,6 +20,8 @@ const Dropdown = ({
19
20
itemProps,
20
21
items,
21
22
onItemClick,
23
+ dropTitle,
24
+ dropTitlePadding = [ 3 , 3 , 0 ] ,
22
25
Item,
23
26
value,
24
27
hasSearch,
@@ -71,6 +74,7 @@ const Dropdown = ({
71
74
width = "auto"
72
75
{ ...rest }
73
76
>
77
+ { dropTitle && < Flex padding = { dropTitlePadding } > { dropTitle } </ Flex > }
74
78
{ hasSearch && (
75
79
< Box margin = { searchMargin } >
76
80
< Search
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ const Menu = forwardRef(
28
28
Item = DropdownItem ,
29
29
Dropdown = DefaultDropdown ,
30
30
animation,
31
+ dropTitle,
32
+ dropTitlePadding,
31
33
hasSearch = false ,
32
34
...rest
33
35
} ,
@@ -96,6 +98,8 @@ const Menu = forwardRef(
96
98
{ ...dropProps }
97
99
>
98
100
< Dropdown
101
+ dropTitle = { dropTitle }
102
+ dropTitlePadding = { dropTitlePadding }
99
103
value = { value }
100
104
onItemClick = { onItemClick }
101
105
items = { items }
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import Flex from "src/components/templates/flex"
7
7
import Tooltip from "src/components/drops/tooltip"
8
8
import { Button } from "src/components/button"
9
9
import { Icon } from "src/components/icon"
10
+ import { Text } from "src/components/typography"
11
+
10
12
import readme from "./README.md"
11
13
import Menu from "./index"
12
14
@@ -18,9 +20,10 @@ const subData = {
18
20
} ,
19
21
jest : [ "index.test.js" ] ,
20
22
}
21
-
22
23
const Simple = props => (
23
24
< Menu
25
+ dropTitle = { < Text > Fight Club characters</ Text > }
26
+ dropTitlePadding = { [ 2 ] }
24
27
label = "Character"
25
28
items = { [
26
29
{ value : "narrator" , label : "The Narrator" , onClick : action ( "narrator" ) } ,
You can’t perform that action at this time.
0 commit comments