Skip to content

Commit

Permalink
add missing argTypes to storybook docs
Browse files Browse the repository at this point in the history
  • Loading branch information
luiqor committed Dec 16, 2024
1 parent 6323fe7 commit 2518256
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/design-system/components/menu-item/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { cn } from '~/utils/cn'
import '~scss-components/menu-item/MenuItem.scss'

interface MenuItemProps extends CommonMenuItemProps {
additionalInfo?: string
isDropdown?: boolean
density?: 1 | 2
isToggled?: boolean
Expand Down
1 change: 1 addition & 0 deletions src/design-system/components/menu-item/MenuItem.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type OnItemClickArgs = Record<string, string | Event>

export interface MenuItemProps {
title: string
additionalInfo?: string
alignVariant?: 'left' | 'center' | 'right'
colorVariant?: MenuItemColorVariant
isDisabled?: boolean
Expand Down
1 change: 0 additions & 1 deletion src/design-system/components/menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ interface NestedMenuItemProps extends CommonMenuItemProps {
}

interface MenuItemProps extends NestedMenuItemProps {
additionalInfo?: string
nestedMenuItems?: NestedMenuItemProps[]
}

Expand Down
24 changes: 22 additions & 2 deletions src/design-system/stories/Menu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react'
import type { Meta, StoryObj } from '@storybook/react'
import { type Meta, type StoryObj } from '@storybook/react'
import { EditRounded } from '@mui/icons-material'
import { Checkbox } from '@mui/material'

Expand Down Expand Up @@ -34,9 +34,29 @@ The Menu component is a dropdown menu that displays a list of items.
description: 'Function to set the anchor element.'
},
menuItems: {
description: 'The list of menu items to be displayed.',
description: `
The list of menu items to be displayed. Each menu item can have the following properties:
- **title***: \`string\`
- **additionalInfo**: \`string\`
- **graphics**: \`ReactNode\`
- **alignVariant**: \`'left' | 'center' | 'right'\`
- **colorVariant**: \`MenuItemColorVariant\`
- **defaultOnItemClickArgs**: \`OnItemClickArgs\`
- **isBottomBorder**: \`boolean\`
- **isDisabled**: \`boolean\`
- **isInitiallyToggled**: \`boolean\`
- **nestedMenuItems**: \`MenuItemProps[]\`
- **onClick**: \`function\`
Nested menu items can have all the same properties except \`nestedMenuItems\`.
`,
control: { type: 'object' }
},
allowToggleMultipleItems: {
description:
'Determines whether multiple items can be toggled on and off.',
control: 'boolean'
},
anchorOrigin: {
description: 'The anchor origin point of the menu.',
control: { type: 'object' }
Expand Down

0 comments on commit 2518256

Please sign in to comment.