-
-
Notifications
You must be signed in to change notification settings - Fork 16
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 #196 from raiane-oliveira/main
Formulários de Login e Cadastro
- Loading branch information
Showing
121 changed files
with
3,025 additions
and
2,691 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,75 +1,23 @@ | ||
import { ReactNode } from 'react' | ||
import { | ||
ButtonDefault, | ||
ButtonForm, | ||
ButtonFormVariant, | ||
ButtonModal, | ||
ButtonModalSecondary, | ||
ButtonUnstyled, | ||
ButtonVariant, | ||
} from './style' | ||
import { ComponentType, ElementType, ReactNode } from 'react' | ||
import { ButtonStyle, ButtonStyleProps } from './style' | ||
|
||
import Link from 'next/link' | ||
type ElementOrComponentType = ElementType<any> | ComponentType<any> | ||
|
||
interface ButtonProps { | ||
content: ReactNode | ||
btnRole?: | ||
| 'primary' | ||
| 'secondary' | ||
| 'unstyled' | ||
| 'modal-secondary' | ||
| 'modal-default' | ||
| 'form' | ||
| 'form-secondary' | ||
disabled?: boolean | ||
onClick?: () => void | ||
interface ButtonProps extends ButtonStyleProps { | ||
children: ReactNode | ||
as?: ElementOrComponentType | ||
[key: string]: any | ||
} | ||
|
||
export function Button({ | ||
content, | ||
btnRole = 'primary', | ||
disabled = false, | ||
onClick, | ||
children, | ||
variant = 'primary', | ||
size = 'lg', | ||
...props | ||
}: ButtonProps) { | ||
if (btnRole === 'primary') return <ButtonDefault>{content}</ButtonDefault> | ||
|
||
if (btnRole === 'secondary') | ||
return <ButtonVariant type="button">{content}</ButtonVariant> | ||
|
||
if (btnRole === 'unstyled') | ||
return ( | ||
<ButtonUnstyled onClick={onClick} type="button"> | ||
{content} | ||
</ButtonUnstyled> | ||
) | ||
|
||
if (btnRole === 'modal-secondary') | ||
return ( | ||
<ButtonModalSecondary onClick={onClick} type="button"> | ||
{content} | ||
</ButtonModalSecondary> | ||
) | ||
|
||
if (btnRole === 'modal-default') | ||
return ( | ||
<Link href={'/'}> | ||
<ButtonModal type="button">{content}</ButtonModal> | ||
</Link> | ||
) | ||
|
||
if (btnRole === 'form-secondary') | ||
return ( | ||
<ButtonFormVariant onClick={onClick} type="button"> | ||
{content} | ||
</ButtonFormVariant> | ||
) | ||
|
||
if (btnRole === 'form') | ||
return ( | ||
<ButtonForm type="submit" disabled={disabled}> | ||
{content} | ||
</ButtonForm> | ||
) | ||
|
||
return <></> | ||
return ( | ||
<ButtonStyle variant={variant} size={size} {...props}> | ||
{children} | ||
</ButtonStyle> | ||
) | ||
} |
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,97 +1,88 @@ | ||
import styled from 'styled-components' | ||
import styled, { css } from 'styled-components' | ||
|
||
export const ButtonDefault = styled.button` | ||
font-size: ${(props) => props.theme.fontSizes.sm}; | ||
border-color: ${(props) => props.theme.colors.blue[400]}; | ||
color: ${(props) => props.theme.colors.white}; | ||
background-color: ${(props) => props.theme.colors.blue[400]}; | ||
&:hover { | ||
background-color: transparent; | ||
color: ${(props) => props.theme.colors.blue[400]}; | ||
} | ||
` | ||
|
||
export const ButtonVariant = styled(ButtonDefault)` | ||
border-color: ${(props) => props.theme.colors.blue[400]}; | ||
color: ${(props) => props.theme.colors.blue[400]}; | ||
background-color: transparent; | ||
&:hover { | ||
background-color: ${(props) => props.theme.colors.blue[400]}; | ||
color: ${(props) => props.theme.colors.white}; | ||
} | ||
` | ||
|
||
export const ButtonForm = styled(ButtonDefault)` | ||
width: 100%; | ||
height: 48px; | ||
background: ${(props) => props.theme.colors.blue[400]}; | ||
&:hover { | ||
background-color: ${(props) => props.theme.colors.blue[700]}; | ||
color: ${(props) => props.theme.colors.white}; | ||
box-shadow: 0px 1px 15px rgba(17, 101, 186, 0.4); | ||
} | ||
&:disabled { | ||
cursor: not-allowed; | ||
filter: grayscale(100%); | ||
} | ||
` | ||
const BaseStylesButton = styled.button` | ||
all: unset; | ||
export const ButtonFormVariant = styled(ButtonForm)` | ||
width: 100%; | ||
border-color: ${(props) => props.theme.colors.blue[400]}; | ||
color: ${(props) => props.theme.colors.blue[400]}; | ||
background-color: ${(props) => props.theme.colors.white}; | ||
` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 0.5rem; | ||
export const ButtonUnstyled = styled.button` | ||
all: unset; | ||
border-radius: 0.5rem; | ||
cursor: pointer; | ||
margin: 0px; | ||
text-decoration: underline; | ||
transition: all 0.3s ease; | ||
&:hover { | ||
color: ${(props) => props.theme.colors.blue[300]}; | ||
} | ||
` | ||
export const ButtonModal = styled.button` | ||
font-style: normal; | ||
font-weight: 400; | ||
font-size: 14px; | ||
line-height: 150%; | ||
color: #fff; | ||
padding: 8px 40px; | ||
border: 2px solid ${(props) => props.theme.colors.red[500]}; | ||
background-color: ${(props) => props.theme.colors.red[500]}; | ||
font-size: 1rem; | ||
font-weight: 500; | ||
line-height: 0.7; | ||
a { | ||
color: #fff; | ||
width: 100%; | ||
height: 100%; | ||
padding: 8px 40px; | ||
} | ||
transition: 0.3s ease; | ||
&:hover { | ||
color: #5d5f5d; | ||
background-color: transparent; | ||
border-color: #5d5f5d; | ||
} | ||
${(props) => { | ||
if (props.disabled) { | ||
return css` | ||
cursor: not-allowed; | ||
` | ||
} | ||
}} | ||
` | ||
|
||
export const ButtonModalSecondary = styled(ButtonModal)` | ||
color: #5d5f5d; | ||
background-color: transparent; | ||
border: 2px solid #5d5f5d; | ||
&:hover { | ||
background-color: ${(props) => props.theme.colors.red[500]}; | ||
color: #fff; | ||
border-color: ${(props) => props.theme.colors.red[500]}; | ||
} | ||
export interface ButtonStyleProps { | ||
variant?: 'primary' | 'secondary' | 'tertiary' | ||
size?: 'lg' | 'md' | 'sm' | ||
} | ||
|
||
export const ButtonStyle = styled(BaseStylesButton)<ButtonStyleProps>` | ||
${({ variant, theme, disabled }) => { | ||
switch (variant) { | ||
case 'primary': | ||
return css` | ||
border: 2px solid | ||
${!disabled ? theme.colors.blue[800] : theme.colors.gray[500]}; | ||
background-color: ${!disabled | ||
? theme.colors.blue[800] | ||
: theme.colors.gray[500]}; | ||
color: ${theme.colors.white}; | ||
&:not(:disabled):hover { | ||
border-color: ${theme.colors.blue[850]}; | ||
background-color: ${theme.colors.blue[850]}; | ||
} | ||
` | ||
case 'secondary': | ||
return css` | ||
border: 2px solid ${theme.colors.blue[800]}; | ||
color: ${theme.colors.blue[800]}; | ||
&:not(:disabled):hover { | ||
border-color: ${theme.colors.blue[850]}; | ||
color: ${theme.colors.blue[850]}; | ||
} | ||
` | ||
case 'tertiary': | ||
return css` | ||
color: ${theme.colors.blue[800]}; | ||
&:not(:disabled):hover { | ||
color: ${theme.colors.blue[850]}; | ||
} | ||
` | ||
} | ||
}} | ||
${({ size }) => { | ||
switch (size) { | ||
case 'lg': | ||
return css` | ||
padding: 1rem 1.5rem; | ||
` | ||
case 'md': | ||
return css` | ||
padding: 0.75rem 1.5rem; | ||
` | ||
case 'sm': | ||
return css` | ||
padding: 0.5rem 1.5rem; | ||
` | ||
} | ||
}} | ||
` |
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,22 +1,26 @@ | ||
import Image from 'next/image' | ||
import { ContainerCard } from './style' | ||
import { ReactNode } from 'react' | ||
|
||
interface CardOnboardingProps { | ||
title: string | ||
description: string | ||
children: ReactNode | ||
img: string | ||
} | ||
|
||
export function CardOnboarding({ | ||
title, | ||
description, | ||
children: description, | ||
img, | ||
}: CardOnboardingProps) { | ||
return ( | ||
<ContainerCard> | ||
<Image width={180} height={180} src={img} alt={title} loading="eager" /> | ||
<h3>{title}</h3> | ||
<p>{description}</p> | ||
|
||
<section> | ||
<h5 className="title">{title}</h5> | ||
<p>{description}</p> | ||
</section> | ||
</ContainerCard> | ||
) | ||
} |
Oops, something went wrong.