Files
Verso/services/web/frontend/stories/ui/dropdown-menu.stories.tsx
T
Rebeka Dekany d751b88e6b Bootstrap files and folders cleanup (#27692)
* Remove icons folder

* Create folders for badge, button, and dropdown components

* Remove Bootstrap 5 from test

* Rename `getBootstrap5Breakpoint` to `getBootstrapBreakpoint`

* Cleanup and update BS 5 comments

* Move components to the shared folder

* Rename `tooltips-bs5` to `tooltip`

* Remove `-bs5` suffix

* Fix path

* Delete BS3 version file

* Rename `_form_marketing-bootstrap-5` to `_form_marketing`

* Delete BS3 version file

* Rename `_contact_general_modal-marketing-bootstrap-5` to `_contact_general_modal-marketing`

* Delete BS3 version file

* Rename `_contact_modal-marketing-bootstrap-5` to `_contact_modal-marketing`

* Delete BS3 version file

* Rename `thin-footer-bootstrap-5` to `thin-footer`

* Delete BS3 version file

* Rename `language-picker-bootstrap-5` to `language-picker`

* Rename `fat-footer-react-bootstrap-5` to `fat-footer-react`

* Delete BS3 version file

* Rename `navbar-marketing-bootstrap-5` to `navbar-marketing`

* Rename `navbar-marketing-react-bootstrap-5` to `navbar-marketing-react`

* Delete BS3 version file

* Rename `layout-website-redesign-cms-bootstrap-5` to `layout-website-redesign-cms`

* Source format

* Fix path

GitOrigin-RevId: cf0f5db7c84cf545c69213dcc271d9ff17fe5db7
2025-08-11 08:06:16 +00:00

237 lines
5.2 KiB
TypeScript

import {
DropdownMenu,
DropdownItem,
DropdownDivider,
DropdownHeader,
} from '@/shared/components/dropdown/dropdown-menu'
import type { Meta } from '@storybook/react'
import OLDropdownMenuItem from '@/shared/components/ol/ol-dropdown-menu-item'
type Args = React.ComponentProps<typeof DropdownMenu>
export const Default = (args: Args) => {
return (
<DropdownMenu show>
<li>
<DropdownItem eventKey="1" href="#/action-1">
Example
</DropdownItem>
</li>
<li>
<DropdownItem eventKey="2" href="#/action-2">
Example
</DropdownItem>
</li>
<DropdownDivider />
<li>
<DropdownItem eventKey="3" disabled={args.disabled} href="#/action-3">
Example
</DropdownItem>
</li>
</DropdownMenu>
)
}
export const Active = (args: Args) => {
return (
<DropdownMenu show>
<li>
<DropdownItem eventKey="1" href="#/action-1">
Example
</DropdownItem>
</li>
<li>
<DropdownItem
eventKey="2"
active
href="#/action-2"
trailingIcon="check"
>
Example
</DropdownItem>
</li>
<DropdownDivider />
<li>
<DropdownItem eventKey="3" disabled={args.disabled} href="#/action-3">
Example
</DropdownItem>
</li>
</DropdownMenu>
)
}
export const MultipleSelection = () => {
return (
<DropdownMenu show>
<DropdownHeader>Header</DropdownHeader>
<li>
<DropdownItem
eventKey="1"
href="#/action-1"
leadingIcon={<DropdownItem.EmptyLeadingIcon />}
>
Example
</DropdownItem>
</li>
<li>
<DropdownItem eventKey="2" href="#/action-2" leadingIcon="check">
Example
</DropdownItem>
</li>
<li>
<DropdownItem eventKey="3" href="#/action-3" leadingIcon="check">
Example
</DropdownItem>
</li>
</DropdownMenu>
)
}
export const Danger = (args: Args) => {
return (
<DropdownMenu show>
<li>
<DropdownItem eventKey="1" disabled={args.disabled} href="#/action-1">
Example
</DropdownItem>
</li>
<li>
<DropdownItem eventKey="2" href="#/action-2">
Example
</DropdownItem>
</li>
<DropdownDivider />
<li>
<DropdownItem eventKey="3" href="#/action-3" variant="danger">
Example
</DropdownItem>
</li>
</DropdownMenu>
)
}
export const Description = (args: Args) => {
return (
<DropdownMenu show>
<li>
<DropdownItem
disabled={args.disabled}
eventKey="1"
href="#/action-1"
description="Description of the menu"
>
Example
</DropdownItem>
</li>
<li>
<DropdownItem
active
eventKey="2"
href="#/action-2"
description="Description of the menu"
trailingIcon="check"
>
Example
</DropdownItem>
</li>
</DropdownMenu>
)
}
export const LeadingIcon = (args: Args) => {
return (
<DropdownMenu show>
<OLDropdownMenuItem
disabled={args.disabled}
eventKey="1"
href="#/action-1"
leadingIcon="view_column_2"
>
Editor & PDF
</OLDropdownMenuItem>
<OLDropdownMenuItem
active
eventKey="2"
href="#/action-2"
leadingIcon="terminal"
>
Editor only
</OLDropdownMenuItem>
<OLDropdownMenuItem
eventKey="3"
href="#/action-3"
leadingIcon="picture_as_pdf"
>
PDF only
</OLDropdownMenuItem>
<OLDropdownMenuItem
eventKey="4"
href="#/action-4"
leadingIcon="select_window"
>
PDF in separate tab
</OLDropdownMenuItem>
<OLDropdownMenuItem
eventKey="5"
href="#/action-5"
leadingIcon="align_space_even"
description="Some description"
>
With a description
</OLDropdownMenuItem>
<OLDropdownMenuItem
eventKey="6"
href="#/action-6"
leadingIcon="align_space_even"
className="dropdown-item-material-icon-small"
>
Small icon
</OLDropdownMenuItem>
</DropdownMenu>
)
}
export const TrailingIcon = () => {
return (
<DropdownMenu show>
<OLDropdownMenuItem eventKey="1" href="#/action-1" trailingIcon="check">
Tick
</OLDropdownMenuItem>
<OLDropdownMenuItem
eventKey="2"
href="#/action-2"
trailingIcon="check"
description="Some description"
>
With a description
</OLDropdownMenuItem>
<OLDropdownMenuItem
eventKey="3"
href="#/action-3"
leadingIcon="align_space_even"
trailingIcon="check"
description="Some description"
>
With a leading icon
</OLDropdownMenuItem>
</DropdownMenu>
)
}
const meta: Meta<typeof DropdownMenu> = {
title: 'Shared / Components / DropdownMenu',
component: DropdownMenu,
argTypes: {
disabled: {
control: 'boolean',
},
show: {
table: {
disable: true,
},
},
},
}
export default meta