Skip to content

Commit 79caf5d

Browse files
committed
fix: listbox story args
1 parent 4316170 commit 79caf5d

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules
33
storybook-static
44
.idea
55
.pnpm-store
6+
.DS_Store

src/components/form-field/listbox/listbox.stories.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@ import type { Meta, StoryObj } from '@storybook/react-vite'
33
import { FC, useState } from 'react'
44
import { FormField } from '../form-field'
55

6-
const meta: Meta<typeof FormField.Listbox> = {
6+
type ListboxStoryArgs = {
7+
label: string
8+
description: string
9+
placeholder: string
10+
width: number
11+
disabled: boolean
12+
}
13+
14+
const meta: Meta<ListboxStoryArgs> = {
715
title: 'Input/Listbox',
8-
component: FormField.Listbox,
916
args: {
1017
label: 'Label',
1118
description: 'Description',
@@ -24,7 +31,7 @@ const meta: Meta<typeof FormField.Listbox> = {
2431

2532
export default meta
2633

27-
type Story = StoryObj<typeof FormField.Listbox>
34+
type Story = StoryObj<ListboxStoryArgs>
2835

2936
interface Person {
3037
id: number

src/components/form-field/listbox/listbox.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export interface ListboxProps<TValue> {
1919
value: TValue
2020
onChange: (value: TValue) => void
2121
multiple?: boolean
22+
disabled?: boolean
2223
className?: string
2324
}
2425

@@ -27,10 +28,16 @@ const Listbox = <TValue,>({
2728
value,
2829
onChange,
2930
multiple,
31+
disabled,
3032
className,
3133
}: ListboxProps<TValue>) => {
3234
return (
33-
<HeadlessListbox value={value} onChange={onChange} multiple={multiple}>
35+
<HeadlessListbox
36+
value={value}
37+
onChange={onChange}
38+
multiple={multiple}
39+
disabled={disabled}
40+
>
3441
<div
3542
className={classNames(
3643
'relative w-full',

0 commit comments

Comments
 (0)