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

feat: add progress indicator styles #4019

Merged

Conversation

hanstirtaputra
Copy link
Contributor

Problem

Add focus and hover styles for progress indicator, as well as aria-labels.

Closes #3977

Solution

Breaking Changes

  • No - this PR is backwards compatible

Before & After Screenshots

Changes can be viewed on Rollout Announcement storybook

Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

a11y still seems a little off, may want to check out other examples of adding accessibility to progress indicators such as https://www.lightningdesignsystem.com/components/progress-indicator/

(can also test yourself by pressing cmd+F5 to toggle voiceover, mac's screen reader)

? undefined
: {
backgroundColor: 'secondary.300',
boxShadow: `0 0 0 1px ${getColor(theme, 'secondary.400')}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of function call, we can use css variables:

boxShadow: '0 0 0 1px var(--chakra-colors-secondary-400)'

read more about the ones chakra generates app-wide here: https://chakra-ui.com/docs/styled-system/features/css-variables

@@ -51,7 +71,7 @@ export const ProgressIndicator = ({
)

const animationProps = useMemo(() => {
return { x: currActiveIdx.toString() + 'rem' }
return { x: (currActiveIdx + 0.125).toString() + 'rem' }
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can simplify with string templating (calls toString under the hood)

const animationProps = useMemo(() => {
    return { x: `${currActiveIdx + 0.125}rem` }
}, [currActiveIdx])

Comment on lines 16 to 17
position="absolute"
as="button"
Copy link
Contributor

Choose a reason for hiding this comment

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

this is creating an extra tabbable button in the component which i don't think is intended.

my screen reader (voiceover) is also announcing this button.

Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm

@hanstirtaputra hanstirtaputra merged commit 19259e7 into form-v2/develop Jun 22, 2022
@hanstirtaputra hanstirtaputra deleted the form-v2/feat/progress-indicator-styles branch June 22, 2022 10:37
@justynoh justynoh mentioned this pull request Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants