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(spindle-ui): add design doc for buttonSwitch #1243

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

newt239
Copy link
Collaborator

@newt239 newt239 commented Mar 11, 2025

新規コンポーネントButtonSwitchのDesign Docです。

@newt239 newt239 requested a review from yasuda-shin March 11, 2025 05:55
@newt239 newt239 self-assigned this Mar 11, 2025
Copy link
Contributor

github-actions bot commented Mar 11, 2025

Visit the preview URL for this PR (updated for commit 231d346):

https://ameba-spindle--pr1243-feat-button-switch-d-1wnukbwb.web.app

(expires Sat, 12 Apr 2025 08:23:15 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e7521619a2dd5c653490c8246e81ec2a5c8f1435

Copy link

reg-suit bot commented Mar 11, 2025

✨✨ That's perfect, there is no visual difference! ✨✨

Check out the report here.

</div>
```

## アクセシビリティ
Copy link
Contributor

Choose a reason for hiding this comment

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

2.5.5 ターゲットのサイズを理解する

も加えてもよさそうに思いました。

- [ ] ボタンスイッチをラップしているdiv要素に`role="group"`、選択中のボタンに`aria-pressed="true"`を付与している
- [ ] スクリーンリーダーでも機能落ちがなく、読み上げが過不足なく行われている

## リンク集
Copy link
Contributor

Choose a reason for hiding this comment

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

不要なら消しちゃって良いかと。

label: string;
value: string;
}[];
onChange: (value: string | null) => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
onChange: (value: string | null) => void;
onChange: (value: string) => void;

口頭で話した通り、利用側でNeutral化するで良さそうです 🙋‍♂️

@newt239 newt239 requested review from yasuda-shin and kc7891 March 13, 2025 05:51
<button
type="button"
aria-pressed="true"
class="spui-ButtonSwitch--button"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class="spui-ButtonSwitch--button"
class="spui-ButtonSwitch-button"

<button
type="button"
aria-pressed="false"
class="spui-ButtonSwitch--button"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class="spui-ButtonSwitch--button"
class="spui-ButtonSwitch-button"

type="button"
aria-pressed="true"
class="spui-ButtonSwitch--button"
data-value="option1"
Copy link
Contributor

Choose a reason for hiding this comment

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

data-valueの使い道なければ消しても良いかも

- Surface Quaternary (ホバー時の背景色)
- Surface Accent Primary (選択時の背景色)
- Text High Emphasis Inverse (選択時のテキスト色)
- Border Row Empasis (中央のボーダー色)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hover追記しましょう 🙏

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.

3 participants