-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds octuple spinner component (#114)
- Loading branch information
1 parent
362dc1b
commit 702931d
Showing
11 changed files
with
261 additions
and
6 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
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 React from 'react'; | ||
import { Spinner, SpinnerSize } from './'; | ||
|
||
export default { | ||
title: 'Spinner', | ||
component: Spinner, | ||
}; | ||
|
||
export const Default = () => ( | ||
<> | ||
<h1>Spinner</h1> | ||
<p>Small</p> | ||
<Spinner size={SpinnerSize.Small} /> | ||
<p>Default</p> | ||
<Spinner /> | ||
<p>Large</p> | ||
<Spinner size={SpinnerSize.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,20 @@ | ||
import React, { FC } from 'react'; | ||
import { SpinnerProps, SpinnerSize } from './Spinner.types'; | ||
import { Icon, IconName } from '../Icon'; | ||
import { mergeClasses } from '../../shared/utilities'; | ||
|
||
import styles from './spinner.module.scss'; | ||
|
||
export const Spinner: FC<SpinnerProps> = ({ | ||
size = SpinnerSize.Default, | ||
classNames, | ||
...rest | ||
}) => ( | ||
<Icon | ||
{...rest} | ||
classNames={mergeClasses([styles.spinner, classNames])} | ||
spin={0.8} | ||
size={size} | ||
path={IconName.mdiLoading} | ||
/> | ||
); |
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,15 @@ | ||
import { OcBaseProps } from '../OcBase'; | ||
|
||
export enum SpinnerSize { | ||
Large = '64px', | ||
Default = '48px', | ||
Small = '30px', | ||
} | ||
|
||
export interface SpinnerProps extends OcBaseProps<HTMLElement> { | ||
/** | ||
* Size of the spinner | ||
* @default SpinnerSize.Default | ||
*/ | ||
size?: SpinnerSize | string; | ||
} |
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,2 @@ | ||
export * from './Spinner'; | ||
export * from './Spinner.types'; |
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 @@ | ||
.spinner { | ||
color: var(--primary-color); | ||
width: fit-content; | ||
} |
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