-
Notifications
You must be signed in to change notification settings - Fork 18
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 steps component #696
Add steps component #696
Changes from all commits
9c61ec8
25297a6
c8417a4
5115809
ddc91c6
430a6ef
2cc4d51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@microsoft/atlas-site': minor | ||
'@microsoft/atlas-css': minor | ||
--- | ||
|
||
Add steps component and documentation |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
$step-font-size: $font-size-7 !default; | ||
$steps-gap: 0.4375em !default; | ||
$steps-size: 0.5em !default; | ||
|
||
.steps { | ||
display: flex; | ||
gap: $steps-gap; | ||
flex-wrap: nowrap; | ||
font-size: $step-font-size; | ||
|
||
.step { | ||
height: $steps-size; | ||
aspect-ratio: 1 / 1; | ||
border-radius: $border-radius-rounded; | ||
background-color: $secondary; | ||
|
||
&.step-selected { | ||
aspect-ratio: 2 / 1; | ||
background-color: $primary; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
title: Steps | ||
description: The steps component in the Atlas Design System | ||
template: standard | ||
figmaEmbed: https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com/design/7raji0IWkuBRxs5kLiADgI/Copilot-Web-UI-kit?node-id=70108-9255&node-type=frame&t=G0FoPLEXPee1yysa-0 | ||
classType: Component | ||
classPrefixes: | ||
- steps | ||
BenDMyers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- step | ||
--- | ||
|
||
# Steps | ||
|
||
Used to indicate the user's location in a finite progression. These steps are not interactive. | ||
|
||
For example, as a user progresses through 5 items, you would see something like this: | ||
|
||
```html | ||
<p class="visually-hidden">Step 1 of 5</p> | ||
<div class="steps padding-xxs" aria-hidden="true"> | ||
<div class="step step-selected"></div> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
</div> | ||
<p class="visually-hidden">Step 2 of 5</p> | ||
<div class="steps padding-xxs" aria-hidden="true"> | ||
<div class="step"></div> | ||
<div class="step step-selected"></div> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
</div> | ||
<p class="visually-hidden">Step 3 of 5</p> | ||
<div class="steps padding-xxs" aria-hidden="true"> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
<div class="step step-selected"></div> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
</div> | ||
<p class="visually-hidden">Step 4 of 5</p> | ||
<div class="steps padding-xxs" aria-hidden="true"> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
<div class="step step-selected"></div> | ||
<div class="step"></div> | ||
</div> | ||
<p class="visually-hidden">Step 5 of 5</p> | ||
<div class="steps padding-xxs" aria-hidden="true"> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
<div class="step"></div> | ||
<div class="step step-selected"></div> | ||
</div> | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm thinking that that our examples need to be paired with some element containing the description of the current state of the steps: such as Then I think we could add something like at the bottom. But we should also have the main example contain the accessible markup too. ## Accessibility concerns
Although the step component is not interactive, it is also not entirely presentational. Thus, it's recommended that you put `aria-hidden` on the component, while including a `aria-hidden` element that communicates the current state of the user's progress through the steps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit to @wibjorn's suggestion, this should be -while including a `aria-hidden` element that communicates the current state of the user's progress through the steps.
+while including a `visually-hidden` element that communicates the current state of the user's progress through the steps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. like the nit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since I was exactly wrong :D |
||
|
||
## Accessibility concerns | ||
|
||
Although the step component is not interactive, it is also not entirely presentational. Thus, it's recommended that you put `aria-hidden` on the component, while including a `visually-hidden` element that communicates the current state of the user's progress through the steps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about something like
step-current
instead to indicate current progress? Feel free to resolve if you don't see a difference.