-
Notifications
You must be signed in to change notification settings - Fork 7
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 #430 from eduzz/develop
Versão 0.62.0
- Loading branch information
Showing
34 changed files
with
401 additions
and
961 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
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 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,27 @@ | ||
import * as React from 'react'; | ||
|
||
import { useContextSelector } from 'use-context-selector'; | ||
|
||
import styled, { StyledProp } from '@eduzz/houston-styles'; | ||
|
||
import { ShowcaseContext } from '../context'; | ||
|
||
const Content = ({ children, ...rest }: React.HTMLAttributes<HTMLDivElement> & StyledProp) => { | ||
const currentStep = useContextSelector(ShowcaseContext, context => context.currentStep); | ||
const stepSize = useContextSelector(ShowcaseContext, context => context.stepSize); | ||
const offset = (currentStep - 1) * -stepSize; | ||
|
||
return ( | ||
<div {...rest} style={{ transform: `translateX(${offset}px)` }}> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default styled(Content, { label: 'hst-showcase-content' })` | ||
display: flex; | ||
position: relative; | ||
top: 0; | ||
left: 0; | ||
transition: transform ease-in-out 0.5s; | ||
`; |
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,48 @@ | ||
import { useContextSelector } from 'use-context-selector'; | ||
|
||
import styled, { css, cx, StyledProp } from '@eduzz/houston-styles/styled'; | ||
|
||
import { ShowcaseContext } from '../context'; | ||
|
||
const DOTS_DIMENSION_SIZE = 10; | ||
|
||
const ControlDots = ({ className }: StyledProp) => { | ||
const currentStep = useContextSelector(ShowcaseContext, context => context.currentStep); | ||
const controlDots = useContextSelector(ShowcaseContext, context => context.controlDots); | ||
const totalSteps = useContextSelector(ShowcaseContext, context => context.totalSteps); | ||
|
||
if (!controlDots) return null; | ||
|
||
const dots = Array(totalSteps).fill(0); | ||
|
||
return ( | ||
<div className={className}> | ||
{dots.map((_, index) => { | ||
const activeDot = currentStep - 1 === index; | ||
|
||
return <span key={`dot-${index}`} className={cx('hst-dots', `${activeDot && '--hst-dots-active'}`)} />; | ||
})} | ||
</div> | ||
); | ||
}; | ||
|
||
export default styled(ControlDots, { label: 'hst-control-dots' })` | ||
${({ theme }) => css` | ||
padding: ${theme.spacing.inset.sm}; | ||
& .hst-dots { | ||
height: ${theme.pxToRem(DOTS_DIMENSION_SIZE)}rem; | ||
width: ${theme.pxToRem(DOTS_DIMENSION_SIZE)}rem; | ||
margin-right: ${theme.pxToRem(DOTS_DIMENSION_SIZE)}rem; | ||
background-color: ${theme.neutralColor.high.pure}; | ||
border: solid ${theme.border.width.xs} ${theme.neutralColor.high.dark}; | ||
border-radius: ${theme.border.radius.circular}; | ||
display: inline-block; | ||
} | ||
& .--hst-dots-active { | ||
background-color: ${theme.brandColor.primary.pure}; | ||
border: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import styled, { css, StyledProp } from '@eduzz/houston-styles'; | ||
|
||
import Modal from '../../Modal'; | ||
import ControlDots from '../ControlDots'; | ||
|
||
const Footer = ({ children, ...rest }: React.HTMLAttributes<HTMLDivElement> & StyledProp) => { | ||
return ( | ||
<div {...rest}> | ||
<ControlDots /> | ||
<Modal.Footer>{children}</Modal.Footer> | ||
</div> | ||
); | ||
}; | ||
|
||
export default styled(Footer, { label: 'hst-showcase-footer' })` | ||
${({ theme }) => css` | ||
background-color: ${theme.neutralColor.high.pure}; | ||
position: sticky; | ||
bottom: 0; | ||
width: 100%; | ||
`} | ||
`; |
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 |
---|---|---|
@@ -1,6 +1,31 @@ | ||
import styled, { css, StyledProp } from '@eduzz/houston-styles'; | ||
|
||
export interface ShowcaseImageProps { | ||
src: string; | ||
alt: string; | ||
} | ||
|
||
export default (() => null) as React.FC<ShowcaseImageProps>; | ||
const IMAGE_HEIGHT = 235; | ||
|
||
const Image = ({ src, alt, ...rest }: ShowcaseImageProps & React.HTMLAttributes<HTMLDivElement> & StyledProp) => { | ||
return ( | ||
<div {...rest}> | ||
<img src={src} alt={alt} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default styled(Image, { label: 'hst-showcase-image' })` | ||
${({ theme }) => css` | ||
width: 100%; | ||
height: ${theme.pxToRem(IMAGE_HEIGHT)}rem; | ||
border-radius: ${theme.border.radius.sm} ${theme.border.radius.sm} 0 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
& img { | ||
max-width: 100%; | ||
} | ||
`} | ||
`; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.