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

Add components to support skeleton loading states #4052

Merged
merged 43 commits into from
Jun 18, 2024
Merged

Add components to support skeleton loading states #4052

merged 43 commits into from
Jun 18, 2024

Conversation

mperrotti
Copy link
Contributor

@mperrotti mperrotti commented Dec 11, 2023

Relates to https://github.com/github/primer/issues/2682

Kapture.2023-12-11.at.17.02.20.mp4

Changelog

New

Adds the following components:

  • SkeletonBox - general-use skeleton loading component
  • SkeletonAvatar - used to replace avatars with a skeleton loading state
  • SkeletonText - used to replace text with a skeleton loading state

Changed

DataTable and TreeView use the new skeleton loading components instead of their ad-hoc skeleton loaders

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@mperrotti mperrotti requested review from a team and langermank December 11, 2023 22:07
Copy link

changeset-bot bot commented Dec 11, 2023

🦋 Changeset detected

Latest commit: 2f8d800

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@mperrotti mperrotti requested a review from pksjce December 11, 2023 22:07
Copy link
Contributor

github-actions bot commented Dec 11, 2023

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 90.32 KB (+0.67% 🔺)
packages/react/dist/browser.umd.js 90.6 KB (+0.76% 🔺)

export const BaseSkeletonBone = styled.div<BaseSkeletonBoneProps>`
animation: ${shimmer};
display: block;
background-color: var(--bgColor-muted, ${get('colors.canvas.subtle')});
Copy link
Contributor Author

@mperrotti mperrotti Dec 15, 2023

Choose a reason for hiding this comment

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

It's possible that somebody could render a skeleton loader on top of something with the bgColor-muted background color. This would make the loader invisible except for the "shimmer" animation.

Reviewers, how do you think we should reckon with this?

  1. Add a boolean prop to change the color of a skeleton loaders. Kind of like the contrast prop on TextInput.
  2. Add a component-specific color token that uses a color from the base gray scale with higher contrast.
  3. Keep this as-is until we identify a real use-case where this causes a problem.

@mperrotti mperrotti disabled auto-merge June 18, 2024 19:45
@mperrotti mperrotti enabled auto-merge June 18, 2024 19:45
@mperrotti mperrotti added this pull request to the merge queue Jun 18, 2024
Merged via the queue into main with commit e2f35e2 Jun 18, 2024
30 checks passed
@mperrotti mperrotti deleted the mp/skeleton branch June 18, 2024 20:08
@primer primer bot mentioned this pull request Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants