-
Notifications
You must be signed in to change notification settings - Fork 15
docs(spindle-ui): add HeroCarousel design doc and tests and story #1651
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
base: main
Are you sure you want to change the base?
Conversation
|
821fa50 to
fa131c5
Compare
|
Visit the preview URL for this PR (updated for commit 4d1d48d): https://ameba-spindle--pr1651-docs-hero-carousel-4xud09po.web.app (expires Sat, 14 Feb 2026 07:45:12 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: e7521619a2dd5c653490c8246e81ec2a5c8f1435 |
|
reg-suit detected visual differences. Check this report, and review them.
How can I change the check status?If reviewers approve this PR, the reg context status will be green automatically. |
bd883c2 to
53e808e
Compare
|
storybook previewの期限切れちゃった場合retryできるんですっけ・・👀 (すみません) |
53e808e to
0c538d2
Compare
|
そですね。ジョブの再実行で再生成されまっせ。しました。 |
tokimari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大変遅くなりました 🙏
| ```tsx | ||
| import { HeroCarousel } from '@openameba/spindle-ui'; | ||
|
|
||
| const carouselList = [ | ||
| { title: '記事A', imageUrl: 'https://example.com/a.webp', link: 'https://example.com/a' }, | ||
| { title: '記事B', imageUrl: 'https://example.com/b.webp', link: 'https://example.com/b' }, | ||
| { title: '記事C', imageUrl: 'https://example.com/c.webp', link: 'https://example.com/c' }, | ||
| ]; | ||
|
|
||
| <HeroCarousel carouselList={carouselList} autoplay={false} />; | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits. 2件以上で使ってね、という話なのでサンプルコード書くまででもないかも?w
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
いちお最小限のコード例があると props の想定が分かったりするのでサンプルコードあってもいいかなと思いつつ。
| ### DO NOT | ||
|
|
||
| - 1件のみ、あるいは0件のリストで使用しない(1件のみはカルーセルの意図に合わず、0件は描画されません) | ||
| - 画像の代替テキストに意味のある文言を重ねない(本コンポーネントではタイトルが視覚的ラベルとなるため、画像は `alt=""` で装飾扱い) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「画像の代替テキストに意味のある文言を重ねない」部分の日本語の意味がよくわからなかったです・・! 🙏 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
と思ったらCarouselItemがalt指定できないのか〜〜〜理解 😂
https://github.com/openameba/spindle/blob/main/packages/spindle-ui/src/HeroCarousel/HeroCarouselItem.tsx#L41
もしかするとamebaでの事例的に入稿物が多くてそうなっちゃったんですかねぇ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
追加機能で指定できるようにしたいなぁ(別でいいんですが)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
画像に意味のある代替テキストを付与しない(タイトルがリンクラベルとなるため、画像はalt=""で装飾扱い)
って感じの言い回しにしてみました。
経緯わからないんですが、altそうなんですよねー
|
|
||
| - 1件のみ、あるいは0件のリストで使用しない(1件のみはカルーセルの意図に合わず、0件は描画されません) | ||
| - 画像の代替テキストに意味のある文言を重ねない(本コンポーネントではタイトルが視覚的ラベルとなるため、画像は `alt=""` で装飾扱い) | ||
| - 極端に長いタイトルを前提にしない(2行以上は省略表示されます) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目安の文字数を記載しているとより親切だなと思いました 🙌
| - [適切なフォーカス順序にする](https://a11y-guidelines.ameba.design/2/4/3/) | ||
| - [ ] フォーカス移動は視覚順序と一致している | ||
| - [フォーカスを見えるようにする](https://a11y-guidelines.ameba.design/2/4/7/) | ||
| - [ ] フォーカスリングはコントラスト十分なアウトラインで可視化されている |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コントラスト十分な
imo. もう少し明確なほうがよいかもです。十分とは?
| - [フォーカスを見えるようにする](https://a11y-guidelines.ameba.design/2/4/7/) | ||
| - [ ] フォーカスリングはコントラスト十分なアウトラインで可視化されている | ||
| - [ターゲットのサイズを理解する](https://a11y-guidelines.ameba.design/2/5/5/) | ||
| - [ ] コントロールのタップ領域はおおむね44×44px以上を確保している |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
おおむね?w
yasuda-shin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ご指摘いただいた箇所諸々修正してみました〜
| ```tsx | ||
| import { HeroCarousel } from '@openameba/spindle-ui'; | ||
|
|
||
| const carouselList = [ | ||
| { title: '記事A', imageUrl: 'https://example.com/a.webp', link: 'https://example.com/a' }, | ||
| { title: '記事B', imageUrl: 'https://example.com/b.webp', link: 'https://example.com/b' }, | ||
| { title: '記事C', imageUrl: 'https://example.com/c.webp', link: 'https://example.com/c' }, | ||
| ]; | ||
|
|
||
| <HeroCarousel carouselList={carouselList} autoplay={false} />; | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
いちお最小限のコード例があると props の想定が分かったりするのでサンプルコードあってもいいかなと思いつつ。
| ### DO NOT | ||
|
|
||
| - 1件のみ、あるいは0件のリストで使用しない(1件のみはカルーセルの意図に合わず、0件は描画されません) | ||
| - 画像の代替テキストに意味のある文言を重ねない(本コンポーネントではタイトルが視覚的ラベルとなるため、画像は `alt=""` で装飾扱い) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
画像に意味のある代替テキストを付与しない(タイトルがリンクラベルとなるため、画像はalt=""で装飾扱い)
って感じの言い回しにしてみました。
経緯わからないんですが、altそうなんですよねー

Summary
HeroCarouselコンポーネントのDesign Docとテストとストーリーを追加しました。
aria-label/aria-roledescriptionの付与確認aria-labelとクリック時の動作(前/次、再生/停止)carouselListが空配列のときにレンダーされないことの検証Test plan