import * as React from 'react'; import { Button, Checkbox, Icon } from '@stoplight/ui-kit'; import { action } from '@storybook/addon-actions'; import { boolean, number, object, select, text, withKnobs } from '@storybook/addon-knobs'; import { storiesOf } from '@storybook/react'; import { JSONSchema4 } from 'json-schema'; import { JsonSchemaViewer, RowRenderer, SchemaRow } from '../'; const allOfSchemaResolved = require('../__fixtures__/allOf/allOf-resolved.json'); const schema = require('../__fixtures__/default-schema.json'); const stressSchema = require('../__fixtures__/stress-schema.json'); import { Wrapper } from './utils/Wrapper'; storiesOf('JsonSchemaViewer', module) .addDecorator(withKnobs) .addDecorator(storyFn => {storyFn()}) .add('default', () => ( )) .add('custom schema', () => ( )) .add('custom row renderer', () => { const customRowRenderer: RowRenderer = (node, rowOptions) => { return ( <>
); }; return ( ); }) .add('stress-test schema', () => ( <>
)) .add('allOf-schema', () => ( )) .add('error boundary', () => ( )) .add('invalid types property pretty error message', () => ( )) .add('dark', () => (
));