Skip to content

Input: Update Content Before and After Stories, Labels on Stories#22731

Merged
spmonahan merged 3 commits intomicrosoft:masterfrom
spmonahan:input/content-before-and-after
May 2, 2022
Merged

Input: Update Content Before and After Stories, Labels on Stories#22731
spmonahan merged 3 commits intomicrosoft:masterfrom
spmonahan:input/content-before-and-after

Conversation

@spmonahan
Copy link
Contributor

Current Behavior

  • Input's contentBefore and contentAfter stories did not show how to use these slots in an accessible manner.
  • Placeholder story lacked a visual label, but did have aria-label set.

New Behavior

  • Input's contentBefore and contentAfter demonstrate simple examples of how to use these slots accessibly.
  • Placeholder story has a visual label.
  • Labels used in stories have been received minor copy updates

Related Issue(s)

Fixes #21450

borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,
},
// DO NOT add a space between the selectors! It changes the behavior of make-styles.
':active,:focus-within': {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: there is a bug in the version of Griffel currently used in this package that will apply this :focus-within style to buttons used in the contentBefore and contentAfter slots. The PR that fixes is already merged, just need to have a new version published and the dependency updated here.

@spmonahan spmonahan requested review from a team April 29, 2022 20:47
@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 29, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2a4009d:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

Updates the contentBefore and contentAfter stories to demonstrate these
slots in an accessible way. These types of scenarios quickly become
quite nuanced so the examples were chosen to be as simple as possible
from an accessibility lens while still being correct and while
demonstrating the feature.
@spmonahan spmonahan force-pushed the input/content-before-and-after branch from 217305f to 1b3726e Compare April 30, 2022 00:19
@fabricteam
Copy link
Collaborator

fabricteam commented Apr 30, 2022

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-spinbutton
SpinButton
41.955 kB
11.856 kB
🤖 This report was generated against 55e2b1b53e81efa510a5bc15c6ab0398b52ace7f

@size-auditor
Copy link

size-auditor bot commented Apr 30, 2022

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 55e2b1b53e81efa510a5bc15c6ab0398b52ace7f (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 30, 2022

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 909 929 5000
Button mount 563 549 5000
FluentProvider mount 1852 1884 5000
FluentProviderWithTheme mount 299 299 10
FluentProviderWithTheme virtual-rerender 240 247 10
FluentProviderWithTheme virtual-rerender-with-unmount 296 318 10
MakeStyles mount 1567 1586 50000


export const Placeholder = () => {
return <Input placeholder="input with placeholder" aria-label="input with placeholder" />;
const placeholderId = useId('input-placeholder');
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Calling this the placeholderId makes it seem like placeholders need IDs. Consider inputId?

...shorthands.borderColor(tokens.colorNeutralStroke1Hover),
borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,
},
// DO NOT add a space between the selectors! It changes the behavior of make-styles.
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 no longer true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! Fix incoming.

@spmonahan spmonahan merged commit 45d7e18 into microsoft:master May 2, 2022
marwan38 pushed a commit to marwan38/fluentui that referenced this pull request Jun 13, 2022
…crosoft#22731)

* react-input: update content before/after stories

Updates the contentBefore and contentAfter stories to demonstrate these
slots in an accessible way. These types of scenarios quickly become
quite nuanced so the examples were chosen to be as simple as possible
from an accessibility lens while still being correct and while
demonstrating the feature.

* react-input: update story labels

* react-input: minor change from PR feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Input: add better example for accessible contentBefore/contentAfter

5 participants