-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-guidlines-InformationPanel
- Loading branch information
Showing
51 changed files
with
585 additions
and
1,243 deletions.
There are no files selected for viewing
Binary file modified
BIN
-4.28 KB
(99%)
...icles/communication/capture/images/service_capture/SmartHRのホーム_ノーマル_パソコンサイズ.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.24 KB
(99%)
...cles/communication/capture/images/service_capture/SmartHRのホーム_フォーマル_パソコンサイズ.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+99.7 KB
content/articles/products/components/check-box/images/check-box-confirm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.1 KB
content/articles/products/components/check-box/images/check-box-do.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.7 KB
content/articles/products/components/check-box/images/check-box-dont.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+69.7 KB
content/articles/products/components/check-box/images/check-box-mixed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
title: 'CheckBox' | ||
description: "ユーザーに「true/false」といった正反対の状態を入力させるコンポーネントです。" | ||
--- | ||
import { ComponentStory } from '@Components/ComponentStory' | ||
import { ComponentPropsTable } from '@Components/ComponentPropsTable' | ||
import { DoAndDont } from '@Components/DoAndDont' | ||
import { StaticImage } from '@Components/StaticImage' | ||
import { Cluster} from 'smarthr-ui' | ||
|
||
import checkBoxDo from './images/check-box-do.png'; | ||
import checkBoxDont from './images/check-box-dont.png'; | ||
|
||
ユーザーに「true/false」といった正反対の状態を入力させるコンポーネントです。 | ||
`input[type='checkbox']`の代わりとして使用します。 | ||
|
||
<ComponentStory name="CheckBox" /> | ||
|
||
## 使用上の注意 | ||
|
||
### 選択肢が複数選択できる場合に使用する | ||
|
||
チェックボックスは選択肢を複数選択できる場合に使用します。 | ||
|
||
- 複数の選択肢から単一選択しかできず、表示領域に余裕がある場合は原則として[RadioButton](/products/components/radio-button/)を検討してください。 | ||
- 選択肢が多い場合や表示領域が狭い場合は、[Select](/products/components/select/)や[ComboBox](/products/components/combo-box/)を検討してください。 | ||
|
||
![複数項目をチェックボックスで選択している状態](/images/check-box1.png) | ||
|
||
|
||
### 「ON/OFF」といった2択の切り替え入力に使用しない | ||
|
||
チェックボックスは、「ON/OFF」「有効/無効」「はい/いいえ」といった2択の切り替え入力には原則として使用しないでください。 | ||
|
||
「ON/OFF」などのブール値で制御できる項目にチェックボックスを使用した場合、一方の選択肢が暗黙的になりチェック状態から現在の選択状態が認識しづらくなる場合があります。 | ||
こうした場合には、選択肢を明示的に表示できる[RadioButton](/products/components/radio-button/)を使用してください。 | ||
|
||
<Cluster gap={1}> | ||
<DoAndDont | ||
type="do" | ||
img={<StaticImage src={checkBoxDo} alt="Do" width="320" />} | ||
label={<Text>すべての選択肢が明示的に表示されてい<br/>るため、現在の状態が把握しやすい</Text>} | ||
/> | ||
<DoAndDont | ||
type="dont" | ||
img={<StaticImage src={checkBoxDont} alt="Dont" width="320" />} | ||
label={<Text>「無効」という選択肢が暗黙的であり、<br/>現在の状態をラベルとチェック状態から<br/>推測しなければならない</Text>} | ||
/> | ||
</Cluster> | ||
|
||
例外として、以下のようにユーザーに操作内容の確認を促す手段としてチェックボックスを単独で使用することがあります。 | ||
|
||
- 利用規約などユーザーに許諾を得る必要がある内容の確認を促す場合 | ||
- [削除ダイアログ](/products/design-patterns/delete-dialog/#h3-5)など、重要な操作を行なう場合でユーザーに注意事項の確認を促す場合 | ||
|
||
![削除ダイアログで操作の確認を促す際のチェックボックスの使用例](/images/check-box-confirm.png) | ||
|
||
### submitなしに即時反映するUIとして使用しない | ||
|
||
チェックボックスは1クリックで状態が正反対の結果になるため、誤入力による意図しない結果の反映を避けるために、原則として入力後に「送信」や「保存」といったtype属性が`submit`のボタンによって入力確定するフォーム画面などで使用してください。 | ||
|
||
よくあるテーブルで「表示/非表示」を切り替える場合や、表示領域上`submit`のボタンの配置が難しい場合など、即時反映を前提とする箇所では[Switch](/products/components/switch/)を使用してください。 | ||
|
||
## 状態 | ||
|
||
### 混在(mixed) | ||
|
||
[テーブル内の一括操作](/products/design-patterns/table-bulk-action/)の「一括選択するチェックボックス」など、複数のチェックボックスの状態をまとめて示す必要があるチェックボックスにおいて、選択状態と未選択状態が混ざっている状態を示す場合には、混在選択状態(`mixed=true`)を採用します。 | ||
|
||
![よくあるテーブルでの混在状態のチェックボックスの使用例](/images/check-box-mixed.png) | ||
|
||
## デザインパターン | ||
|
||
設定画面によくある複数の設定項目でチェックボックスを整列して表示する場合などは、[共通設定の操作権限項目](/products/design-patterns-core-features/access-control-setting-pattern/)のデザインパターンを参考にしてください。 | ||
|
||
## Props | ||
|
||
<ComponentPropsTable name="CheckBox" /> | ||
|
18 changes: 16 additions & 2 deletions
18
content/articles/products/components/compact-information-panel.mdx
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.