import * as React from 'react'
import type { StoryFn, Meta } from '@storybook/react-webpack5'
import { Toolbar, ToolbarSectionLeft, ToolbarSectionRight } from '..'
import { Board } from '@planview/pv-icons'
import { ListItem } from '@planview/pv-uikit'
import type { ToolbarItemCollapsedViewProps } from '.'
import { ToolbarItem, ToolbarItemView, ToolbarItemCollapsedView } from '.'
export default {
title: 'pv-toolbar/Generic/ToolbarItem/ToolbarItemCollapsedView',
tags: ['autodocs'],
component: ToolbarItemCollapsedView,
argTypes: {
onHit: { action: 'hit button', table: { disable: true } },
},
parameters: {
controls: { disabled: true, hideNoControlsWarning: true },
docs: {
description: {
component: `
\`ToolbarItemCollapsedView\`, always a child of the \`ToolbarItem\`, renders the component representation in the more menu when the component collapses
### Usage
\`\`\`typescript
import { ToolbarItemCollapsedView } from '@planview/pv-toolbar'
}
onActivate={() => onHit('hit button')}
label="button"
/>
\`\`\`
`,
},
},
},
} satisfies Meta<
ToolbarItemCollapsedViewProps & {
onHit: (msg: string) => void
}
>
type StoryToolbarItemCollapsedView = StoryFn<
React.ComponentProps & {
onHit: (msg: string) => void
}
>
export const Default: StoryToolbarItemCollapsedView = ({ onHit }) => (
{(
ref,
{
showLabels,
toolbarItemProps: {
focused: _focused,
...toolbarItemProps
},
disabled,
}
) => (
)}
}
onActivate={() => onHit('hit button')}
label="button"
/>
)
Default.storyName = 'ToolbarItemCollapsedView'