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(AIChip): add documentation of AI Chip component #2220

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/src/data/nav/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@ base: components
menus:
- label: Overview
link: /components/overview/all-components/

- label: AI
link: /components/AIButton/usage/
hideInMobile: true
subMenu: [
{
label: 'AI Buttons',
link: /components/AIButton/usage/
},
{
label: 'AI Chip',
link: /components/AIChip/usage/
},
{
label: 'Sara',
},
{
label: 'Sara Sparkle',
},
]

- label: Action sheet
link: /components/actionSheet/usage/
Expand Down
7 changes: 7 additions & 0 deletions docs/src/pages/components/AIChip/code.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#### Live Demo
<br/>

<Preview name='components-ai-ai-chip-all--all' />

#### Props
<PreviewWithPropTable name='components-ai-ai-chip-all--all' />
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.
77 changes: 77 additions & 0 deletions docs/src/pages/components/AIChip/usage.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: AI Chip
description: AI Chip, based on Action Chips, enables contextual and dynamic AI actions. It has a distinct appearance to signal users that the action utilizes AI capabilities.
tabs: ['Usage', 'Code']
showMobile: true
keywords: ['Toggle', 'Action Chip', 'Chip']
---

<Preview name='components-ai-ai-chip-all--all' />

### States

AI Chip supports **5 states** - default, hover, active, focus and disabled.

![States - AI chip](./images/states.png)
<Caption>States - AI chip</Caption>

### Structure

#### AI chip

<table style={{width: "100%"}}>
<tbody>
<tr>
<th style={{width:"50%", textAlign: "left"}}>Property</th>
<th style={{width:"50%", textAlign: "left"}}>Value(s)</th>
</tr>
<tr style={{verticalAlign: "top"}}>
<td>Height</td>
<td>24px</td>
</tr>
<tr style={{verticalAlign: "top"}}>
<td>Corner radius</td>
<td>12px</td>
</tr>
</tbody>
</table>

<br />

![ Structure - AI chip](./images/structure.png)
<Caption> Structure - AI chip</Caption>

### Configurations

#### AI Chip

<table style={{width: "100%"}}>
<tbody>
<tr>
<th style={{width:"33%", textAlign: "left"}}>Property</th>
<th style={{width:"33%", textAlign: "left"}}>Value(s)</th>
<th style={{width:"33%", textAlign: "left"}}>Default value</th>
</tr>
<tr style={{verticalAlign: "top"}}>
<td>Label<br/></td>
<td>&#60;label&#62;</td>
<td>-</td>
</tr>
<tr style={{verticalAlign: "top"}}>
<td>Left icon<br/><em>(optional)</em></td>
<td>&#60;icon name&#62;</td>
<td>-</td>
</tr>
</tbody>
</table>

<br />

### Usage

#### AI Chip for AI assisted actions

AI Chip should be used where there are actions that are assisted/powered by AI.

![AI Chip for AI assisted actions](./images/ai-action.png)
<Caption>AI Chip for AI assisted actions</Caption>
Loading