feat(react-label): [CAP] visual refresh – add optional icon slot#36270
Open
GianoglioEnrico wants to merge 4 commits into
Open
feat(react-label): [CAP] visual refresh – add optional icon slot#36270GianoglioEnrico wants to merge 4 commits into
icon slot#36270GianoglioEnrico wants to merge 4 commits into
Conversation
icon slot
📊 Bundle size reportUnchanged fixtures
|
|
Pull request demo site: URL |
| @@ -0,0 +1,7 @@ | |||
| { | |||
There was a problem hiding this comment.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png | 413 | Changed |
vr-tests-react-components/Positioning 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png | 124 | Changed |
vr-tests-react-components/ProgressBar converged 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png | 40 | Changed |
vr-tests-react-components/TagPicker 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png | 658 | Changed |
There were 1 duplicate changes discarded. Check the build logs for more information.
293d990 to
b717d18
Compare
b717d18 to
377a7c8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the v9 @fluentui/react-label component as part of the CAP visual refresh by adding an optional icon slot rendered before the label content, with corresponding styling, docs, Storybook coverage, API report updates, and a beachball change file.
Changes:
- Add an
iconslot toLabelstate/props and render it before the label children. - Add Griffel styles and a static classname for the
iconslot, plus root layout adjustment when an icon is present. - Add a Storybook story and update docs (Spec + Migration) and API report to reflect the new slot.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/react-components/react-label/stories/src/Label/LabelIcon.stories.tsx | Adds a Storybook example for the new icon slot. |
| packages/react-components/react-label/stories/src/Label/index.stories.tsx | Registers the new Icon story in the Label stories index. |
| packages/react-components/react-label/library/src/components/Label/useLabelStyles.styles.ts | Adds icon slot classnames and styling, plus root layout adjustment when icon is present. |
| packages/react-components/react-label/library/src/components/Label/useLabel.tsx | Wires icon into Label state via the slot system and components map. |
| packages/react-components/react-label/library/src/components/Label/renderLabel.tsx | Renders icon before label children and required indicator. |
| packages/react-components/react-label/library/src/components/Label/Label.types.ts | Adds the public icon slot to the Label slots typing. |
| packages/react-components/react-label/library/src/components/Label/Label.test.tsx | Updates conformance static classname test inputs to include the new slot. |
| packages/react-components/react-label/library/etc/react-label.api.md | Updates the API report to include the new icon slot. |
| packages/react-components/react-label/library/docs/Spec.md | Documents the icon slot usage and DOM structure. |
| packages/react-components/react-label/library/docs/MIGRATION.md | Updates migration table to indicate icon is now supported in v9. |
| change/@fluentui-react-label-0c145c1c-dd96-48f9-8d7f-3b351f94548d.json | Adds the required beachball change entry for the new public feature. |
Comment on lines
12
to
16
| 'has-static-classnames': [ | ||
| { | ||
| props: { required: 'Required Test' }, | ||
| props: { required: 'Required Test', icon: 'Icon Test' }, | ||
| }, | ||
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Overview
This PR is part of the CAP visual refresh effort. It adds an optional
iconslot rendered before the label content.