File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,16 +58,21 @@ export default function ChoiceRow<T extends string>({
5858 onChange : ( selected : T [ ] ) => void ;
5959} ) {
6060 if ( options . length === 0 ) return null ;
61+ // 「すべて」の幅は**その行の選択肢と同じ基準**にする —— 3文字固定なので詰められる
62+ // (以前はそうしていた)が、名前を出す選択肢の隣に細い「すべて」が並ぶと、
63+ // 1つだけ幅が違って行の頭が欠けたように見える。詰めるのは選択肢の側も
64+ // 全部詰めている行(ランクのようにアイコン・1文字だけの行)に限る
65+ const allBasis = options . every ( ( opt ) => opt . compact ) ? BASIS_COMPACT : BASIS ;
6166 return (
62- < div className = "flex flex-wrap gap-px overflow-hidden rounded-l-lg border border-gray-300 bg-gray-300 text-sm" >
67+ // **四隅とも直角**。かつては左端だけ角丸にしていた(枠も rounded-l-lg)——
68+ // 右端を直角にしているのは、枠が角丸だと overflow-hidden が最後のチップの角を
69+ // 丸く切ってしまい、そこだけ形が違って見えるため。ただし左右で形が違うほうが
70+ // 目立つので、角丸をやめて統一した(折り返した2行目以降の先頭も直角でそろう)
71+ < div className = "flex flex-wrap gap-px overflow-hidden border border-gray-300 bg-gray-300 text-sm" >
6372 < button
6473 type = "button"
6574 onClick = { ( ) => onChange ( [ ] ) }
66- // 角丸は左端だけ(枠も rounded-l-lg)。**右端は直角**にする ——
67- // 枠が角丸だと overflow-hidden が最後のチップの角を丸く切ってしまい、
68- // そこだけ形が違って見えるため(折り返した2行目以降の先頭も直角のまま)。
69- // 「すべて」は3文字固定なので詰めてよい(折り返させない)
70- className = { `grow ${ BASIS_COMPACT } rounded-l-lg px-2 py-1.5 font-medium ${
75+ className = { `grow ${ allBasis } px-2 py-1.5 font-medium ${
7176 selected . length === 0
7277 ? "bg-blue-600 text-white"
7378 : "bg-gray-100 text-gray-500 hover:bg-gray-200"
You can’t perform that action at this time.
0 commit comments