-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #331 from riccardoperra/330-loading-indicator-when…
…-exporting-as-image fix(app): add loading indicator when exporting as image
- Loading branch information
Showing
10 changed files
with
120 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@codeimage/ui': minor | ||
--- | ||
|
||
feat(ui): add LoadingCircle spinner icon and Button support for loading state and left icon |
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,5 @@ | ||
--- | ||
'@codeimage/app': patch | ||
--- | ||
|
||
fix(app): #330 loading indicator when exporting as image |
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
19 changes: 19 additions & 0 deletions
19
packages/ui/src/lib/primitives/Loader/LoadingCircle.css.ts
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,19 @@ | ||
import {keyframes, style} from '@vanilla-extract/css'; | ||
|
||
export const spinner = keyframes({ | ||
to: { | ||
transform: 'rotate(1turn)', | ||
}, | ||
}); | ||
|
||
export const loadingIcon = style({ | ||
animation: `${spinner} 1s linear infinite`, | ||
}); | ||
|
||
export const circle = style({ | ||
opacity: '.25', | ||
}); | ||
|
||
export const ring = style({ | ||
opacity: '.75', | ||
}); |
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,29 @@ | ||
import clsx from 'clsx'; | ||
import {SvgIcon, SvgIconProps} from '../Icon'; | ||
import * as styles from './LoadingCircle.css'; | ||
|
||
function LoadingCircleIcon(props: SvgIconProps) { | ||
return ( | ||
<SvgIcon fill="none" viewBox="0 0 24 24" {...props}> | ||
<circle | ||
class={styles.circle} | ||
cx="12" | ||
cy="12" | ||
r="10" | ||
stroke="currentColor" | ||
stroke-width="4" | ||
></circle> | ||
<path | ||
class={styles.ring} | ||
fill="currentColor" | ||
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" | ||
></path> | ||
</SvgIcon> | ||
); | ||
} | ||
|
||
export function LoadingCircle(props: SvgIconProps) { | ||
const classes = () => clsx(props.class, styles.loadingIcon); | ||
|
||
return <LoadingCircleIcon {...props} class={classes()} />; | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './Loading'; | ||
export * from './LoadingCircle'; | ||
export * from './LoadingOverlay'; |