paginationコンポーネントを追加#99
Draft
yamaki0405 wants to merge 2 commits into
Draft
Conversation
ドキュメント(design/design.pepabo.com#632 の States > Disabled 節)の 「出力しない場合も、要素分の領域は保持します」に実装を合わせる。 - 端のページではリンクの代わりに ._previous / ._next の -is-placeholder(visibility: hidden の span)を出力し、 レイアウトシフトと連続操作中の誤クリックを防ぐ - プレースホルダーは同一ラベル・同一基底クラスのため幅が一致する
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paginationコンポーネントの新規追加
概要
Paginationコンポーネントを新規追加します。
1画面に収まらない量の一覧コンテンツを複数のページに分割し、任意のページへ移動できるようにするナビゲーション系のコンポーネントです。
仕様のたたき台となるドキュメントページを design/design.pepabo.com#632(デザインポータル、GHE)で提案しており、この PR はその仕様に対応する実装です。仕様確定前のため draft で出しています。
変更内容
@pepabo-inhouse/paginationパッケージを新規作成@pepabo-inhouse/components-webに統合Paginationコンポーネントとストーリーを追加構成要素
.in-pagination<nav>要素。aria-labelにナビゲーション対象名を設定._list<ul>。Previous / Next は含めない(読み上げに含まれる項目をページ番号だけに揃え、種類の異なる操作が混ざらないようにするため)._item<li>._link<a>._current<span>。aria-current="page"を設定。太字+背景色で表現._truncation<li>にaria-hidden="true"._previous/._next-is-placeholder(visibility: hiddenの span)を置いて要素分の領域を保持する(レイアウトシフト・誤クリック防止)._counter5 / 10のような現在位置表示。ページ番号なしの Simple 形式で使用対応しているバリエーション
get-interactive-component-height-keys()).-size-{value}._listを置かず._counterを置く)インタラクション
._link/._previous/._next::hover/:active(背景オーバーレイ)、:focus-visible(フォーカスリング表示)確認
npm run compile/npm run lint/npm run testすべてパスaria-current/aria-hidden/ nav 構造を確認済みレビューポイント
._current)の表現: 太字 +get-surface-color(light, secondary)の背景にしています。もっと強調(interactive色の塗り等)すべきか