import React from 'react'; import { storybookArgTypes, storybookExcludedControlParams, StoryMetaType, } from '@lg-tools/storybook-utils'; import { StoryFn } from '@storybook/react'; import Stepper, { Step, StepperProps } from '.'; const meta: StoryMetaType = { title: 'Composition/Data Display/Stepper', component: Stepper, parameters: { default: 'LiveExample', controls: { exclude: [...storybookExcludedControlParams, 'children'], }, generate: { combineArgs: { darkMode: [false, true], currentStep: [1, 4, 7], maxDisplayedSteps: [3, 7], completedStepsShown: [3, 5], }, }, }, args: { children: [
Overview
, Configuration, Update, Install, Billing, Address, Confirmation, ], currentStep: 1, maxDisplayedSteps: 5, completedStepsShown: 3, }, argTypes: { currentStep: { control: { type: 'range', min: 0, max: 7, // numSteps' max }, }, darkMode: storybookArgTypes.darkMode, maxDisplayedSteps: { control: { type: 'range', min: 3, max: 6, // numSteps' max - 1 }, description: 'Note: Min and max values for ranges are not defined in the component. The range values are only defined specifically for the Storybook instance so it renders correctly with all values. Value checking within the component will be added at a later date.', }, completedStepsShown: { control: { type: 'range', max: 5, // numSteps' max - 2 }, }, }, decorators: [ StoryFn => (
), ], }; export default meta; export const LiveExample: StoryFn = (args: StepperProps) => ( ); LiveExample.parameters = { chromatic: { disableSnapshot: true, }, }; LiveExample.args = { currentStep: 1, maxDisplayedSteps: 5, completedStepsShown: 3, }; export const Generated = () => {};