Skip to content
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

fix(loader-spinner): allow components label to extend longer than the svg wrapper #6710

Merged
merged 3 commits into from
May 9, 2024

Conversation

tomdavies73
Copy link
Contributor

@tomdavies73 tomdavies73 commented May 2, 2024

fix #6702

Proposed behaviour

All fixed widths on the component have been removed, making the component center upon rendering and also making the component much more responsive and flexible. The component's label can now exceed the length of the SVG wrapper above. Also, margin-top's are now applied to all sizes above extra-small to match designs, and text now aligns fully to the center.

Screenshot 2024-05-02 at 11 42 44

Screenshot 2024-05-02 at 11 43 01

Screenshot 2024-05-02 at 11 43 14

Current behaviour

Currently, the component's label and SVG wrapper both have a set width, which corresponds to each component's size. This is suitable for smaller labels such as "Loading...", "Saving..." etc. However, some designs require longer strings and shorter words in en-GB may be longer when translated.

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

Testing instructions

… svg wrapper

removes the fixed width on the components svg wrapper and label to ensure the component
centers when rendered. Due to these changes the components label can now extend longer
than the svg wrappers width. A varied margin-top is also now applied to the label on
all sizes above extra-small, to ensure there is a correct amount of space between the
label and svg wrapper. Finally, the labels text has also now been aligned to the center,
so if any text does wrap due to container constraints, it will center correctly

fix #6702
@tomdavies73 tomdavies73 self-assigned this May 2, 2024
@tomdavies73 tomdavies73 requested review from a team as code owners May 2, 2024 10:46
@tomdavies73 tomdavies73 marked this pull request as draft May 2, 2024 10:46
@nuria1110 nuria1110 self-requested a review May 3, 2024 10:01
@nuria1110 nuria1110 marked this pull request as ready for review May 3, 2024 13:29
@sianford sianford merged commit a2adccc into master May 9, 2024
21 checks passed
@sianford sianford deleted the FE-6539 branch May 9, 2024 10:01
@carbonci
Copy link
Collaborator

carbonci commented May 9, 2024

🎉 This PR is included in version 134.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Loader spinner - custom text should be one line and centered
6 participants