| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 | import type { Meta, StoryObj } from '@storybook/react';
import { Heading } from '../../../atoms';
import { TocWidget } from './toc-widget';
const meta = {
  component: TocWidget,
  title: 'Organisms/Widgets/Table of Contents',
} satisfies Meta<typeof TocWidget>;
export default meta;
type Story = StoryObj<typeof meta>;
export const TableOfContents: Story = {
  args: {
    heading: <Heading level={3}>Table of contents</Heading>,
    tree: [
      { children: [], depth: 2, id: 'title1', label: 'Title 1' },
      {
        children: [
          { children: [], depth: 3, id: 'subtitle1', label: 'Subtitle 1' },
          { children: [], depth: 3, id: 'subtitle2', label: 'Subtitle 2' },
        ],
        depth: 2,
        id: 'title2',
        label: 'Title 2',
      },
      { children: [], depth: 2, id: 'title3', label: 'Title 3' },
    ],
  },
};
 |