diff --git a/packages/dataviews/src/components/dataform/stories/index.story.tsx b/packages/dataviews/src/components/dataform/stories/index.story.tsx new file mode 100644 index 00000000000000..2e288c8e11d41c --- /dev/null +++ b/packages/dataviews/src/components/dataform/stories/index.story.tsx @@ -0,0 +1,42 @@ +/** + * WordPress dependencies + */ +import { useState } from '@wordpress/element'; + +/** + * Internal dependencies + */ +import DataForm from '../index'; + +const meta = { + title: 'DataViews/DataForm', + component: DataForm, +}; +export default meta; + +const fields = [ + { + id: 'title', + label: 'Title', + type: 'text' as const, + }, +]; + +export const Default = () => { + const [ post, setPost ] = useState( { + title: 'Hello, World!', + } ); + + const form = { + visibleFields: [ 'title' ], + }; + + return ( + + ); +}; diff --git a/packages/dataviews/src/stories/fixtures.js b/packages/dataviews/src/components/dataviews/stories/fixtures.js similarity index 98% rename from packages/dataviews/src/stories/fixtures.js rename to packages/dataviews/src/components/dataviews/stories/fixtures.js index 1ab26af4ef14d0..01351b84848fc1 100644 --- a/packages/dataviews/src/stories/fixtures.js +++ b/packages/dataviews/src/components/dataviews/stories/fixtures.js @@ -12,7 +12,7 @@ import { /** * Internal dependencies */ -import { LAYOUT_TABLE } from '../constants'; +import { LAYOUT_TABLE } from '../../../constants'; export const data = [ { diff --git a/packages/dataviews/src/stories/index.story.js b/packages/dataviews/src/components/dataviews/stories/index.story.js similarity index 86% rename from packages/dataviews/src/stories/index.story.js rename to packages/dataviews/src/components/dataviews/stories/index.story.js index 8a5ccd83450237..9ce1c29573e55c 100644 --- a/packages/dataviews/src/stories/index.story.js +++ b/packages/dataviews/src/components/dataviews/stories/index.story.js @@ -6,10 +6,10 @@ import { useState, useMemo } from '@wordpress/element'; /** * Internal dependencies */ -import { DataViews } from '../index'; +import DataViews from '../index'; import { DEFAULT_VIEW, actions, data, fields } from './fixtures'; -import { LAYOUT_GRID, LAYOUT_TABLE } from '../constants'; -import { filterSortAndPaginate } from '../filter-and-sort-data-view'; +import { LAYOUT_GRID, LAYOUT_TABLE } from '../../../constants'; +import { filterSortAndPaginate } from '../../../filter-and-sort-data-view'; const meta = { title: 'DataViews/DataViews',