diff --git a/src/stories/TextArea.tsx b/src/stories/TextArea.tsx new file mode 100644 index 0000000..81badac --- /dev/null +++ b/src/stories/TextArea.tsx @@ -0,0 +1,80 @@ +import React, { FC } from "react"; +import styled, { css } from "styled-components"; +import CSS from "csstype"; +import { rgba } from "polished"; + +import { + color, + opacity, + typography, + borderRadius, + fontSize, + padding, +} from "../shared/styles"; + +export interface TextAreaProps { + style?: CSS.Properties; + disabled?: boolean; + name: string; + value: string; + onChange: (e: React.ChangeEvent) => void; + placeholder?: string; +} + +const TextArea: FC = ({ + style, + name, + value, + onChange, + disabled = false, + placeholder = "", +}) => { + return ( + + ); +}; + +export default TextArea; + +const StyledTextArea = styled.textarea` + border-radius: ${borderRadius.medium}; + border: none; + padding: ${padding.medium}; + width: 100%; + height: 21.6rem; + + font-size: ${fontSize.medium}; + font-family: ${typography.primary}; + font-weight: ${typography.weight.regular}; + + appearance: none; + &:focus-visible { + outline: none; + } + + &::placeholder { + color: ${color.black}; + } + + ${(props) => + props.disabled && + css` + cursor: not-allowed; + height: 0; + min-height: 12.5rem; + + color: white; + background-color: ${rgba(color.white, opacity.medium)}; + + &::placeholder { + color: ${color.white}; + } + `} +`; diff --git a/src/stories/utilities/CenteredContainer.tsx b/src/stories/utilities/CenteredContainer.tsx new file mode 100644 index 0000000..182e89e --- /dev/null +++ b/src/stories/utilities/CenteredContainer.tsx @@ -0,0 +1,59 @@ +import React, { FC, ReactNode } from "react"; +import styled, { css } from "styled-components"; +import CSS from "csstype"; + +import { color } from "../../shared/styles"; + +interface CenteredContainerProps { + children: ReactNode | null; + style?: CSS.Properties; + fullscreen?: boolean; + wide?: boolean; +} + +const CenteredContainer: FC = ({ + children, + style, + fullscreen = false, + wide = false, +}) => { + return ( + + {children} + + ); +}; + +export default CenteredContainer; + +const StyledDiv = styled.div` + height: 100vh; + text-align: center; + + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + ${(props) => + props.fullscreen && + css` + width: 100vw; + background-color: ${color.background}; + `} + + ${(props) => + !props.fullscreen && + css` + max-width: 600px; + width: 100%; + padding: 0 30px; + `} + + ${(props) => + !props.fullscreen && + props.wide && + css` + max-width: 1200px; + `} +`; diff --git a/src/stories/utilities/SpaceBetweenContainer.tsx b/src/stories/utilities/SpaceBetweenContainer.tsx new file mode 100644 index 0000000..9a8a5e9 --- /dev/null +++ b/src/stories/utilities/SpaceBetweenContainer.tsx @@ -0,0 +1,33 @@ +import React, { FC, ReactNode } from "react"; +import styled, { css } from "styled-components"; +import CSS from "csstype"; + +interface SpaceBetweenContainerProps { + children: ReactNode | null; + style?: CSS.Properties; + width100pct?: boolean; +} + +const SpaceBetweenContainer: FC = ({ + children, + style, + width100pct = true, +}) => { + return ( + + {children} + + ); +}; + +export default SpaceBetweenContainer; + +const StyledDiv = styled.div` + display: flex; + justify-content: space-between; + ${(props) => + props.width100pct && + css` + width: 100%; + `} +`; diff --git a/src/stories/utilities/Spacer.tsx b/src/stories/utilities/Spacer.tsx new file mode 100644 index 0000000..af7df0b --- /dev/null +++ b/src/stories/utilities/Spacer.tsx @@ -0,0 +1,18 @@ +import React, { FC } from "react"; +import styled from "styled-components"; +import CSS from "csstype"; + +interface SpacerProps { + style?: CSS.Properties; + space?: string; +} + +const Spacer: FC = ({ style, space = "20px" }) => { + return ; +}; + +export default Spacer; + +const StyledDiv = styled.div` + height: ${(props) => props.space}; +`; diff --git a/src/stories/utilities/TextAlignWrapper.tsx b/src/stories/utilities/TextAlignWrapper.tsx new file mode 100644 index 0000000..f61a713 --- /dev/null +++ b/src/stories/utilities/TextAlignWrapper.tsx @@ -0,0 +1,36 @@ +import React, { FC, ReactNode } from "react"; +import styled, { css } from "styled-components"; +import CSS from "csstype"; + +interface TextAlignWrapperProps { + children: ReactNode | null; + style?: CSS.Properties; + align: "left" | "center" | "right"; + marginBottom?: boolean; +} + +const TextAlignWrapper: FC = ({ + children, + style, + align = "left", + marginBottom = true, +}) => { + return ( + + {children} + + ); +}; + +export default TextAlignWrapper; + +const StyledDiv = styled.div` + text-align: ${(props) => props.align}; + width: 100%; + + ${(props) => + props.marginBottom && + css` + margin-bottom: 0.7rem; + `} +`;