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: Adding dismissible docs #3581

Merged
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b598414
docs: Adding dismissible docs
kingtraceyj Jun 6, 2023
e7c3d6e
docs: add dismissible images
kingtraceyj Jun 6, 2023
630badc
docs: update image names
kingtraceyj Jun 6, 2023
19a139e
Merge branch 'main' into dismissible-tabs-docs
kingtraceyj Jun 6, 2023
7bce3df
docs: dismissible color and structure sections
kingtraceyj Jun 7, 2023
2c785ba
docs: updated style images
kingtraceyj Jun 7, 2023
c0ba31f
Merge branch 'main' into dismissible-tabs-docs
alisonjoseph Jun 7, 2023
7e511c3
docs: updated caption formatting
kingtraceyj Jun 7, 2023
0b709a5
docs: removed a br
kingtraceyj Jun 7, 2023
849e1c0
chore(mdx): fix formatting
tw15egan Jun 8, 2023
e621924
Update src/pages/components/tabs/style.mdx
kingtraceyj Jun 12, 2023
a7a5e28
Update src/pages/components/tabs/usage.mdx
kingtraceyj Jun 12, 2023
4eeac61
Update src/pages/components/tabs/usage.mdx
kingtraceyj Jun 12, 2023
6fa31a0
Update src/pages/components/tabs/usage.mdx
kingtraceyj Jun 12, 2023
44d03a4
Merge branch 'main' into dismissible-tabs-docs
kingtraceyj Jun 12, 2023
a837e32
Merge branch 'main' into dismissible-tabs-docs
kingtraceyj Jun 13, 2023
b153498
Merge branch 'dismissible-tabs-docs' of https://github.com/kingtracey…
kingtraceyj Jun 13, 2023
dd36365
docs: update titles and images
kingtraceyj Jun 13, 2023
347ebb8
docs: removed a few anchor links
kingtraceyj Jun 13, 2023
8385ee8
docs: updated image caption
kingtraceyj Jun 14, 2023
b1badc3
Merge branch 'main' into dismissible-tabs-docs
kingtraceyj Jun 28, 2023
56bc09b
Merge branch 'main' into dismissible-tabs-docs
kingtraceyj Jun 29, 2023
cdb4daa
Merge branch 'dismissible-tabs-docs' of https://github.com/kingtracey…
kingtraceyj Jun 29, 2023
b31e117
updated dismissible image
kingtraceyj Jun 29, 2023
685f6af
fix: format
francinelucca Jun 29, 2023
46603b7
Merge branch 'main' into dismissible-tabs-docs
kingtraceyj Jul 5, 2023
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.
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.
251 changes: 238 additions & 13 deletions src/pages/components/tabs/style.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,23 @@ description:
tabs: ['Usage', 'Style', 'Code', 'Accessibility']
---

<PageDescription>

The following page documents visual specifications such as color, typography,
structure, and size.

</PageDescription>

<AnchorLinks>

<AnchorLink>Color</AnchorLink> <AnchorLink>Typography</AnchorLink>
<AnchorLink>Structure</AnchorLink>

</AnchorLinks>

## Color

### Line tabs
### Line tab color

| Type | Element | Property | Color token |
| ---------- | ------- | ---------------- | --------------------- |
Expand All @@ -25,11 +39,13 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']

</div>

<Caption>Example of selected and unselected line tabs.</Caption>
<Caption>
Example of selected and unselected line tabs.
</Caption>

<br />

#### Interactive states
#### Line tab interactive state color

<br />

Expand Down Expand Up @@ -58,7 +74,7 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']

<br />

#### Scrollable states
#### Line tab scrollable states

<br />

Expand All @@ -82,7 +98,73 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']
tabs.
</Caption>

### Contained tabs
### Dismissible line tab color

| Type | Element | Property | Color token |
| ---------- | ------- | ---------------- | --------------------- |
| Unselected | Tab | background-color | transparent |
| | | border-bottom | `$border-subtle` \* |
| | Label | text-color | `$text-secondary` |
| | Icon | svg | `$icon-secondary` |
| Selected | Label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |
| | Tab | border-bottom | `$border-interactive` |

<div className="image--fixed">

![Example of selected and unselected dismissible line tabs](images/tab-style-9.png)

</div>

<Caption>
Example of selected and unselected dismissible line tabs.
</Caption>

<br />

#### Dismissible line tab interactive state

<br />

| State | Element | Property | Color token |
| -------- | --------------- | ---------------- | ------------------ |
| Hover | Label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |
| | | background-color | `$background-hover` |
| | Tab | border-bottom | `$border-strong` |
| Focus | Tab: unselected | border | `$focus` |
| | Tab: selected | border | `$focus` |
| Disabled | Label | text-color | `$text-disabled` |
| | Icon | svg | `$icon-disabled` |
| | Tab | background-color | transparent |
| | | border-bottom | `$border-disabled` |

<Row>
<Column colLg={8}>

![Examples of unselected close hover, unselected hover, unselected focus, and disabled states for dismissible line tabs](images/tab-style-11a.png)

</Column>
</Row>

<Caption>
Examples of unselected close hover, unselected hover, unselected focus, and disabled states for
dismissible line tabs.
</Caption>

tw15egan marked this conversation as resolved.
Show resolved Hide resolved
<Row>
<Column colLg={8}>

![Examples of selected close hover, selected focus, and disabled states for dismissible line tabs](images/tab-style-11b.png)

</Column>
</Row>

<Caption>
Examples of selected close hover, selected focus, and disabled states for dismissible line tabs.
</Caption>

### Contained tab color

| Type | Element | Property | Color token |
| ---------- | ------- | ---------------- | --------------------- |
Expand All @@ -106,11 +188,13 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']

</div>

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

<br />

#### Interactive states
#### Contained tab interactive state color

<br />

Expand Down Expand Up @@ -143,7 +227,7 @@ tabs.](images/tab-style-5.png)

<br />

#### Scrollable states
#### Dismissible contained tab scrollable states

<br />

Expand All @@ -167,6 +251,87 @@ tabs.](images/tab-style-5.png)
tabs.
</Caption>

### Dismissible 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` |
| | Dismissible icon | svg | `$icon-secondary` |
| Selected | Tab | background-color | `$layer` \* |
| | | border-top | `$border-interactive` |
| | Label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |
| | Dismissible icon | svg | `$icon-primary` |

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

<div className="image--fixed">

![Examples of selected and unselected dismissible contained tabs](images/tab-style-10.png)

</div>

<Caption>
Examples of selected and unselected dismissible contained tabs.
</Caption>

<br />

#### Dismissible tab interactive state color

<br />

| State | Element | Property | Color token |
| -------- | ------- | ---------------- | ------------------------ |
| Hover | Tab | background-color | `$layer-accent-hover` \* |
| | Label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |
| | Dismissible icon | svg | `$icon-primary` |
| | Selected: dismissible icon | background-color | `$layer-hover` \* |
| | Unselected: dismissible icon | background-color | `$layer-accent-hover` \* |
| Focus | Tab | border | `$focus` |
| Disabled | Label | text-color | `$text-disabled` |
| | Icon | svg | `$icon-disabled` |
| | Tab | background-color | `$button-disabled` |
| | | border-right | `$border-disabled` |

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

<Row>
<Column colLg={8}>

![Unselected hover, unselected close hover, unselected focus, and disabled states for dismissible contained
tabs.](images/tab-style-12a.png)

</Column>
</Row>

<Caption>
Examples of unselected hover, unselected close hover, unselected focus, and disabled states for dismissible contained tabs.
</Caption>

<Row>
<Column colLg={8}>

![Selected close hover, selected focus, and disabled states for dismissible contained
tabs.](images/tab-style-12b.png)

</Column>
</Row>

<Caption>
Examples of selected close hover, selected focus, and disabled states for dismissible contained tabs.
</Caption>

## Typography

Tab labels should be set in sentence case, and should not exceed three words.
Expand All @@ -176,9 +341,11 @@ 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` |



## Structure

### Line tabs
### Line tab structure

| Element | Property | px / rem | Spacing token |
| --------------- | --------------------------- | ---------- | ------------- |
Expand All @@ -199,11 +366,13 @@ Tab labels should be set in sentence case, and should not exceed three words.

</div>

<Caption>Structure and spacing measurements for line tabs | px / rem</Caption>
<Caption>
Structure and spacing measurements for line tabs | px / rem
</Caption>

<br />

#### Icon-only modifier
#### Line tab icon-only modifier

<br />

Expand All @@ -224,7 +393,37 @@ Tab labels should be set in sentence case, and should not exceed three words.
Structure and spacing measurements for icon-only line tabs | px / rem
</Caption>

### Contained tabs
### Dismissible line tab structure

| Element | Property | px / rem | Spacing token |
| --------------- | --------------------------- | ---------- | ------------- |
| Tab | height | 40 / 2.5 | – |
| | border-bottom | 2px | – |
| | width | auto-width | – |
| | margin-left | 1px | – |
| Label | padding-left, padding-right | 16 / 1 | `$spacing-05` |
| | padding-top, padding-bottom | 8 / 0.5 | `$spacing-03` |
| Dismissible icon | padding-right | 16 / 1 | `$spacing-05` |
| | padding-left | 8 / 0.5 | `$spacing-03` |
| | svg | 16 x 16 | – |
| Icon | padding-right | 8 / 0.5 | `$spacing-03` |
| | padding-left | 16 / 1 | `$spacing-05` |
| | svg | 16 x 16 | – |


<div className="image--fixed">

![Structure and spacing measurements for dismissible line tabs without icons (top) and with icons (bottom).](images/tab-style-13.png)

</div>

<Caption>
Structure and spacing measurements for line tabs without icons (top) and with icons (bottom) | px / rem
</Caption>

<br />

### Contained tab structure

| Element | Property | px / rem | Spacing token |
| ----------------- | --------------------------- | ---------------- | ------------- |
Expand All @@ -251,7 +450,7 @@ Tab labels should be set in sentence case, and should not exceed three words.

<br />

#### Icon-only modifier
#### Contained tab icon-only modifier

<br />

Expand All @@ -270,3 +469,29 @@ Tab labels should be set in sentence case, and should not exceed three words.
<Caption>
Structure and spacing measurements for icon-only contained tabs | px / rem
</Caption>

### Dismissible contained tab structure

| Element | Property | px / rem | Spacing token |
| ----------------- | --------------------------- | ---------------- | ------------- |
| Tab | height | 40 / 2.5 | – |
| | border-top | 2px | – |
| | width | auto-width, grid | – |
| Label | padding-left, padding-right | 16 / 1 | `$spacing-05` |
| Dismissible icon | padding-right | 16 / 1 | `$spacing-05` |
| | padding-left | 8 / .5 | `$spacing-03` |
| | svg | 16 x 16 | – |
| Icon | padding-right | 8 / .5 | `$spacing-03` |
| | padding-left | 16 / 1 | `$spacing-05` |
| | svg | 16 x 16 | – |
| Tab | border-right | 1px | – |

<div className="image--fixed">

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

</div>

<Caption>
Structure and spacing measurements for dismissible contained tabs without icons (top) and with icons (bottom)| px / rem
</Caption>
Loading
Loading