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

ai-alina #4059

Merged
merged 22 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6c56410
ai-alina
alina-jacob-ibm May 8, 2024
8cacdd9
Update src/pages/components/text-input/usage.mdx
alina-jacob May 9, 2024
38edf6e
Update src/pages/components/text-input/usage.mdx
alina-jacob May 9, 2024
d92b468
Update src/pages/components/text-input/usage.mdx
alina-jacob May 9, 2024
96f28af
Update src/pages/components/text-input/usage.mdx
alina-jacob May 9, 2024
2fc3d94
Update src/pages/components/text-input/style.mdx
alina-jacob May 9, 2024
73edb83
Update src/pages/components/text-input/style.mdx
alina-jacob May 9, 2024
1f15a92
Update src/pages/components/number-input/style.mdx
alina-jacob May 9, 2024
d86897e
Update src/pages/components/number-input/style.mdx
alina-jacob May 9, 2024
1dc60a9
Update src/pages/components/number-input/usage.mdx
alina-jacob May 9, 2024
9173363
Update src/pages/components/text-input/style.mdx
alina-jacob May 9, 2024
5c784d5
Update src/pages/components/text-input/usage.mdx
alina-jacob May 9, 2024
56c61ea
Update src/pages/components/number-input/style.mdx
alina-jacob May 9, 2024
30a479d
Update src/pages/components/number-input/usage.mdx
alina-jacob May 9, 2024
6a71537
ai-alina
alina-jacob-ibm May 10, 2024
58b3765
ai-alina
alina-jacob-ibm May 10, 2024
a59febc
Update src/pages/components/text-input/usage.mdx
alina-jacob May 10, 2024
53174bb
Update src/pages/components/text-input/style.mdx
alina-jacob May 10, 2024
484bd90
Update src/pages/components/text-input/style.mdx
alina-jacob May 10, 2024
dc2f420
Update src/pages/components/number-input/style.mdx
alina-jacob May 10, 2024
3ce38dc
PR_name
alina-jacob-ibm May 15, 2024
2b7bddc
Merge branch 'main' into ai-alina
kodiakhq[bot] May 16, 2024
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
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.
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.
53 changes: 53 additions & 0 deletions src/pages/components/number-input/style.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ description:
tabs: ['Usage', 'Style', 'Code', 'Accessibility']
---

<AnchorLinks>

<AnchorLink>Color</AnchorLink>
<AnchorLink>Typography</AnchorLink>
<AnchorLink>Structure</AnchorLink>
<AnchorLink>Sizes</AnchorLink>
<AnchorLink>AI presence</AnchorLink>

</AnchorLinks>

## Color

| Element | Property | Color token |
Expand Down Expand Up @@ -174,3 +184,46 @@ layout, and design.
</div>

<Caption>Sizes for number input fields | px / rem</Caption>

## AI presence

The following are the unique styles applied to the component when the AI slug is
present. Unless specified, all other tokens in the component remain the same as
the non-AI variant.

More information about AI style elements is coming soon.

| Element | Property | Token / Size |
| --------------- | ---------------- | ------------------- |
| Linear gradient | start | `$ai-aura-start-sm` |
| | stop | `$ai-aura-stop` |
| Field | border-bottom | `$ai-border-strong` |
| | background color | `$field`\* |
| AI Slug | size | mini |

<Caption>
* Denotes a contextual color token that will change values based on the layer
it is placed on.
</Caption>

<Row>
<Column colLg={8}>

<Tabs>

<Tab label="Default">

![Default number input AI example](images/number-input-style-ai-default.png)

</Tab>

<Tab label="Fluid">

![Fluid number input AI example](images/number-input-style-ai-fluid.png)

</Tab>

</Tabs>

</Column>
</Row>
71 changes: 71 additions & 0 deletions src/pages/components/number-input/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ decrease the value with a two-segment control.

</PageDescription>

<InlineNotification>

Experimental Slug is now available for
[number input](https://react.carbondesignsystem.com/?path=/story/experimental-unstable-slug-examples--number-input&_ga=2.126834955.781464953.1715000611-86992666.1707752603&_gl=1*1l8cah1*_ga*ODY5OTI2NjYuMTcwNzc1MjYwMw..*_ga_FYECCCS21D*MTcxNTE3NzAxMC4zNi4xLjE3MTUxNzc1MTQuMC4wLjA.).
This addition changes the visual appearance of the component and introduces an
AI explainability feature when AI is present in the component.

</InlineNotification>

<AnchorLinks>

<AnchorLink>Live demo</AnchorLink>
<AnchorLink>Overview</AnchorLink>
<AnchorLink>Formatting</AnchorLink>
<AnchorLink>Content</AnchorLink>
<AnchorLink>Behaviors</AnchorLink>
<AnchorLink>AI presence</AnchorLink>
<AnchorLink>Related</AnchorLink>
<AnchorLink>References</AnchorLink>
<AnchorLink>Feedback</AnchorLink>
Expand Down Expand Up @@ -329,6 +339,67 @@ number of children as ‘0’.
</DoDont>
</Row>

## AI presence

Number input has a modification that takes on the AI visual styling when the AI
slug is present in the input. The AI variant of number input functions the same
as the normal version except with the additional of the AI slug which is both a
visual indicator and the trigger for the explainability popover.

More information about designing for AI guidelines is coming soon.

<Row>
<Column colLg={8}>

<Tabs>

<Tab label="Default">

![Default number input AI presence example](images/number-input-style-ai-default.png)

</Tab>

<Tab label="Fluid">

![Fluid number input AI presence example](images/number-input-style-ai-fluid.png)

</Tab>

</Tabs>

</Column>
</Row>

### Revert to AI

A number input can toggle between the AI variant and the non-AI variant
depending on the user’s interaction. If the user manually overrides the
AI-suggested content then the input will change from the AI variant to the
non-AI variant. Once edited, the user should still be able to switch back to the
initially AI generated content via a revert to AI button.

<Row>
<Column colLg={8}>

<Tabs>

<Tab label="Default">

![Default number input AI revert example](images/number-input-usage-13.png)

</Tab>

<Tab label="Fluid">

![Fluid number input AI revert example](images/number-input-usage-15.png)

</Tab>

</Tabs>

</Column>
</Row>

## Related

- Use [slider](https://carbondesignsystem.com/components/slider/usage/) when
Expand Down
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions src/pages/components/text-input/style.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ structure, and size.
<AnchorLink>Typography</AnchorLink>
<AnchorLink>Structure</AnchorLink>
<AnchorLink>Size</AnchorLink>
<AnchorLink>AI presence</AnchorLink>
<AnchorLink>Feedback</AnchorLink>

</AnchorLinks>
Expand Down Expand Up @@ -326,6 +327,49 @@ These sizes apply only to the default style of text input.

<Caption>Text input default style sizes | px / rem</Caption>

## AI presence

The following are the unique styles applied to the component when the AI slug is
present. Unless specified, all other tokens in the component remain the same as
the non-AI variant.

More information about AI style elements is coming soon.

| Element | Property | Token / Size |
| --------------- | ---------------- | ------------------- |
| Linear gradient | start | `$ai-aura-start-sm` |
| | stop | `$ai-aura-stop` |
| Field | border-bottom | `$ai-border-strong` |
| | background color | `$field`\* |
| AI Slug | size | mini |

<Caption>
* Denotes a contextual color token that will change values based on the layer
it is placed on.
</Caption>

<Row>
<Column colLg={8}>

<Tabs>

<Tab label="Default">

![Default text input and text area AI example](images/text-input-text-area-ai-presence-default.png)

</Tab>

<Tab label="Fluid">

![Fluid text input and text area AI example](images/text-input-text-area-ai-presence-fluid.png)

</Tab>

</Tabs>

</Column>
</Row>

## Feedback

Help us improve this component by providing feedback, asking questions, and
Expand Down
73 changes: 73 additions & 0 deletions src/pages/components/text-input/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ and short-form entries.

</PageDescription>

<InlineNotification>

Experimental Slug is now available for
[text input](https://react.carbondesignsystem.com/?path=/story/experimental-unstable-slug-examples--text-input)
and
[text area](https://react.carbondesignsystem.com/?path=/story/experimental-unstable-slug-examples--text-area).
This addition changes the visual appearance of the component and introduces an
AI explainability feature when AI is present in the component.

</InlineNotification>

<AnchorLinks>

<AnchorLink>Live demo</AnchorLink>
Expand All @@ -25,6 +36,7 @@ and short-form entries.
<AnchorLink>Content</AnchorLink>
<AnchorLink>Universal behaviors</AnchorLink>
<AnchorLink>Modifiers</AnchorLink>
<AnchorLink>AI Presence</AnchorLink>
<AnchorLink>Related</AnchorLink>
<AnchorLink>Feedback</AnchorLink>

Expand Down Expand Up @@ -561,6 +573,67 @@ met.
</Column>
</Row>

## AI presence

Text input and text area have a modification that takes on the AI visual styling
when the AI slug is present in the input. The AI variant functions the same as
the normal version except with the addition of the AI slug which is both a
visual indicator and the trigger for the explainability popover.

More information about designing for AI guidelines is coming soon.

<Row>
<Column colLg={8}>

<Tabs>

<Tab label="Default">

![Default text input and text area AI presence example](images/text-input-text-area-ai-presence-default.png)

</Tab>

<Tab label="Fluid">

![Fluid text input and text area AI presence example](images/text-input-text-area-ai-presence-fluid.png)

</Tab>

</Tabs>

</Column>
</Row>

### Revert to AI

The text input and text area can toggle between the AI variant and the non-AI
variant depending on the user’s interaction. If the user manually overrides the
AI-suggested content then the input will change from the AI variant to the
non-AI variant. Once edited, the user should still be able to switch back to the
initially AI generated content via a revert to AI button.

<Row>
<Column colLg={8}>

<Tabs>

<Tab label="Default">

![Default text input and text area AI revert example](images/text-input-text-area-ai-revert.png)

</Tab>

<Tab label="Fluid">

![Fluid text input and text area AI revert example](images/text-input-text-area-ai-revert-fluid.png)

</Tab>

</Tabs>

</Column>
</Row>

## Related

- [Form pattern](/patterns/forms-pattern/)
Expand Down
Loading