import { Page } from 'puppeteer' import React from 'react' import { Flex, Range } from '../' import { actions, HIDE_STYLED, SPACE, Story, STRING } from '../helpers/storybook' export default { title: 'Range', component: Range, argTypes: { ...HIDE_STYLED, ...actions('onFocus', 'onBlur'), status: { options: ['success', 'warning', 'error'] }, showValue: { options: ['hover', 'focus', 'both', 'neither'], mapping: { both: true, neither: false }, }, disabled: { control: 'boolean' }, margin: SPACE, height: STRING, width: STRING, min: STRING, max: STRING, step: STRING, defaultValue: STRING, }, } as const export const BasicUsage: Story = (args) => (
) BasicUsage.args = { showValue: 'focus', height: '100px' } BasicUsage.parameters = { beforeScreenshot: async (page: Page) => { await page.focus('input[type="range"]') }, } export const RangeStatus: Story = () => ( ) RangeStatus.parameters = { controls: { disable: true } } RangeStatus.storyName = 'Range Input with status'