Skip to content

Fix runtime error in Slider storybook #2488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions packages/bezier-react/src/components/Slider/Slider.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { type Meta } from '@storybook/react'
import { type Meta, type StoryObj } from '@storybook/react'

import { Slider } from './Slider'

const meta: Meta<typeof Slider> = {
component: Slider,
argTypes: {
value: {
control: {
type: 'object',
},
},
minStepsBetweenThumbs: {
control: {
type: 'number',
Expand All @@ -21,15 +16,21 @@ const meta: Meta<typeof Slider> = {
onValueCommit: {
action: 'onValueCommit',
},
value: {
if: {
exists: true,
arg: 'value',
},
},
defaultValue: {
if: {
exists: true,
arg: 'defaultValue',
},
},
},
Comment on lines +19 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}
export default meta

export const Primary = {
args: {
width: 285,
defaultValue: [5],
value: undefined,
disabled: false,
guide: [5],
min: 0,
Expand All @@ -38,3 +39,16 @@ export const Primary = {
disableTooltip: false,
},
}
export default meta

export const Primary = {
args: {
value: [5],
},
} satisfies StoryObj<typeof meta>

export const Uncontrolled = {
args: {
defaultValue: [5],
},
} satisfies StoryObj<typeof meta>
Loading