|
| 1 | +import type { Meta, StoryObj } from '@storybook/react'; |
| 2 | +import { AppBar } from '../../../standalone/src/AppBar'; |
| 3 | + |
| 4 | +const DEFAULT_SHELLS = [ |
| 5 | + { name: 'bash', path: '/bin/bash' }, |
| 6 | + { name: 'zsh', path: '/bin/zsh' }, |
| 7 | + { name: 'fish', path: '/usr/bin/fish' }, |
| 8 | +]; |
| 9 | + |
| 10 | +function AppBarStory(props: React.ComponentProps<typeof AppBar>) { |
| 11 | + return ( |
| 12 | + <div style={{ width: '100%' }}> |
| 13 | + <AppBar {...props} /> |
| 14 | + </div> |
| 15 | + ); |
| 16 | +} |
| 17 | + |
| 18 | +const meta: Meta<typeof AppBarStory> = { |
| 19 | + title: 'Components/AppBar', |
| 20 | + component: AppBarStory, |
| 21 | + args: { |
| 22 | + projectDir: '/home/user/projects/mouseterm', |
| 23 | + homeDir: '/home/user', |
| 24 | + shells: DEFAULT_SHELLS, |
| 25 | + }, |
| 26 | +}; |
| 27 | + |
| 28 | +export default meta; |
| 29 | +type Story = StoryObj<typeof AppBarStory>; |
| 30 | + |
| 31 | +export const Default: Story = {}; |
| 32 | + |
| 33 | +export const HomeDirectory: Story = { |
| 34 | + args: { |
| 35 | + projectDir: '/home/user', |
| 36 | + homeDir: '/home/user', |
| 37 | + }, |
| 38 | +}; |
| 39 | + |
| 40 | +export const LongPath: Story = { |
| 41 | + args: { |
| 42 | + projectDir: '/home/user/projects/very-deep/nested/directory/structure/my-project', |
| 43 | + homeDir: '/home/user', |
| 44 | + }, |
| 45 | +}; |
| 46 | + |
| 47 | +export const SingleShell: Story = { |
| 48 | + args: { |
| 49 | + shells: [{ name: 'bash', path: '/bin/bash' }], |
| 50 | + }, |
| 51 | +}; |
| 52 | + |
| 53 | +export const ManyShells: Story = { |
| 54 | + args: { |
| 55 | + shells: [ |
| 56 | + { name: 'bash', path: '/bin/bash' }, |
| 57 | + { name: 'zsh', path: '/bin/zsh' }, |
| 58 | + { name: 'fish', path: '/usr/bin/fish' }, |
| 59 | + { name: 'sh', path: '/bin/sh' }, |
| 60 | + { name: 'nu', path: '/usr/bin/nu' }, |
| 61 | + ], |
| 62 | + }, |
| 63 | +}; |
| 64 | + |
| 65 | +export const AbsolutePathOutsideHome: Story = { |
| 66 | + args: { |
| 67 | + projectDir: '/var/www/my-site', |
| 68 | + homeDir: '/home/user', |
| 69 | + }, |
| 70 | +}; |
0 commit comments