This repository has been archived by the owner on Jun 24, 2021. It is now read-only.
-
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.
- Loading branch information
Showing
21 changed files
with
249 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
|
||
import { SecondaryButton, PrimaryButton, ProgressGroup } from '../input/buttons'; | ||
|
||
const ButtonCallback = e => console.log(`${e.currentTarget.textContent} button clicked!`); | ||
|
||
const FrontEndComponents = () => ( | ||
<div> | ||
<p>Buttons</p> | ||
<br /> | ||
<div> | ||
<PrimaryButton text="Primary" onClick={ButtonCallback} /> | ||
| ||
<SecondaryButton text="Secondary" onClick={ButtonCallback} /> | ||
</div> | ||
<br /> | ||
<div> | ||
<PrimaryButton text="Primary" onClick={ButtonCallback} disabled /> | ||
| ||
<SecondaryButton text="Secondary" onClick={ButtonCallback} disabled /> | ||
</div> | ||
<br /> | ||
<div> | ||
<ProgressGroup | ||
activeIndex={1} | ||
steps={[ | ||
{ text: '1', onClick: ButtonCallback }, | ||
{ text: '2', onClick: ButtonCallback }, | ||
{ text: '3', onClick: ButtonCallback, disabled: true }, | ||
{ text: '4', onClick: ButtonCallback, disabled: true }, | ||
]} /> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default FrontEndComponents; |
37 changes: 0 additions & 37 deletions
37
web/components/frontEndComponents/button/SecondaryButton/SecondaryButton.sass
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
// Import all component styles here | ||
@import ./app/App | ||
@import ./navbar/Navbar | ||
@import ./input/buttons/index |
14 changes: 14 additions & 0 deletions
14
web/components/input/buttons/PrimaryButton/PrimaryButton.sass
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,14 @@ | ||
button.primary | ||
@include gradient-hover-animation($gradient-primary, $gradient-primary-highlight) | ||
border: none | ||
color: $white | ||
|
||
border-radius: 4px | ||
min-width: 80px | ||
height: 40px | ||
|
||
padding-left: 16px | ||
padding-right: 16px | ||
|
||
&.disabled | ||
background: $gradient-primary-subdued |
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 PropTypes from 'prop-types'; | ||
|
||
const PrimaryButton = ({ text, onClick, disabled }) => ( | ||
<button | ||
onClick={onClick} | ||
type="button" | ||
className={`primary ${disabled ? 'disabled' : ''}`}> | ||
{ text } | ||
</button> | ||
); | ||
|
||
PrimaryButton.propTypes = { | ||
text: PropTypes.string.isRequired, | ||
onClick: PropTypes.func, | ||
disabled: PropTypes.bool, | ||
}; | ||
|
||
export default PrimaryButton; |
15 changes: 15 additions & 0 deletions
15
web/components/input/buttons/ProgressGroup/ProgressGroup.sass
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 @@ | ||
button.progress-step | ||
background: $gradient-secondary | ||
border: 1px solid $secondary | ||
color: $secondary | ||
|
||
border-radius: 50% | ||
width: 40px | ||
height: 40px | ||
|
||
margin-right: 10px | ||
|
||
&.active | ||
color: $white | ||
@include gradient-hover-animation($gradient-primary-subdued, $gradient-primary-highlight) | ||
|
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,30 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const ProgressGroup = ({ activeIndex, steps }) => steps.map((s) => { | ||
const active = (activeIndex === 0); | ||
activeIndex -= 1; | ||
return ( | ||
<span key={s.text}> | ||
<button | ||
onClick={s.onClick} | ||
type="button" | ||
className={` | ||
progress-step ${active ? 'active' : ''} ${s.disabled ? 'disabled' : ''} | ||
`}> | ||
{ s.text } | ||
</button> | ||
</span> | ||
); | ||
}); | ||
|
||
ProgressGroup.propTypes = { | ||
activeIndex: PropTypes.number, | ||
steps: PropTypes.arrayOf(PropTypes.shape({ | ||
text: PropTypes.string.isRequired, | ||
onClick: PropTypes.func, | ||
disabled: PropTypes.bool, | ||
})), | ||
}; | ||
|
||
export default ProgressGroup; |
20 changes: 20 additions & 0 deletions
20
web/components/input/buttons/SecondaryButton/SecondaryButton.sass
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 @@ | ||
button.secondary | ||
background: $gradient-secondary | ||
border: 1px solid $secondary | ||
color: $secondary | ||
|
||
border-radius: 4px | ||
min-width: 80px | ||
height: 40px | ||
|
||
padding-left: 16px | ||
padding-right: 16px | ||
|
||
&:hover | ||
border: 1px solid $secondary-highlight | ||
color: $secondary-highlight | ||
|
||
&:focus | ||
/* Link text/Hover */ | ||
border: 1px solid $secondary-highlight | ||
color: $secondary-highlight |
10 changes: 6 additions & 4 deletions
10
...omponents/button/SecondaryButton/index.js → ...ts/input/buttons/SecondaryButton/index.js
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,17 +1,19 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import './SecondaryButton.sass'; | ||
|
||
const SecondaryButton = ({ text, onClick }) => ( | ||
<button onClick={onClick} type="button" className="secondary"> | ||
const SecondaryButton = ({ text, onClick, disabled }) => ( | ||
<button | ||
onClick={onClick} | ||
type="button" | ||
className={`secondary ${disabled ? 'disabled' : ''}`}> | ||
{ text } | ||
</button> | ||
); | ||
|
||
SecondaryButton.propTypes = { | ||
text: PropTypes.string.isRequired, | ||
onClick: PropTypes.func, | ||
disabled: PropTypes.bool, | ||
}; | ||
|
||
export default SecondaryButton; |
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 PrimaryButton from './PrimaryButton'; | ||
import SecondaryButton from './SecondaryButton'; | ||
import ProgressGroup from './ProgressGroup'; | ||
|
||
export { | ||
PrimaryButton, | ||
SecondaryButton, | ||
ProgressGroup, | ||
}; |
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,31 @@ | ||
@import ./PrimaryButton/PrimaryButton | ||
@import ./SecondaryButton/SecondaryButton | ||
@import ./ProgressGroup/ProgressGroup | ||
|
||
button | ||
cursor: pointer | ||
-webkit-transition: $transition-time | ||
|
||
/* box */ | ||
box-sizing: border-box | ||
|
||
/* content */ | ||
font-family: Apercu Pro | ||
font-weight: bold | ||
line-height: normal | ||
font-size: 18px | ||
text-align: center | ||
|
||
/* positioning */ | ||
position: relative | ||
display: inline-block | ||
|
||
&.disabled | ||
pointer-events: none | ||
opacity: 0.4 | ||
|
||
&:hover | ||
box-shadow: 0px 4px 6px $shadow | ||
|
||
&:focus | ||
outline: none |
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 @@ | ||
// Import all container styles here |
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,30 @@ | ||
$transition-time: .2s | ||
|
||
// This is a hack to allow transitions of linear-gradient backgrounds. | ||
// https://medium.com/@dave_lunny/animating-css-gradients-using-only-css-d2fd7671e759 | ||
// Use this by @include'ing it in your class with required arguments. | ||
// Arguments: | ||
// $main linear-gradient to use as normal background | ||
// $hover linear-gradient to transition to upon hover | ||
// $transition [optional] transition time, defaults to $transition-time | ||
@mixin gradient-hover-animation($main, $hover, $transition: $transition-time ) | ||
background-size: 100% | ||
background-image: $main | ||
position: relative | ||
z-index: 100 | ||
&:before | ||
border-radius: inherit | ||
background-image: $hover | ||
content: '' | ||
display: block | ||
height: 100% | ||
position: absolute | ||
top: 0 | ||
left: 0 | ||
opacity: 0 | ||
width: 100% | ||
z-index: -100 | ||
-webkit-transition: $transition | ||
&:hover | ||
&:before | ||
opacity: 1 |
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 @@ | ||
/* colors */ | ||
$white: #FFFFFF | ||
$grey-dark: #363131 | ||
$grey-light: #BDBDBD | ||
$grey-slate: #9195A5 | ||
|
||
/* classes */ | ||
$error: #EB5757 // figma "red" | ||
$primary: #21258A // figma "body text" | ||
$secondary: #00BCBC // figma "link text" | ||
$secondary-highlight: #00D5D5 // figma "link text/hover" | ||
|
||
/* gradients */ | ||
$gradient-primary: linear-gradient(180deg, #4DE8C2 0%, #19CBCB 100%, #18CDCD 100%) | ||
$gradient-primary-highlight: linear-gradient(180deg, #92F1DA 0%, #43DEDE 100%) | ||
$gradient-primary-subdued: linear-gradient(180deg, #4DE8C2 0%, #18CDCD 100%, #19CBCB 100%); | ||
$gradient-secondary: linear-gradient(180deg, #FFFFFF 0%, #EDFFFC 100%) | ||
|
||
/* misc */ | ||
$shadow: rgba(0, 82, 174, 0.15) |
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