diff --git a/packages/canon/src/components/Box/Box.stories.tsx b/packages/canon/src/components/Box/Box.stories.tsx index bd4e597fa0..a1b8400726 100644 --- a/packages/canon/src/components/Box/Box.stories.tsx +++ b/packages/canon/src/components/Box/Box.stories.tsx @@ -21,7 +21,7 @@ import { Stack } from '../Stack'; import { Inline } from '../Inline'; const meta = { - title: 'Components/Box', + title: 'Box', component: Box, parameters: { layout: 'centered', diff --git a/packages/canon/src/components/Button/Button.stories.tsx b/packages/canon/src/components/Button/Button.stories.tsx index c921efa6f2..50746067cd 100644 --- a/packages/canon/src/components/Button/Button.stories.tsx +++ b/packages/canon/src/components/Button/Button.stories.tsx @@ -21,7 +21,7 @@ import { Inline } from '../Inline'; import { Stack } from '../Stack'; const meta = { - title: 'Components/Button', + title: 'Button', component: Button, parameters: { layout: 'centered', diff --git a/packages/canon/src/components/Checkbox/Checkbox.stories.tsx b/packages/canon/src/components/Checkbox/Checkbox.stories.tsx index ffd874ffe7..af2d24dd9a 100644 --- a/packages/canon/src/components/Checkbox/Checkbox.stories.tsx +++ b/packages/canon/src/components/Checkbox/Checkbox.stories.tsx @@ -18,7 +18,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { Checkbox } from './Checkbox'; const meta = { - title: 'Components/Checkbox', + title: 'Checkbox', component: Checkbox, parameters: { layout: 'centered', diff --git a/packages/canon/src/components/Container/Container.stories.tsx b/packages/canon/src/components/Container/Container.stories.tsx index 66c86f638d..48a69f762d 100644 --- a/packages/canon/src/components/Container/Container.stories.tsx +++ b/packages/canon/src/components/Container/Container.stories.tsx @@ -20,7 +20,7 @@ import { Box } from '../Box/Box'; import { Container } from './Container'; const meta = { - title: 'Components/Container', + title: 'Container', component: Container, argTypes: { children: { diff --git a/packages/canon/src/components/Grid/Grid.stories.tsx b/packages/canon/src/components/Grid/Grid.stories.tsx index 8fa6caec23..b8374eb593 100644 --- a/packages/canon/src/components/Grid/Grid.stories.tsx +++ b/packages/canon/src/components/Grid/Grid.stories.tsx @@ -22,7 +22,7 @@ import { Box } from '../Box/Box'; import { Stack } from '../Stack'; const meta = { - title: 'Components/Grid', + title: 'Grid', component: Grid, argTypes: { children: { diff --git a/packages/canon/src/components/Heading/Heading.stories.tsx b/packages/canon/src/components/Heading/Heading.stories.tsx index 8c46528a2f..8add2ca613 100644 --- a/packages/canon/src/components/Heading/Heading.stories.tsx +++ b/packages/canon/src/components/Heading/Heading.stories.tsx @@ -20,7 +20,7 @@ import { Heading } from './Heading'; import { Stack } from '../Stack'; const meta = { - title: 'Components/Heading', + title: 'Heading', component: Heading, } satisfies Meta; diff --git a/packages/canon/src/components/Icon/Icon.stories.tsx b/packages/canon/src/components/Icon/Icon.stories.tsx index ad9d6d01dd..173ff9ae3c 100644 --- a/packages/canon/src/components/Icon/Icon.stories.tsx +++ b/packages/canon/src/components/Icon/Icon.stories.tsx @@ -21,7 +21,7 @@ import { CanonProvider } from '../../contexts/canon'; import { icons } from './icons'; const meta = { - title: 'Components/Icon', + title: 'Icon', component: Icon, parameters: { layout: 'centered', diff --git a/packages/canon/src/components/Inline/Inline.stories.tsx b/packages/canon/src/components/Inline/Inline.stories.tsx index b6653a3067..060edc8a97 100644 --- a/packages/canon/src/components/Inline/Inline.stories.tsx +++ b/packages/canon/src/components/Inline/Inline.stories.tsx @@ -20,7 +20,7 @@ import { Inline } from './Inline'; import { Box } from '../Box/Box'; const meta = { - title: 'Components/Inline', + title: 'Inline', component: Inline, argTypes: { align: { diff --git a/packages/canon/src/components/Stack/Stack.stories.tsx b/packages/canon/src/components/Stack/Stack.stories.tsx index 7e77bc861d..9c7ff604f3 100644 --- a/packages/canon/src/components/Stack/Stack.stories.tsx +++ b/packages/canon/src/components/Stack/Stack.stories.tsx @@ -20,7 +20,7 @@ import { Stack } from './Stack'; import { Box } from '../Box/Box'; const meta = { - title: 'Components/Stack', + title: 'Stack', component: Stack, argTypes: { align: { diff --git a/packages/canon/src/components/Table/stories/Example1.stories.tsx b/packages/canon/src/components/Table/Table.stories.tsx similarity index 86% rename from packages/canon/src/components/Table/stories/Example1.stories.tsx rename to packages/canon/src/components/Table/Table.stories.tsx index 140293438e..481a98d02f 100644 --- a/packages/canon/src/components/Table/stories/Example1.stories.tsx +++ b/packages/canon/src/components/Table/Table.stories.tsx @@ -14,23 +14,6 @@ * limitations under the License. */ -import * as React from 'react'; -import type { Meta, StoryObj } from '@storybook/react'; -import { - Table, - TableHead, - TableRow, - TableHeader, - TableCell, - TableBody, - TableFooter, -} from '../Table'; - -const meta = { - title: 'Components/Table/Examples/Simple', - component: Table, -} satisfies Meta; - const invoices = [ { invoice: 'INV001', @@ -76,6 +59,31 @@ const invoices = [ }, ]; +import React from 'react'; +import type { Meta, StoryObj } from '@storybook/react'; +import { + Table, + TableBody, + TableCell, + TableFooter, + TableHead, + TableHeader, + TableRow, +} from '../Table'; + +const meta = { + title: 'Table', + component: Table, + subcomponents: { + TableBody: TableBody as React.ComponentType, + TableCell: TableCell as React.ComponentType, + TableFooter: TableFooter as React.ComponentType, + TableHead: TableHead as React.ComponentType, + TableHeader: TableHeader as React.ComponentType, + TableRow: TableRow as React.ComponentType, + }, +} satisfies Meta; + export default meta; type Story = StoryObj; diff --git a/packages/canon/src/components/Table/stories/Table.stories.tsx b/packages/canon/src/components/Table/stories/Table.stories.tsx deleted file mode 100644 index 2267b77093..0000000000 --- a/packages/canon/src/components/Table/stories/Table.stories.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { Meta, StoryObj } from '@storybook/react'; -import { Table } from '../Table'; - -const meta = { - title: 'Components/Table/Components/Table', - component: Table, -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - args: { - children: "Hello World! I'm a basic table", - }, -}; diff --git a/packages/canon/src/components/Table/stories/TableBody.stories.tsx b/packages/canon/src/components/Table/stories/TableBody.stories.tsx deleted file mode 100644 index f69d26f0bd..0000000000 --- a/packages/canon/src/components/Table/stories/TableBody.stories.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as React from 'react'; -import type { Meta, StoryObj } from '@storybook/react'; -import { Table, TableBody } from '../Table'; - -const meta = { - title: 'Components/Table/Components/TableBody', - component: TableBody, - decorators: [ - Story => ( - - -
- ), - ], -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - args: { - children: "Hello World! I'm a basic table body", - }, -}; diff --git a/packages/canon/src/components/Table/stories/TableCaption.stories.tsx b/packages/canon/src/components/Table/stories/TableCaption.stories.tsx deleted file mode 100644 index 46ea5f0f4d..0000000000 --- a/packages/canon/src/components/Table/stories/TableCaption.stories.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { Meta, StoryObj } from '@storybook/react'; -import { TableCaption } from '../Table'; - -const meta = { - title: 'Components/Table/Components/TableCaption', - component: TableCaption, -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - args: {}, -}; diff --git a/packages/canon/src/components/Table/stories/TableCell.stories.tsx b/packages/canon/src/components/Table/stories/TableCell.stories.tsx deleted file mode 100644 index 126b72bf95..0000000000 --- a/packages/canon/src/components/Table/stories/TableCell.stories.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { Meta, StoryObj } from '@storybook/react'; -import { TableCell } from '../Table'; - -const meta = { - title: 'Components/Table/Components/TableCell', - component: TableCell, -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - args: {}, -}; diff --git a/packages/canon/src/components/Table/stories/TableFooter.stories.tsx b/packages/canon/src/components/Table/stories/TableFooter.stories.tsx deleted file mode 100644 index b7dbacbc30..0000000000 --- a/packages/canon/src/components/Table/stories/TableFooter.stories.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { Meta, StoryObj } from '@storybook/react'; -import { TableFooter } from '../Table'; - -const meta = { - title: 'Components/Table/Components/TableFooter', - component: TableFooter, -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - args: {}, -}; diff --git a/packages/canon/src/components/Table/stories/TableHead.stories.tsx b/packages/canon/src/components/Table/stories/TableHead.stories.tsx deleted file mode 100644 index c7cfac51e8..0000000000 --- a/packages/canon/src/components/Table/stories/TableHead.stories.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { Meta, StoryObj } from '@storybook/react'; -import { TableHead } from '../Table'; - -const meta = { - title: 'Components/Table/Components/TableHead', - component: TableHead, -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - args: {}, -}; diff --git a/packages/canon/src/components/Table/stories/TableHeader.stories.tsx b/packages/canon/src/components/Table/stories/TableHeader.stories.tsx deleted file mode 100644 index a2f044dcc3..0000000000 --- a/packages/canon/src/components/Table/stories/TableHeader.stories.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as React from 'react'; -import type { Meta, StoryObj } from '@storybook/react'; -import { Table, TableHeader } from '../Table'; - -const meta = { - title: 'Components/Table/Components/TableHeader', - component: TableHeader, - decorators: [ - Story => ( - - -
- ), - ], -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - args: { - children: "Hello World! I'm a basic table header", - }, -}; diff --git a/packages/canon/src/components/Table/stories/TableRow.stories.tsx b/packages/canon/src/components/Table/stories/TableRow.stories.tsx deleted file mode 100644 index 7eb58ed5a4..0000000000 --- a/packages/canon/src/components/Table/stories/TableRow.stories.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as React from 'react'; -import type { Meta, StoryObj } from '@storybook/react'; -import { Table, TableRow, TableHeader } from '../Table'; - -const meta = { - title: 'Components/Table/Components/TableRow', - component: TableRow, - decorators: [ - Story => ( - - - - -
- ), - ], -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - args: { - children: "Hello World! I'm a basic table row", - }, -}; diff --git a/packages/canon/src/components/Text/Text.stories.tsx b/packages/canon/src/components/Text/Text.stories.tsx index 2cde7ed553..ca9a790c3f 100644 --- a/packages/canon/src/components/Text/Text.stories.tsx +++ b/packages/canon/src/components/Text/Text.stories.tsx @@ -20,7 +20,7 @@ import { Text } from './Text'; import { Stack } from '../Stack'; const meta = { - title: 'Components/Text', + title: 'Text', component: Text, } satisfies Meta;