Skip to content

Commit

Permalink
feat: Implement a flippable arrow ui component
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarajohn committed Oct 16, 2023
1 parent 707e50e commit 0de6b63
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ui/FlippableArrow/FlippableArrow.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import styled from '@emotion/styled';
import { transition } from '@orfium/ictinus/dist/theme/functions';

export const IconWrapper = styled.span<{ expanded: boolean }>`
perspective: 1000px;
position: relative;
> span {
${transition(0.2)};
transform-style: preserve-3d;
transform: ${({ expanded }) => (expanded ? `rotateX(180deg) ` : `rotateX(0)`)};
}
`;
20 changes: 20 additions & 0 deletions src/ui/FlippableArrow/FlippableArrow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Icon } from '@orfium/ictinus';
import { IconWrapper } from './FlippableArrow.styles';

type FlippableChevronProps = {
expanded: boolean;
color: string;
size: number;
};

function FlippableArrow(props: FlippableChevronProps) {
const { expanded, color, size } = props;

return (
<IconWrapper expanded={expanded}>
<Icon name={'triangleDown'} color={color} size={size} />
</IconWrapper>
);
}

export default FlippableArrow;
2 changes: 2 additions & 0 deletions src/ui/FlippableArrow/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './FlippableArrow';
export { default } from './FlippableArrow';

0 comments on commit 0de6b63

Please sign in to comment.