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(structured list) feature flag usage, style, code tab update #4258

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
535b00d
update usage.mdx
laurenmrice Sep 11, 2024
526f949
add tag
laurenmrice Sep 11, 2024
164e5c7
add tag
laurenmrice Sep 11, 2024
323543a
update style.mdx
laurenmrice Sep 11, 2024
0ba0c29
update tag code
laurenmrice Sep 11, 2024
84e62c3
update code.mdx
laurenmrice Sep 11, 2024
33dbf8c
remove tag
laurenmrice Sep 11, 2024
d7672ab
feat: add tags and latest gatsby theme
alisonjoseph Sep 12, 2024
1613e7c
chore: format
alisonjoseph Sep 12, 2024
aaf8efb
Merge branch 'main' into feature-flags-structured-list-doc-update
laurenmrice Sep 13, 2024
01729ad
update usage.mdx
laurenmrice Sep 13, 2024
6ece36b
update style.mdx
laurenmrice Sep 13, 2024
039ceae
update code.mdx
laurenmrice Sep 13, 2024
75e9e80
update fixes
laurenmrice Sep 19, 2024
7d09763
Merge branch 'main' into feature-flags-structured-list-doc-update
laurenmrice Sep 19, 2024
1c48899
format
laurenmrice Sep 19, 2024
89c6c3c
Merge branch 'feature-flags-structured-list-doc-update' of https://gi…
laurenmrice Sep 19, 2024
787cba1
update
laurenmrice Sep 20, 2024
e9c440c
Fixed a few links & packcage
Kritvi-bhatia17 Sep 30, 2024
a1e885d
link shortened
Kritvi-bhatia17 Oct 2, 2024
678e277
link shortened-2
Kritvi-bhatia17 Oct 2, 2024
36a9e45
chore: merge conflicts
alisonjoseph Oct 10, 2024
7988abd
Update src/pages/components/structured-list/style.mdx
laurenmrice Oct 10, 2024
638a540
update images and content from review
laurenmrice Oct 10, 2024
8c1ad7f
update typo
laurenmrice Oct 10, 2024
d328473
Merge branch 'main' into feature-flags-structured-list-doc-update
laurenmrice Oct 10, 2024
17f4151
update heading and image
laurenmrice Oct 10, 2024
5b00f36
Merge branch 'feature-flags-structured-list-doc-update' of https://gi…
laurenmrice Oct 10, 2024
ebf118c
fix image
laurenmrice Oct 10, 2024
cf9af39
Merge branch 'main' into feature-flags-structured-list-doc-update
kodiakhq[bot] Oct 11, 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
14 changes: 14 additions & 0 deletions src/pages/components/structured-list/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']
---

import { CheckmarkFilled } from '@carbon/icons-react';
import { Tag } from '@carbon/react';

<PageDescription>

Expand All @@ -25,6 +26,7 @@ code usage documentation, see the Storybooks for each framework below.
>

<MdxIcon name="react" />
<Tag type="blue">Feature flag</Tag>

</ResourceCard>
</Column>
Expand Down Expand Up @@ -60,6 +62,18 @@ code usage documentation, see the Storybooks for each framework below.
</Column>
</Row>

### Feature flags

A [feature flag](/components/overview/feature-flags/) has been added to the
selectable variant of structured list to improve accessibility and changes its
visual appearance, not its functionality. For more code-specific feature flag
information, refer to the
[@carbon/react](https://react.carbondesignsystem.com/?path=/docs/experimental-feature-flags-structuredlist--overview)
framework.

The `enable-v12-structured-list-visible-icons` flag enables icons within
structured list to always be visible, even when not selected.

## Live demo

<StorybookDemo
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
279 changes: 195 additions & 84 deletions src/pages/components/structured-list/style.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,86 @@ 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>
<AnchorLink>Size</AnchorLink>
<AnchorLink>Feedback</AnchorLink>

</AnchorLinks>

## Color

By default, structured lists have a transparent background layer. Optionally,
you can apply a colored background layer to a structured list. Structured lists
with a colored background layer are only available in the hang alignment.

| Element | Property | Color token |
| -------------------- | ---------------- | ------------------- |
| Header text | text-color | `$text-primary` |
| Header row divider | border-bottom | `$border-subtle` \* |
| Header (transparent) | background-color | transparent |
| Header (background) | background-color | `$layer` \* |
| Row text | text-color | `$text-secondary` |
| Row divider | border-bottom | `$border-subtle` \* |
| Row (transparent) | background-color | transparent |
| Row (background) | background-color | `$layer` \* |
| Icon | icon-color | `$icon-primary` |
Structured lists have a transparent background layer. Optionally, you can apply
a background color to a structured list. Structured lists with a background
color are only available in the hang alignment.

### Default color

| Element | Property | Color token |
| ------------ | ---------------- | ------------------- |
| Header | background-color | transparent |
| Header: text | text color | `$text-primary` |
| Row | background-color | transparent |
| Row: text | text color | `$text-secondary` |
| Divider | border-bottom | `$border-subtle` \* |

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

<Row>
<Column colLg={12}>

![Default structured list color](images/structured-list-style-color-default-transparent.png)

<Caption>Default structured list color</Caption>

</Column>
</Row>

### Selectable color

Selectable structured list has an available
[feature flag](/components/overview/feature-flags/).

| Element | Property | Color token |
| ------------ | ---------------- | ------------------- |
| Header | background-color | transparent |
| Header: text | text color | `$text-primary` |
| Row | background-color | transparent |
| Row: text | text color | `$text-secondary` |
| Divider | border-bottom | `$border-subtle` \* |
| Icon | svg | `$icon-primary` |

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

<Row>
<Column colLg={12}>
<Tabs>

<Tab label="Transparent">
<Tab label="Flag enabled">

![Color of the interactive structured list](images/structured-list-style-1.png)
![Selectable structured list color with the feature flag enabled](images/structured-list-style-color-selectable-flag-enabled.png)

</Tab>

<Tab label="Background">
<Tab label="Flag disabled">

![Color of the interactive structured list](images/structured-list-style-2.png)
![Selectable structured list color with the feature flag disabled](images/structured-list-style-color-selectable-flag-disabled.png)

</Tab>

Expand All @@ -50,51 +94,101 @@ with a colored background layer are only available in the hang alignment.
</Column>
</Row>

### Interactive states

The structured list interactive states are shown below with its default
transparent background layer and its optional color background layer.

| State | Element | Proptery | Color token |
| ------------------- | ----------------- | ---------------- | -------------------------- |
| Enabled (selected) | Row | background-color | `$layer-selected` \* |
| | Row text | text-color | `$text-primary` |
| Hover | Row | background-color | `$layer-hover` \* |
| | Row text | text-color | `$text-primary` |
| Hover (selected) | Row | background-color | `$layer-selected-hover` \* |
| | Row text | text-color | `$text-primary` |
| Focus | Row (transparent) | background-color | transparent |
| | Row (background) | background-color | `$layer` \* |
| | Border | border | `$focus` |
| Focus (selected) | Row | background-color | `$layer-selected` \* |
| | Row text | text-color | `$text-primary` |
| | Border | border | `$focus` |
| Disabled | Row (transparent) | background-color | transparent |
| | Row (background) | background-color | `$layer` \* |
| | Row text | text-color | `$text-disabled` |
| | Icon | inner fill | `$icon-disabled` |
| Disabled (selected) | Row | background-color | `$layer-selected` \* |
| | Row text | text-color | `$text-disabled` |
| | Icon | inner fill | `$icon-disabled` |
<Title>Selectable interactive state color</Title>{' '}

| State | Element | Property | Color token |
| ------------------- | --------- | ---------------- | -------------------------- |
| Enabled (selected) | Row | background-color | `$layer-selected` \* |
| | Row: text | text color | `$text-primary` |
| Hover | Row | background-color | `$layer-hover` \* |
| | Row: text | text color | `$text-primary` |
| Hover (selected) | Row | background-color | `$layer-selected-hover` \* |
| | Row: text | text color | `$text-primary` |
| Focus | Row | border | `$focus` |
| Focus (selected) | Row | background-color | `$layer-selected` \* |
| | Row: text | text color | `$text-primary` |
| | Border | border | `$focus` |
| Disabled |
| | Row: text | text color | `$text-disabled` |
| | Icon | svg | `$icon-disabled` |
| Disabled (selected) | Row | background-color | `$layer-selected` \* |
| | Row: text | text color | `$text-disabled` |
| | Icon | svg | `$icon-disabled` |

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

<Row>
<Column colLg={12}>
<Tabs>

<Tab label="Transparent">
<Tab label="Flag enabled">

![State of the interactive structured list](images/structured-list-style-3.png)
![Selectable structured list interactive states with the feature flag enabled](images/structured-list-style-interactive-color-selectable-flag-enabled.png)

</Tab>

<Tab label="Background">
<Tab label="Flag disabled">

![State of the interactive structured list](images/structured-list-style-4.png)
![Selectable structured list interactive states with the feature flag disabled](images/structured-list-style-interactive-color-selectable-flag-disabled.png)

</Tab>

</Tabs>

</Column>
</Row>

### With background color

| Element | Property | Color token |
| ------- | ---------------- | ----------- |
| Header | background-color | `$layer` \* |
| Row | 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={12}>
<Tabs>

<Tab label="Flag enabled">

![Selectable structured list color with the feature flag enabled](images/structured-list-style-color-selectable-background-flag-enabled.png)

</Tab>

<Tab label="Flag disabled">

![Selectable structured list color with the feature flag disabled](images/structured-list-style-color-selectable-background-flag-disabled.png)

</Tab>

</Tabs>

</Column>
</Row>

<Title>With background interactive state color</Title>

<Row>
<Column colLg={12}>
<Tabs>

<Tab label="Flag enabled">

![Selectable structured list interactive states with the feature flag enabled](images/structured-list-style-interactive-color-selectable-background-flag-enabled.png)

</Tab>

<Tab label="Flag disabled">

![Selectable structured list interactive states with the feature flag disabled](images/structured-list-style-interactive-color-selectable-background-flag-disabled.png)

</Tab>

Expand All @@ -105,37 +199,35 @@ transparent background layer and its optional color background layer.

## Typography

Structured list headings should be set in title case, while all other text is
set in sentence case. All typography is left aligned.
Structured list header and row text should use sentence-case capitalization. All
typography is left aligned.

| Element | px / rem | Font-weight | Type token |
| --------- | ---------- | -------------- | --------------------- |
| Heading | 14 / 0.875 | SemiBold / 600 | `$heading-compact-01` |
| List text | 14 / 0.875 | Regular / 400 | `$body-01` |
| Element | Font-size (px/rem) | Font-weight | Type token |
| ----------- | ------------------ | -------------- | --------------------- |
| Header text | 14 / 0.875 | SemiBold / 600 | `$heading-compact-01` |
| Row text | 14 / 0.875 | Regular / 400 | `$body-01` |

## Structure

| Element | Property | px / rem | Spacing token |
| --------------- | --------------------------- | ----------- | ------------- |
| Structured list | min-width | 500 / 31.25 | – |
| Header | padding-top | 16 / 1 | `$spacing-05` |
| | padding-bottom | 8 / 0.5 | `$spacing-03` |
| | padding-right | 16 / 1 | `$spacing-05` |
| | padding-left (hang) | 16 / 1 | `$spacing-05` |
| | padding-left (flush) | 0 | – |
| Row text | padding-top | 16 / 1 | `$spacing-05` |
| | padding-bottom | 24 / 1.5 | `$spacing-06` |
| | padding-right | 16 / 1 | `$spacing-05` |
| | padding-left (hang) | 16 / 1 | `$spacing-05` |
| | padding-left (flush) | 0 | – |
| Icon | height, width | 16px | – |
| | padding-left, padding-right | 16 / 1 | `$spacing-05` |

### Default structure

| Element | Property | px / rem | Spacing token |
| ------------ | -------------------- | ----------- | ------------- |
| Container | min-width | 500 / 31.25 | – |
| Header: text | padding-top | 16 / 1 | `$spacing-05` |
| | padding-bottom | 8 / 0.5 | `$spacing-03` |
| | padding-right | 16 / 1 | `$spacing-05` |
| | padding-left (hang) | 16 / 1 | `$spacing-05` |
| | padding-left (flush) | 0px | – |
| Row: text | padding-top | 16 / 1 | `$spacing-05` |
| | padding-bottom | 24 / 1.5 | `$spacing-06` |
| | padding-right | 16 / 1 | `$spacing-05` |
| | padding-left (hang) | 16 / 1 | `$spacing-05` |
| | padding-left (flush) | 0px | – |

<div className="image--fixed">

![Spacing and measurements for default structured list](images/structured-list-style-5.png)
![Spacing and measurements for default structured list with hang and flush alignment | px / rem. ](images/structured-list-style-structure.png)

</div>

Expand All @@ -146,30 +238,49 @@ set in sentence case. All typography is left aligned.

### Selectable structure

| Element | Property | px / rem | Spacing token |
| ------------ | --------------------------- | ----------- | ------------- |
| Container | min-width | 500 / 31.25 | – |
| Header: text | padding-top | 16 / 1 | `$spacing-05` |
| | padding-bottom | 8 / 0.5 | `$spacing-03` |
| | padding-right | 16 / 1 | `$spacing-05` |
| | padding-left, padding-right | 16 / 1 | `$spacing-05` |
| Row: text | padding-top | 16 / 1 | `$spacing-05` |
| | padding-bottom | 24 / 1.5 | `$spacing-06` |
| | padding-left, padding-right | 16 / 1 | `$spacing-05` |
| Icon | height, width | 16px | – |
| | padding-left, padding-right | 16 / 1 | `$spacing-05` |

<div className="image--fixed">

![Spacing and measurements for selectable structured list](images/structured-list-style-6.png)
![Structure and spacing measurements for selectable structured list with a feature flag | px / rem.](images/structured-list-style-structure-selectable-flag-enabled.png)

</div>

<Caption>
Spacing and measurements for selectable structured list with hang alignment |
px / rem.
Structure and spacing measurements for selectable structured list with a
feature flag | px / rem.
</Caption>

## Size

There are two structured list sizes: default and condensed.
There are two structured list height sizes: **default** and **condensed**.

| Element | Size | px / rem |
| -------- | --------- | --------- |
| Row item | Default | 60 / 3.75 |
| | Condensed | 36 / 2.25 |
| Element | Size | Height (px/rem) |
| ------- | --------- | --------------- |
| Row | Default | 60 / 3.75 |
| | Condensed | 36 / 2.25 |

<div className="image--fixed">

![Sizes of structured list with selection](images/structured-list-style-7.png)
![Structured list sizes | px / rem](images/structured-list-style-size.png)

</div>

<Caption>Default and condensed sizes for structured lists</Caption>
<Caption> Structured list sizes | px / rem </Caption>

## Feedback

Help us improve this component by providing feedback, asking questions, and
leaving any other comments on
[GitHub](https://github.com/carbon-design-system/carbon-website/issues/new?assignees=&labels=feedback&template=feedback.md).
Loading
Loading