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"
44import Flex from "src/components/templates/flex"
55import Search from "src/components/search"
66import Box from "src/components/templates/box"
7+ import { TextSmall } from "src/components/typography"
78
89const Container = styled ( Flex ) `
910 ${ ( { hideShadow } ) =>
@@ -19,6 +20,8 @@ const Dropdown = ({
1920 itemProps,
2021 items,
2122 onItemClick,
23+ dropTitle,
24+ dropTitlePadding = [ 3 , 3 , 0 ] ,
2225 Item,
2326 value,
2427 hasSearch,
@@ -71,6 +74,7 @@ const Dropdown = ({
7174 width = "auto"
7275 { ...rest }
7376 >
77+ { dropTitle && < Flex padding = { dropTitlePadding } > { dropTitle } </ Flex > }
7478 { hasSearch && (
7579 < Box margin = { searchMargin } >
7680 < Search
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ const Menu = forwardRef(
2828 Item = DropdownItem ,
2929 Dropdown = DefaultDropdown ,
3030 animation,
31+ dropTitle,
32+ dropTitlePadding,
3133 hasSearch = false ,
3234 ...rest
3335 } ,
@@ -96,6 +98,8 @@ const Menu = forwardRef(
9698 { ...dropProps }
9799 >
98100 < Dropdown
101+ dropTitle = { dropTitle }
102+ dropTitlePadding = { dropTitlePadding }
99103 value = { value }
100104 onItemClick = { onItemClick }
101105 items = { items }
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import Flex from "src/components/templates/flex"
77import Tooltip from "src/components/drops/tooltip"
88import { Button } from "src/components/button"
99import { Icon } from "src/components/icon"
10+ import { Text } from "src/components/typography"
11+
1012import readme from "./README.md"
1113import Menu from "./index"
1214
@@ -18,9 +20,10 @@ const subData = {
1820 } ,
1921 jest : [ "index.test.js" ] ,
2022}
21-
2223const Simple = props => (
2324 < Menu
25+ dropTitle = { < Text > Fight Club characters</ Text > }
26+ dropTitlePadding = { [ 2 ] }
2427 label = "Character"
2528 items = { [
2629 { value : "narrator" , label : "The Narrator" , onClick : action ( "narrator" ) } ,
You can’t perform that action at this time.
0 commit comments