Skip to content

Commit 6e255cc

Browse files
committed
breadcrumbs-stories
1 parent c7d5717 commit 6e255cc

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

src/components/ComponentWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import { ModalProvider } from 'react-declarative';
44

55
interface IComponentWrapperrProps {
6-
children: React.ReactChild;
6+
children: React.ReactNode;
77
}
88

99
export const ComponentWrapper = ({

src/components/PickerWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import { ModalProvider } from 'react-declarative';
44

55
interface IPickerWrapperProps {
6-
children: React.ReactChild;
6+
children: React.ReactNode;
77
}
88

99
export const PickerWrapper = ({
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { Breadcrumbs, IOption, One, IField, FieldType } from 'react-declarative';
2+
3+
import { action } from '@storybook/addon-actions';
4+
5+
import { ComponentWrapper } from '../../components/ComponentWrapper';
6+
7+
const actions: IOption[] = [
8+
{
9+
label: 'Sample action',
10+
action: 'sample-action',
11+
}
12+
];
13+
14+
const fields: IField[] = [
15+
{
16+
type: FieldType.Line,
17+
title: 'Content',
18+
},
19+
{
20+
type: FieldType.Text,
21+
name: 'text',
22+
defaultValue: 'Default value',
23+
title: 'Title',
24+
description: 'Description',
25+
},
26+
];
27+
28+
const View = () => (
29+
<ComponentWrapper>
30+
<Breadcrumbs
31+
onSave={action('save')}
32+
onAction={action('action')}
33+
actions={actions}
34+
/>
35+
<One fields={fields} />
36+
</ComponentWrapper>
37+
);
38+
39+
export const BreadcrumbsView = View.bind({});
40+
41+
BreadcrumbsView.argTypes = {
42+
actions: {
43+
name: 'actions',
44+
defaultValue: actions,
45+
readonly: true,
46+
control: {
47+
type: 'object',
48+
},
49+
},
50+
fields: {
51+
name: 'fields',
52+
defaultValue: fields,
53+
readonly: true,
54+
control: {
55+
type: 'object',
56+
},
57+
},
58+
};
59+
60+
61+
export default {
62+
title: 'Breadcrumbs/View',
63+
};

0 commit comments

Comments
 (0)