-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
105 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
packages/smarthr-ui/src/components/TabBar/TabBar-bordered.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import TabBarStories from './TabBar.stories' | ||
|
||
import type { StoryObj } from '@storybook/react' | ||
|
||
export default { | ||
...TabBarStories, | ||
title: 'Navigation(ナビゲーション)/TabBar/bordered', | ||
tags: ['!autodocs'], | ||
} | ||
|
||
export const True: StoryObj = { | ||
name: 'true', | ||
args: { | ||
bordered: true, | ||
}, | ||
} | ||
|
||
export const False = { | ||
name: 'false', | ||
args: { | ||
bordered: false, | ||
}, | ||
} |
61 changes: 17 additions & 44 deletions
61
packages/smarthr-ui/src/components/TabBar/TabBar.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,38 @@ | ||
import { action } from '@storybook/addon-actions' | ||
import React, { type ComponentProps } from 'react' | ||
|
||
import { Heading } from '../Heading' | ||
import { Stack } from '../Layout' | ||
import React from 'react' | ||
|
||
import { TabBar } from './TabBar' | ||
import { TabItem } from './TabItem' | ||
|
||
import type { Meta, StoryFn } from '@storybook/react' | ||
|
||
const Template: StoryFn<ComponentProps<typeof TabBar>> = (args) => ( | ||
<TabBar {...args}> | ||
<TabItem id="tab1" onClick={action('tab1')} selected> | ||
タブ1 | ||
</TabItem> | ||
<TabItem id="tab2" onClick={action('tab2')}> | ||
タブ2 | ||
</TabItem> | ||
</TabBar> | ||
) | ||
import type { Meta } from '@storybook/react' | ||
|
||
export default { | ||
title: 'Navigation(ナビゲーション)/TabBar', | ||
component: TabBar, | ||
subcomponents: { TabItem }, | ||
render: Template, | ||
render: (args) => ( | ||
<TabBar {...args}> | ||
<TabItem id="tab1" onClick={action('tab1')} selected> | ||
タブ1 | ||
</TabItem> | ||
<TabItem id="tab2" onClick={action('tab2')}> | ||
タブ2 | ||
</TabItem> | ||
</TabBar> | ||
), | ||
parameters: { | ||
chromatic: { disableSnapshot: true }, | ||
}, | ||
} as Meta<typeof TabBar> | ||
|
||
export const Default = () => ( | ||
<TabBar> | ||
<TabItem id="tab1" onClick={action('tab1')} selected> | ||
タブ1 | ||
</TabItem> | ||
<TabItem id="tab2" onClick={action('tab2')}> | ||
タブ2 | ||
</TabItem> | ||
</TabBar> | ||
) | ||
|
||
export const Playground = { | ||
export const Default = { | ||
args: { | ||
bordered: true, | ||
}, | ||
} | ||
|
||
export const Boardered = { | ||
name: 'bordered', | ||
render: () => ( | ||
<Stack gap={2} as="section"> | ||
<Heading>bordered</Heading> | ||
<Stack as="section" gap={0.5}> | ||
<Heading type="blockTitle">線あり(デフォルト)</Heading> | ||
<Template bordered /> | ||
</Stack> | ||
<Stack as="section" gap={0.5}> | ||
<Heading type="blockTitle">線なし</Heading> | ||
<Template bordered={false} /> | ||
</Stack> | ||
</Stack> | ||
), | ||
export const Playground = { | ||
args: { | ||
bordered: true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters