-
Notifications
You must be signed in to change notification settings - Fork 71
WIP Spinner Description #3361
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
base: main
Are you sure you want to change the base?
WIP Spinner Description #3361
Conversation
🦋 Changeset detectedLatest commit: e194c79 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Size Change: +413 B (+0.02%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for displaying description text alongside the Spinner component through new description and direction props, enabling both horizontal and vertical layouts. It also updates the loading-spinner-v5 codemod to preserve these props instead of removing them.
Key changes:
- Adds
description,direction,baseFontSize, andsvgPropsprops to theSpinnercomponent - Updates codemod transformation logic to keep
description/baseFontSizeprops and adddirectionbased on the olddisplayOptionvalue - Changes the Spinner's root element from
<svg>to<div>to accommodate the description text layout
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tools/codemods/src/codemods/loading-spinner-v5/transform.ts |
Refactored codemod to add direction prop and preserve description/baseFontSize props instead of removing them |
tools/codemods/src/codemods/loading-spinner-v5/tests/*.tsx |
Updated test fixtures to reflect the new codemod behavior |
packages/loading-indicator/src/Spinner/Spinner.types.ts |
Added SpinnerDirection enum and new props (description, direction, baseFontSize, svgProps) |
packages/loading-indicator/src/Spinner/Spinner.tsx |
Updated component to render a wrapper div with optional description text |
packages/loading-indicator/src/Spinner/Spinner.styles.ts |
Added getWrapperStyles function and gap calculation utilities for layout |
packages/loading-indicator/src/Spinner/constants.ts |
Added getHorizontalGap and getVerticalGap functions |
packages/loading-indicator/src/Spinner/Spinner.spec.tsx |
Added tests for description rendering and props pass-through |
packages/loading-indicator/src/testing/* |
Updated test utilities to return HTMLDivElement instead of SVGSVGElement |
.changeset/*.md |
Added changeset documentation for the changes |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
Coverage after merging at/spinner-description into main will be
Coverage Report for Changed Files
|
|||||||||||||||||||||||||||||||||||||
'@leafygreen-ui/loading-indicator': minor
Adds
descriptionanddirectionprops to theSpinnercomponent to support text rendering alongside the spinner.description: Optional text to display alongside the spinnerdirection: Controls the layout of the spinner and description (verticalorhorizontal)baseFontSize: Controls the font size of the description textsvgProps: Pass-through props for the SVG element'@lg-tools/codemods': minor
'@lg-tools/cli': minor
Updates
loading-spinner-v5codemod to convertdisplayOptionprop tosizeanddirectionprops. The codemod now keeps thedescriptionandbaseFontSizeprops instead of removing them.Note:
@leafygreen-ui/loading-indicatorversions 5.0.x will need to be deprecated on npmUpdated from #3219
(Compare solution against #3357)