-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add skeleton loading placeholders for detail cards and fix sele…
…ct field option (#157) * Add background back to SelectField * Add Shimmer loading to details * Add loading states to design system
- Loading branch information
1 parent
092bc30
commit 12d5cae
Showing
12 changed files
with
147 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
|
||
import { Size } from "src/theme"; | ||
|
||
import Shimmer from "./Shimmer"; | ||
|
||
export const HeadingShimmer = () => ( | ||
<Shimmer width="24rem" textSize={Size.XL} /> | ||
); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
|
||
import Shimmer from "./Shimmer"; | ||
|
||
export const ParagraphShimmer = () => ( | ||
<> | ||
<Shimmer /> | ||
<Shimmer /> | ||
<Shimmer width="80%" /> | ||
</> | ||
); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import styled from "styled-components"; | ||
|
||
import { Size } from "src/theme"; | ||
|
||
export default styled.div<{ | ||
width?: string; | ||
height?: string; | ||
textSize?: Size; | ||
}>` | ||
background: ${({ theme }) => theme.color.textTertiary}; | ||
background-image: linear-gradient( | ||
to right, | ||
${({ theme }) => theme.color.textTertiary} 0%, | ||
${({ theme }) => theme.color.textSecondary} 25%, | ||
${({ theme }) => theme.color.textTertiary} 60%, | ||
${({ theme }) => theme.color.textTertiary} 100% | ||
); | ||
background-repeat: no-repeat; | ||
background-size: 800px 104px; | ||
display: flex; | ||
flex: 1; | ||
position: relative; | ||
border-radius: ${({ theme }) => theme.borderRadius.large}px; | ||
opacity: 0.8; | ||
margin-bottom: 12px; | ||
animation-duration: 1s; | ||
animation-fill-mode: forwards; | ||
animation-iteration-count: infinite; | ||
animation-name: placeholderShimmer; | ||
animation-timing-function: linear; | ||
${({ width }) => (width ? `width: ${width}` : "")}; | ||
${({ height }) => (height ? `height: ${height}` : "")}; | ||
font-size: ${({ textSize = Size.SMALL, theme }) => | ||
theme.fontSize[textSize]}px; | ||
@keyframes placeholderShimmer { | ||
0% { | ||
background-position: -400px 0; | ||
} | ||
100% { | ||
background-position: 800px 0; | ||
} | ||
} | ||
&:after { | ||
color: transparent; | ||
content: "a"; | ||
} | ||
`; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
|
||
import { Size } from "src/theme"; | ||
|
||
import Shimmer from "./Shimmer"; | ||
|
||
export const SubheadingShimmer = () => ( | ||
<Shimmer width="18rem" textSize={Size.LARGE} /> | ||
); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export { default as Shimmer } from "./Shimmer"; | ||
export { HeadingShimmer } from "./HeadingShimmer"; | ||
export { SubheadingShimmer } from "./SubheadingShimmer"; | ||
export { ParagraphShimmer } from "./ParagraphShimmer"; |
This file contains 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
This file contains 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
This file contains 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