Input: Update Content Before and After Stories, Labels on Stories#22731
Input: Update Content Before and After Stories, Labels on Stories#22731spmonahan merged 3 commits intomicrosoft:masterfrom
Conversation
| borderBottomColor: tokens.colorNeutralStrokeAccessibleHover, | ||
| }, | ||
| // DO NOT add a space between the selectors! It changes the behavior of make-styles. | ||
| ':active,:focus-within': { |
There was a problem hiding this comment.
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.
|
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:
|
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.
217305f to
1b3726e
Compare
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 55e2b1b53e81efa510a5bc15c6ab0398b52ace7f (build) |
Perf Analysis (
|
| 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'); |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Oops! Fix incoming.
…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
Current Behavior
contentBeforeandcontentAfterstories did not show how to use these slots in an accessible manner.aria-labelset.New Behavior
contentBeforeandcontentAfterdemonstrate simple examples of how to use these slots accessibly.Related Issue(s)
Fixes #21450