diff --git a/packages/berlin/src/components/button/Button.styled.tsx b/packages/berlin/src/components/button/Button.styled.tsx index 0bf974fd..2bbcc700 100644 --- a/packages/berlin/src/components/button/Button.styled.tsx +++ b/packages/berlin/src/components/button/Button.styled.tsx @@ -1,9 +1,5 @@ import styled, { css } from 'styled-components'; - -type StyledButtonProps = { - $color: 'primary' | 'secondary'; - $variant: 'text' | 'contained' | 'outlined' | 'link'; -}; +import { StyledButtonProps } from './Button.types'; export const StyledButton = styled.button` border-radius: 0.5rem; diff --git a/packages/berlin/src/components/button/Button.types.ts b/packages/berlin/src/components/button/Button.types.ts new file mode 100644 index 00000000..0a7da52a --- /dev/null +++ b/packages/berlin/src/components/button/Button.types.ts @@ -0,0 +1,4 @@ +export type StyledButtonProps = { + $color: 'primary' | 'secondary'; + $variant?: 'text' | 'contained' | 'outlined' | 'link'; +}; diff --git a/packages/berlin/src/components/containers/FlexRowToColumn.styled.tsx b/packages/berlin/src/components/containers/FlexRowToColumn.styled.tsx new file mode 100644 index 00000000..8e1d8b39 --- /dev/null +++ b/packages/berlin/src/components/containers/FlexRowToColumn.styled.tsx @@ -0,0 +1,23 @@ +import styled from 'styled-components'; + +type FlexRowToColumnProps = { + $align?: 'flex-start' | 'center' | 'flex-end'; + $gap?: string; + $justify?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around'; +}; + +export const FlexRowToColumn = styled.div` + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; + width: 100%; + + align-items: ${(props) => (props.$align && props.$align) || 'flex-start'}; + gap: ${(props) => props.$gap || '1rem'}; + justify-content: ${(props) => (props.$justify && props.$justify) || 'flex-start'}; + + @media (min-width: 640px) { + flex-direction: row; + } +`; diff --git a/packages/berlin/src/components/iconButton/IconButton.tsx b/packages/berlin/src/components/iconButton/IconButton.tsx index d26f176a..d1269856 100644 --- a/packages/berlin/src/components/iconButton/IconButton.tsx +++ b/packages/berlin/src/components/iconButton/IconButton.tsx @@ -1,18 +1,18 @@ import Button from '../button'; +import { StyledButtonProps } from '../button/Button.types'; import { Icon, IconContainer } from './IconButton.styled'; type IconButtonProps = { - $color: 'primary' | 'secondary'; icon: { src: string; alt: string; }; onClick: () => void; -}; +} & StyledButtonProps; -function IconButton({ $color, icon, onClick }: IconButtonProps) { +function IconButton({ icon, onClick, ...props }: IconButtonProps) { return ( -