Skip to content

Conversation

@ross-pfahler
Copy link
Collaborator

Closes RSP-1570

✅ Pull Request Checklist:

  • Included link to corresponding Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Team:

@codecov
Copy link

codecov bot commented Mar 2, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@1a0e9e6). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #240   +/-   ##
=========================================
  Coverage          ?   70.57%           
=========================================
  Files             ?      206           
  Lines             ?     3973           
  Branches          ?      847           
=========================================
  Hits              ?     2804           
  Misses            ?      587           
  Partials          ?      582
Impacted Files Coverage Δ
...kages/@react-spectrum/progress/src/ProgressBar.tsx 100% <ø> (ø)

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@ross-pfahler
Copy link
Collaborator Author

Screen Shot 2020-03-02 at 9 07 34 AM

formatOptions also missing type information

@adobe-bot
Copy link

Build successful! 🎉

### Accessibility

Progress Bars are made accessible as per the ["progressbar" role in WAI-ARIA 1.1](https://www.w3.org/TR/wai-aria-1.1/#progressbar).
Depending on the visualization being used (ie depending on the `showValueLabel` prop), a `label`, `aria-label`, or `aria-labelledby` attribute are required.
Copy link
Contributor

@MidnightCoder06 MidnightCoder06 Mar 3, 2020

Choose a reason for hiding this comment

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

i.e. instead of ie

### Over background
[View guidelines](https://spectrum.adobe.com/page/bar-loader/#Over-background)

When a loader needs to be placed on top of a colored background, use the over background loader.
Copy link
Contributor

@MidnightCoder06 MidnightCoder06 Mar 3, 2020

Choose a reason for hiding this comment

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

Same as with the progress circle pull, I'm wondering should this be: ... use the overBackground loader variant.

```tsx example
<p><ProgressBar label="Loading…" /></p>
<p><ProgressBar label="Loading…" labelPosition="side" /></p>
<p><ProgressBar label="Loading…" showValueLabel={false} /></p>
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to include a value for all examples. They look strange if the value is 0 IMO.

When a loader needs to be placed on top of a colored background, use the over background loader.

```tsx example
<div style={{background: 'rgba(0,0,0,0.4)', padding: '10px'}}>
Copy link
Member

@devongovett devongovett Mar 3, 2020

Choose a reason for hiding this comment

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

We might want to use a color other than black. It looks strange in dark mode. Maybe use <View> with a spectrum color variable?

[View guidelines](https://spectrum.adobe.com/page/bar-loader/#Size)

```tsx example
<p><ProgressBar aria-label="Loading…" size="S" /></p>
Copy link
Member

Choose a reason for hiding this comment

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

We could maybe use a <Flex> container for these instead of <p> tags?

</div>
```

### Indeterminate
Copy link
Member

Choose a reason for hiding this comment

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

Should we include this under the value section above similar to Checkbox? @dannify

</div>
```

If using the over background variant, ensure the background offers enough contrast for the loader to be legible and meets color contrast guidelines.
Copy link
Member

Choose a reason for hiding this comment

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

We're a bit inconsistent between "loader" and "progress bar". "Loader" is the old term for it (design may still be using), so I think we should be consistent with "progress bar".


## Value

By default Progress Bars are controlled with the `value` prop representing current percentage (as an integer).
Copy link
Member

Choose a reason for hiding this comment

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

Might need some commas


### Accessibility

Progress Bars are made accessible as per the ["progressbar" role in WAI-ARIA 1.1](https://www.w3.org/TR/wai-aria-1.1/#progressbar).
Copy link
Member

Choose a reason for hiding this comment

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

Maybe not needed? We haven't linked to the spec in other docs pages... Definitely will from @react-aria docs.

To internationalize a Progress Bar, a localized string should be passed to the `label` prop, `aria-label` prop, or value of associated `aria-labelledby` element.

For RTL (right-to-left) languages, the layout of the bar loader is mirrored for both determinate and indeterminate options.
The placement of the percent sign differs depending on the locale.
Copy link
Member

Choose a reason for hiding this comment

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

Is this paragraph needed? It's really just an implementation detail, not something the user needs to know about. Not sure. @dannify

Copy link
Member

Choose a reason for hiding this comment

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

Remove this line.

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

LFDanLu
LFDanLu previously approved these changes Mar 3, 2020
Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

LGTM

To internationalize a Progress Bar, a localized string should be passed to the `label` prop, `aria-label` prop, or value of associated `aria-labelledby` element.

For RTL (right-to-left) languages, the layout of the bar loader is mirrored for both determinate and indeterminate options.
The placement of the percent sign differs depending on the locale.
Copy link
Member

Choose a reason for hiding this comment

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

Remove this line.

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

Copy link
Member

@ktabors ktabors left a comment

Choose a reason for hiding this comment

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

I noticed that the TypeScript interfaces aren't get Java doc style comments describing them or setting defaults like top for labelPosition.


## Value

Progress Bars are controlled with the `value` prop representing current percentage (as an integer).
Copy link
Member

Choose a reason for hiding this comment

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

I thought there was a slack chat where we decided the names in the docs to match the names in the code, so ProgressBar matches <ProgressBar />?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

im happy to do which ever, but we should prob be consistent since the existing packages that were merged (eg StatusLight) also do not do this. let me know which i should do and i'll convert!

<Flex flexDirection="column" maxWidth="250px">
<ProgressBar label="Loading…" marginBottom="25px" value={30} />
<ProgressBar label="Loading…" marginBottom="25px" labelPosition="side" value={30} />
<ProgressBar label="Loading…" showValueLabel={false} value={30} />
Copy link
Member

Choose a reason for hiding this comment

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

Would this last example be better without the label="Loading…"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

presumably it also sets aria-label, so i can either convert to that or leave it as is. lmk

Copy link
Member

Choose a reason for hiding this comment

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

the label is different from the valuelabel so either label or aria-label will be needed anyway.

@ross-pfahler
Copy link
Collaborator Author

I noticed that the TypeScript interfaces aren't get Java doc style comments describing them or setting defaults like top for labelPosition.

Yes, we have a follow up in RSP-1574

<ProgressBar label="Loading…" value={50} />
```

Use an indeterminate Progress Bars when progress is happening but the time or effort to completion can’t be determined.
Copy link
Contributor

Choose a reason for hiding this comment

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

bar should be singular

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@dannify dannify merged commit e003e89 into master Mar 5, 2020
@dannify dannify deleted the progress-bar-docs branch March 5, 2020 22:37
fezproof pushed a commit to fezproof/projects that referenced this pull request Aug 19, 2020
* * updating TableView documentation at https://react-spectrum.corp.adobe.com/components/TableView.
* for issues:
  adobe/react-spectrum#239
  adobe/react-spectrum#240

* Update TableView.mdx

added explanation for needing styling

* Update TableView.mdx

* missing `%` in TableView.styl
* changed heading to "Why doesn't my table render" instead of "Example source code" and moved code to bottom

* - added style height to div in StoryBook for stories/TableView.js, so deleted stories/TableView.styl
- updated TableView.mdx with simpler troubleshooting and links to examples

* Update TableView.mdx

* Removing link that contains contradictory documentation

If we need a simpler example, we can explore that in another PR
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.

8 participants