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

add vertical tab usage and style documentation #4116

Merged
merged 24 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e79e2bf
add vertical tab usage and style documentation
kingtraceyj Jun 12, 2024
dd79daa
revised tab panel info
kingtraceyj Jun 12, 2024
e72c992
Merge branch 'main' into vertical-tabs
kingtraceyj Jun 13, 2024
9d0dd27
add in secondary label styles
kingtraceyj Jun 13, 2024
62b19f4
add closing tags
kingtraceyj Jun 13, 2024
8ee10dc
fixing links and images
kingtraceyj Jun 14, 2024
d651d09
Merge branch 'main' into vertical-tabs
kingtraceyj Jun 14, 2024
4a95572
updated variant image and caption to include vertical tabs
kingtraceyj Jun 14, 2024
4b2a9b5
updated hover image to include rules
kingtraceyj Jun 14, 2024
0bed13b
updating anatomy, fixing typos
kingtraceyj Jun 17, 2024
eace048
took out v11 inline notification
kingtraceyj Jun 17, 2024
c6ce941
add styles images back in
kingtraceyj Jun 17, 2024
3e81632
fix border typo in style table
kingtraceyj Jun 17, 2024
47b946f
Merge branch 'main' into vertical-tabs
kingtraceyj Jun 17, 2024
53ac7cd
update typo
kingtraceyj Jun 25, 2024
40359d4
Update src/pages/components/tabs/style.mdx
kingtraceyj Jun 25, 2024
3df47ca
Update src/pages/components/tabs/usage.mdx
kingtraceyj Jun 25, 2024
0834df8
Update src/pages/components/tabs/usage.mdx
kingtraceyj Jun 25, 2024
18125bf
Update src/pages/components/tabs/usage.mdx
kingtraceyj Jun 25, 2024
a9a91a4
Update src/pages/components/tabs/usage.mdx
kingtraceyj Jun 25, 2024
a397f9c
updated image and typo
kingtraceyj Jun 25, 2024
6a092f0
chore: merge conflicts
alisonjoseph Jul 8, 2024
b9dfb61
chore: format
alisonjoseph Jul 8, 2024
05b0747
Merge branch 'main' into vertical-tabs
alisonjoseph Jul 8, 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.
Binary file modified src/pages/components/tabs/images/tab-style-4.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 src/pages/components/tabs/images/tab-style-5.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 src/pages/components/tabs/images/tab-usage-10.png
kingtraceyj marked this conversation as resolved.
Show resolved Hide resolved
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.
kingtraceyj marked this conversation as resolved.
Show resolved Hide resolved
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 src/pages/components/tabs/images/tab-usage-3.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 src/pages/components/tabs/images/tab-usage-4.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 src/pages/components/tabs/images/tab-usage-5.png
kingtraceyj marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 104 additions & 19 deletions src/pages/components/tabs/style.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,18 @@ structure, and size.

### Contained tab color

| Type | Element | Property | Color token |
| ---------- | ------- | ---------------- | --------------------- |
| Unselected | Tab | background-color | `$layer-accent` \* |
| | | border-right | `$border-strong` \* |
| | Label | text-color | `$text-secondary` |
| | Icon | svg | `$icon-secondary` |
| Selected | Tab | background-color | `$layer` \* |
| | | border-top | `$border-interactive` |
| | Label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |
| Type | Element | Property | Color token |
| ---------- | --------------- | ---------------- | --------------------- |
| Unselected | Tab | background-color | `$layer-accent` \* |
| | | border-right | `$border-strong` \* |
| | Label | text-color | `$text-secondary` |
| | Secondary label | text-color | `$text-secondary` |
| | Icon | svg | `$icon-secondary` |
| Selected | Tab | background-color | `$layer` \* |
| | | border-top | `$border-interactive` |
| | Label | text-color | `$text-primary` |
| | Secondary label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |

<Caption>
* Denotes a contextual color token that will change values based on the layer
Expand All @@ -216,15 +218,17 @@ structure, and size.

<br />

| State | Element | Property | Color token |
| -------- | ------- | ---------------- | ------------------------- |
| Hover | Tab | background-color | `$layer-accent-hover` \* |
| | Label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |
| Focus | Tab | border | `$focus` |
| Disabled | Label | text-color | `$text-on-color-disabled` |
| | Icon | svg | `$icon-on-color-disabled` |
| | Tab | background-color | `$button-disabled` |
| State | Element | Property | Color token |
| -------- | --------------- | ---------------- | ------------------------- |
| Hover | Tab | background-color | `$layer-accent-hover` \* |
| | Label | text-color | `$text-primary` |
| | Secondary label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |
| Focus | Tab | border | `$focus` |
| Disabled | Label | text-color | `$text-on-color-disabled` |
| | Secondary label | text-color | `$text-on-color-disabled` |
| | Icon | svg | `$icon-on-color-disabled` |
| | Tab | background-color | `$button-disabled` |

<Caption>
* Denotes a contextual color token that will change values based on the layer
Expand Down Expand Up @@ -359,6 +363,65 @@ tabs.](images/tab-style-12.png)
contained tabs.
</Caption>

### Vertical tab color

| Type | Element | Property | Color token |
| ---------- | ------------------- | ---------------------------------------- | ------------------------ |
| Unselected | Tab | background-color | `$layer` \* |
| | | border-bottom, border-right, border-left | `$border-subtle` \* |
| | Label | text-color | `$text-secondary` |
| | Extended background | background-color | `$layer` \* |
| | | border-right | `$border-subtle` \* |
| Selected | Tab | background-color | `$layer` \* |
| | | border-bottom | `$border-subtle` \* |
| | | border-left | `$border-interactive` \* |
Copy link
Member

Choose a reason for hiding this comment

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

double checking but I don't think border-subtle is contextual so it doesn't have \ *

Copy link
Member Author

Choose a reason for hiding this comment

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

@thyhmdo i think border styles do have layer tokens looking at components like dropdown or progress indicator

| | Label | text-color | `$text-primary` |
| tab panel | background | background-color | `$layer` \* |

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

<Row>
<Column colLg={8}>

![Examples of selected and unselected vertical tabs.](images/tab-style-20.png)

</Column>
</Row>

<Caption>Examples of selected and unselected vertical tabs.</Caption>

#### Vertical tab interactive state color

<br />

| State | Element | Property | Color token |
| -------- | ----------------- | ---------------- | ------------------------- |
| Hover | Label | text-color | `$text-primary` |
| | Tab | background-color | `$layer-hover` \* |
| Focus | Tab: unselected | border | `$focus` |
| | Label: unselected | text-color | `$text-secondary` |
| | Tab: selected | border | `$focus` |
| | Label: selected | text-color | `$text-primary` |
| Disabled | Label | text-color | `$text-on-color-disabled` |

<Row>
<Column colLg={8}>

![Examples of hover, unselected focus, selected focus, and disabled states for vertical tabs.](images/tab-style-21.png)

</Column>
</Row>

<Caption>
Examples of hover, unselected focus, selected focus, and disabled states for
vertical tabs.
</Caption>

<br />

## Typography

Tab labels should be set in sentence case, and should not exceed three words.
Expand All @@ -367,6 +430,7 @@ Tab labels should be set in sentence case, and should not exceed three words.
| ----------------- | ------------------ | -------------- | --------------------- |
| Label: unselected | 14 / 0.875 | Regular / 400 | `$body-compact-01` |
| Label: selected | 14 / 0.875 | SemiBold / 600 | `$heading-compact-01` |
| Secondary label | 12 / 0.75 | Regular / 400 | `$label-01` |

## Structure

Expand Down Expand Up @@ -518,6 +582,27 @@ Tab labels should be set in sentence case, and should not exceed three words.
icons (top) and with icons (bottom)| px / rem
</Caption>

### Verical tab structure

| Element | Property | px / rem | Spacing token |
| ------------------- | --------------------------- | -------- | ------------- |
| Tab | height | 64 / 4 | – |
| | border-left | 3 px | – |
| Tab: unselected | border-bottom, border-right | 1 px | – |
| Tab: selected | border-bottom | 1 px | – |
| Label | padding-left, padding-right | 16 / 1 | `$spacing-05` |
| Extended background | border-right | 1 px | – |

<div className="image--fixed">

![Structure and spacing measurements for vertical tabs in px and rem](images/tab-style-22.png)

</div>

<Caption>
Structure and spacing measurements for vertical tabs | px / rem
kingtraceyj marked this conversation as resolved.
Show resolved Hide resolved
</Caption>

## Feedback

Help us improve this component by providing feedback, asking questions, and
Expand Down
Loading
Loading