Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: StackのStoryを見直し #5017

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

misako0927
Copy link
Contributor

関連URL

https://smarthr.atlassian.net/browse/SHRUI-1082

概要

#4949 の方針に沿って、Stack コンポーネントの Story を見直しました。

変更内容

  • Stack の Story を見直し
  • Stack の VRT 用 Story を pict を利用して書き直し
    • 一部pictを使っていない部分もあるので、その辺りも見ていただきたい

確認方法

Storybook や Chromatic で確認してください。

@misako0927 misako0927 requested a review from a team as a code owner October 16, 2024 05:26
@misako0927 misako0927 requested review from moshisora, hiroki0525, Qs-F, s-sasaki-0529 and uknmr and removed request for a team October 16, 2024 05:26
Copy link

pkg-pr-new bot commented Oct 16, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/kufu/smarthr-ui@5017

commit: f4201e8

},
}

export const Gap: StoryObj<typeof Stack> = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gap を変えるとどう変わるのかが認識できる Story にしたいです!

以下のようなイメージ(疑似コード)。縦に並べることで違いがわかるかなぁ、と。

<Cluster>
  {[0, 0.25, 0.5, 0.75, ... , 4, 8].map((gap) => (
    <Stack {...args} gap={gap}>
      {[...Array(5)].map((_) => <ColorBox />)}
    </Stack>
  )}
</Cluster>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以下で直しました!
34b7304

なお、codeを処していないのでmap使わない方がいいかな〜と思い、ベタ書きしております

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code の確認は Docs に寄せていき最終的には消す予定なので、過渡期として気にしすぎなくても思っています。後からメンテナンスすることも考えにくいので、綺麗にできるなら今のうちにしておきたい。

},
} as Meta<typeof Stack>

export const VRTStackNarrow: StoryObj = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

幅に依って変わる振る舞いは持っていないので、なくてよさそう。

export default {
title: 'Layouts(レイアウト)/Stack/VRT',
component: Stack,
render: (args) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stack.stories.tsxGap.render をそのまま使っても良さそうに見えました!

},
}

export const Gap: StoryObj<typeof Stack> = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code の確認は Docs に寄せていき最終的には消す予定なので、過渡期として気にしすぎなくても思っています。後からメンテナンスすることも考えにくいので、綺麗にできるなら今のうちにしておきたい。

},
}

export const Align: StoryObj<typeof Stack> = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以下のような感じであれば、違いを視覚的に表せないかしら。

<Stack>
  {['stretch', 'baseline', 'flex-start', 'flex-end'].map((align) => (
    <Stack {...args} align={align}>
      <ColorBox />
      <ColorBox />
    </Stack>
  )}
</Stack>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants