-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #857 from kufu/renovate/smarthr-ui-35.x
Update dependency smarthr-ui to v35
- Loading branch information
Showing
13 changed files
with
126 additions
and
13 deletions.
There are no files selected for viewing
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,67 @@ | ||
--- | ||
title: 'Badge' | ||
description: '' | ||
--- | ||
|
||
import { ComponentPropsTable } from '@Components/ComponentPropsTable' | ||
import { ComponentStory } from '@Components/ComponentStory' | ||
|
||
Badgeコンポーネントは、件数などの数値を視覚的に表すためのコンポーネントです。 | ||
|
||
<ComponentStory name="Badge" /> | ||
|
||
## 種類 | ||
|
||
件数を表すものと、単に視覚情報をドットで表すものの2種類があります。 | ||
|
||
```tsx editable codeBlock | ||
<> | ||
<Badge count={100} /> | ||
<Badge count={100} dot /> | ||
</> | ||
``` | ||
|
||
アイコンなどの右肩にも表示できます。 | ||
|
||
```tsx editable codeBlock | ||
<> | ||
<Badge count={9}> | ||
<FaBellIcon /> | ||
</Badge> | ||
<Badge dot> | ||
<FaBellIcon /> | ||
</Badge> | ||
</> | ||
``` | ||
|
||
### 色 | ||
|
||
特に意味は持たせずに4種類の色を用意しています。 | ||
|
||
```tsx editable codeBlock | ||
<> | ||
<Badge count={9} /> | ||
<Badge count={9} type="grey" /> | ||
<Badge count={9} type="yellow" /> | ||
<Badge count={9} type="red" /> | ||
<Badge dot /> | ||
<Badge dot type="grey" /> | ||
<Badge dot type="yellow" /> | ||
<Badge dot type="red" /> | ||
</> | ||
``` | ||
|
||
## アクセシビリティ | ||
|
||
ドット表示の場合には視覚情報しか持たないため、何らかの形で必ずアクセシブルな名前を与えてください。 | ||
|
||
```tsx editable codeBlock | ||
<> | ||
<Badge dot count={9} /> | ||
<VisuallyHiddenText>通知があります</VisuallyHiddenText> | ||
</> | ||
``` | ||
|
||
## Props | ||
|
||
<ComponentPropsTable name="Badge" /> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: 'Switch' | ||
description: '' | ||
--- | ||
|
||
import { ComponentPropsTable } from '@Components/ComponentPropsTable' | ||
import { ComponentStory } from '@Components/ComponentStory' | ||
|
||
Switchコンポーネントは、オン・オフを切り替えます。状態の切り替えは即時で反映されます。 | ||
|
||
<ComponentStory name="Switch" /> | ||
|
||
## 使用上の注意 | ||
|
||
### CheckBox との違い | ||
|
||
Switchは操作時に即時実行されます。Checkboxと異なり、送信ボタンは不要です。 | ||
|
||
また、未確定(`:indeterminate`)の状態を持ちません。内部的に `role=switch` を使っています。 | ||
|
||
### SegmentedControl との違い | ||
|
||
Switchはオン・オフのどちらか1つの状態を表します。対する概念ではあるが、異なる状態を表す場合はSegmentedControlを使ってください。 | ||
|
||
```tsx editable codeBlock | ||
<SegmentedControl size="s" options={[ | ||
{ value: 'list view', content: 'リスト表示' }, | ||
{ value: 'map view', content: 'マップ表示' }, | ||
]} value="list view" /> | ||
``` | ||
|
||
### ラベルについて | ||
|
||
Switchは基本的にラベルを必要とします。周囲のコンテキストに依って省略できます。 | ||
|
||
また、利用者が状態を認識しにくくなるため、Switchの状態が切り替わってもラベルは変更しないでください。 | ||
|
||
## Props | ||
|
||
<ComponentPropsTable name="Switch" /> | ||
|
||
## 関連リンク | ||
|
||
* [CheckBox](/products/components/check-box/) | ||
* [SegmentedControl](/products/components/segmented-control/) | ||
* [ARIA: switch ロール - アクセシビリティ | MDN](https://developer.mozilla.org/ja/docs/Web/Accessibility/ARIA/Roles/switch_role) |
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
Loading
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
-678 Bytes
(97%)
static/thumbnails/component-stories/Layouts(レイアウト)-Center.png
Loading
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
-537 Bytes
(96%)
static/thumbnails/component-stories/Layouts(レイアウト)-Reel.png
Loading
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
-1.15 KB
(98%)
static/thumbnails/component-stories/Navigation(ナビゲーション)-SectioningContent.png
Loading
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
+49 Bytes
(100%)
static/thumbnails/component-stories/Navigation(ナビゲーション)-TabBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
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