mirror of
https://github.com/status-im/wakuconnect-chat-sdk.git
synced 2025-01-11 20:54:37 +00:00
add <DropdownMenu.Label />
(#583)
* add <DropdownMenu.Label /> * Create famous-maps-burn.md
This commit is contained in:
parent
433558a131
commit
1ce026c526
5
.changeset/famous-maps-burn.md
Normal file
5
.changeset/famous-maps-burn.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@status-im/components": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
add `<DropdownMenu.Label />`
|
@ -20,8 +20,12 @@ import { DropdownMenu } from '.'
|
|||||||
|
|
||||||
import type { Meta, StoryObj } from '@storybook/react'
|
import type { Meta, StoryObj } from '@storybook/react'
|
||||||
|
|
||||||
const meta: Meta = {
|
const meta: Meta<{ label: boolean; search: boolean }> = {
|
||||||
title: 'Components/Dropdown Menu',
|
title: 'Components/Dropdown Menu',
|
||||||
|
args: {
|
||||||
|
label: true,
|
||||||
|
search: true,
|
||||||
|
},
|
||||||
argTypes: {},
|
argTypes: {},
|
||||||
parameters: {
|
parameters: {
|
||||||
design: {
|
design: {
|
||||||
@ -38,7 +42,9 @@ const meta: Meta = {
|
|||||||
<DropdownButton>Open</DropdownButton>
|
<DropdownButton>Open</DropdownButton>
|
||||||
|
|
||||||
<DropdownMenu.Content sideOffset={10}>
|
<DropdownMenu.Content sideOffset={10}>
|
||||||
<DropdownMenu.Search placeholder="Search by" />
|
{args.label && <DropdownMenu.Label>Label</DropdownMenu.Label>}
|
||||||
|
|
||||||
|
{args.search && <DropdownMenu.Search placeholder="Search by" />}
|
||||||
|
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
icon={<EditIcon />}
|
icon={<EditIcon />}
|
||||||
|
@ -74,6 +74,25 @@ export const Content = forwardRef<
|
|||||||
|
|
||||||
Content.displayName = DropdownMenu.Content.displayName
|
Content.displayName = DropdownMenu.Content.displayName
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Label
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const Label = forwardRef<
|
||||||
|
React.ElementRef<typeof DropdownMenu.Label>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof DropdownMenu.Label>
|
||||||
|
>((props, ref) => {
|
||||||
|
return (
|
||||||
|
<DropdownMenu.Label
|
||||||
|
{...props}
|
||||||
|
ref={ref}
|
||||||
|
className="p-2 text-13 font-medium text-neutral-50 dark:text-neutral-40"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
Label.displayName = DropdownMenu.Label.displayName
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search
|
* Search
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user