/*! Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. */ import * as React from 'react'; import Screener from 'screener-storybook/src/screener'; import { storiesOf } from '@storybook/react'; import { FabricDecoratorFixedWidth, FabricDecorator } from '../utilities'; import { Fabric, SpinButton, TextField, ISpinButtonProps, ISpinButtonStyles, ITextFieldStyles, } from '@fluentui/react-next'; import { Position } from 'office-ui-fabric-react/lib/utilities/positioning'; const props: ISpinButtonProps = { defaultValue: '0', label: 'Basic SpinButton:', min: 0, max: 0, step: 1, }; const styles: Partial = { root: { width: 300 } }; const textFieldStyles: Partial = { root: { width: 250, display: 'inline-block' }, }; const iconProps = { iconName: 'IncreaseIndentLegacy' }; storiesOf('SpinButton Next', module) .addDecorator(FabricDecoratorFixedWidth) .addDecorator(story => ( {story()} )) .addStory('Root', () => ( )) .addStory('Disabled', () => ( )) .addStory( 'With icon', () => ( ), { rtl: true }, ); // The stories for label placement are separate since they don't need to include hover/click states storiesOf('SpinButton', module) .addDecorator(FabricDecorator) .addDecorator(story => ( {story()} )) .addStory( 'Label at end', () => ( ), { rtl: true }, ) .addStory( 'Label at end with icon', () => ( ), { rtl: true }, ) .addStory('Label on top', () => ( {/* DO NOT delete this TextField! It's here to verify that the SpinButton's field and label vertically align with other form components (this positioning can get messed up since SpinButton's optional icon is 1px larger than the label line height). */} )) .addStory('Label on top with icon', () => ( {/* DO NOT delete this TextField! It's here to verify that the SpinButton's field and label vertically align with other form components (this positioning can get messed up since SpinButton's optional icon is 1px larger than the label line height). */} )) .addStory('Label on bottom', () => ( )) .addStory('Label on bottom with icon', () => ( ));