Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My First Parcel App</title>
<title>UI Components Library</title>
</head>
<body>
<div id="app"></div>
Expand Down
14 changes: 11 additions & 3 deletions src/lib/accordion/accordion-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@ import styled from "styled-components";
import { useElementSize } from "../../hooks/useElementSize";
import Plus from "../../assets/svgs/accordion/plus.svg";
import Minus from "../../assets/svgs/accordion/minus.svg";
import { svg, button } from "../../styles/common-style";
import {
svg,
button,
hoverMediumBlue,
hoverShortTransitionTiming,
} from "../../styles/common-style";

const StyledDiv = styled.div`
margin: 8px 0px;
.accordion-button {
${button}
${hoverMediumBlue}
${hoverShortTransitionTiming}
width: 100%;
background: ${({ theme }) => theme.klerosUIComponentsPrimaryPurple};
background-color: ${({ theme }) => theme.klerosUIComponentsWhiteBackground};
border: 1px solid ${({ theme }) => theme.klerosUIComponentsStroke};
border-radius: 3px;
padding: 11.5px 32px;
display: flex;
Expand All @@ -21,7 +29,7 @@ const StyledDiv = styled.div`
${svg}
height: 16px;
width: 16px;
fill: ${({ theme }) => theme.klerosUIComponentsLightPurple};
fill: ${({ theme }) => theme.klerosUIComponentsPrimaryText};
}
}
`;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/accordion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const AccordionTitle = styled.p`
width: fit-content;
font-weight: 600;
text-align: center;
color: ${({ theme }) => theme.klerosUIComponentsLightPurple};
color: ${({ theme }) => theme.klerosUIComponentsPrimaryText};
`;

const DefaultTitle: React.FC<{ item: AccordionItem }> = ({ item }) => (
Expand Down
2 changes: 2 additions & 0 deletions src/lib/breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { borderBox, small, button } from "../styles/common-style";
const Wrapper = styled.div`
${borderBox}
display: flex;
flex-wrap: wrap;
gap: 2px 0;
`;

const Element = styled.button<{ clickable?: boolean }>`
Expand Down
13 changes: 7 additions & 6 deletions src/lib/container/card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import styled from "styled-components";
import { borderBox } from "../../styles/common-style";
import {
borderBox,
hoverShortTransitionTiming,
} from "../../styles/common-style";

interface CardProps {
round?: boolean;
Expand All @@ -8,22 +11,20 @@ interface CardProps {

const Card = styled.div<CardProps>`
${borderBox}
background: ${({ theme }) => theme.klerosUIComponentsWhiteBackground};
${hoverShortTransitionTiming}
background-color: ${({ theme }) => theme.klerosUIComponentsWhiteBackground};
border: 1px solid ${({ theme }) => theme.klerosUIComponentsStroke};
box-shadow: 0px 2px 3px
${({ theme }) => theme.klerosUIComponentsDefaultShadow};
border-radius: ${({ round }) => (round ? "18px" : "3px")};
width: 328px;
height: 200px;

transition: box-shadow ease
${({ theme }) => theme.klerosUIComponentsTransitionSpeed};

${({ theme, hover }) =>
hover &&
`
:hover {
box-shadow: 0px 6px 9px ${theme.klerosUIComponentsHoveredShadow};
background-color: ${theme.klerosUIComponentsLightGrey}BB;
cursor: pointer;
}
`}
Expand Down
14 changes: 9 additions & 5 deletions src/lib/dropdown/base-item.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from "react";
import styled, { css } from "styled-components";
import Dot from "../dot";
import { borderBox, svg, p } from "../../styles/common-style";
import {
borderBox,
svg,
p,
hoverShortTransitionTiming,
} from "../../styles/common-style";

interface IItem {
selected?: boolean;
Expand All @@ -10,10 +15,9 @@ interface IItem {

const Item = styled.div<IItem>`
${borderBox}
background: ${({ selected, theme }) =>
selected
? theme.klerosUIComponentsMediumBlue
: theme.klerosUIComponentsWhiteBackground};
${hoverShortTransitionTiming}
background-color: ${({ selected, theme }) =>
selected ? theme.klerosUIComponentsMediumBlue : ""};
padding: ${({ current }) =>
current ? "10.5px 16px 10.5px 13px" : "11.5px 16px 11.5px 13px"};
display: flex;
Expand Down
12 changes: 10 additions & 2 deletions src/lib/dropdown/button.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import React, { ReactNode } from "react";
import styled, { css } from "styled-components";
import Arrow from "../../assets/svgs/dropdown/arrow.svg";
import { borderBox, button, svg } from "../../styles/common-style";
import {
borderBox,
button,
hoverLongTransitionTiming,
svg,
hoverMediumBlue,
} from "../../styles/common-style";

const Container = styled.button`
${borderBox}
${button}
${hoverLongTransitionTiming}
${hoverMediumBlue}
width: 240px;
background: ${({ theme }) => theme.klerosUIComponentsWhiteBackground};
background-color: ${({ theme }) => theme.klerosUIComponentsWhiteBackground};
border: 1px solid ${({ theme }) => theme.klerosUIComponentsStroke};
border-radius: 3px;
display: flex;
Expand Down
24 changes: 23 additions & 1 deletion src/lib/dropdown/simple-button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import React from "react";
import styled, { css } from "styled-components";
import Arrow from "../../assets/svgs/dropdown/arrow.svg";
import { borderBox, button, svg, small, h1 } from "../../styles/common-style";
import {
borderBox,
button,
svg,
small,
h1,
hoverShortTransitionTiming,
} from "../../styles/common-style";

const Container = styled.button`
${borderBox}
Expand All @@ -10,16 +17,30 @@ const Container = styled.button`
display: flex;
align-items: center;
padding: 0px;

:hover {
small {
color: ${({ theme }) => theme.klerosUIComponentsSecondaryBlue};
}
h1 {
color: ${({ theme }) => theme.klerosUIComponentsSecondaryBlue};
}
svg {
fill: ${({ theme }) => theme.klerosUIComponentsSecondaryBlue};
}
}
`;

const StyledSmallText = styled.small`
${small}
${hoverShortTransitionTiming}
font-weight: 600;
color: ${({ theme }) => theme.klerosUIComponentsPrimaryBlue};
`;

const StyledBigText = styled.h1`
${h1}
${hoverShortTransitionTiming}
font-weight: 600;
color: ${({ theme }) => theme.klerosUIComponentsPrimaryBlue};
`;
Expand All @@ -28,6 +49,7 @@ const StyledArrow = styled(({ ignoredIsOpen, ignoredSmall, ...props }) => (
<Arrow {...props} />
))`
${svg}
${hoverShortTransitionTiming}
width: ${({ ignoredSmall: small }) => (small ? "8" : "16")}px;
height: ${({ ignoredSmall: small }) => (small ? "8" : "16")}px;
fill: ${({ theme }) => theme.klerosUIComponentsPrimaryBlue};
Expand Down
9 changes: 8 additions & 1 deletion src/lib/form/datepicker/display-button.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import React from "react";
import styled from "styled-components";
import Calendar from "../../../assets/svgs/form/calendar.svg";
import { button, p } from "../../../styles/common-style";
import {
button,
hoverLongTransitionTiming,
hoverMediumBlue,
p,
} from "../../../styles/common-style";

const StyledButton = styled.button`
${button}
${hoverMediumBlue}
${hoverLongTransitionTiming}
height: 45px;
width: 330px;
background: ${({ theme }) => theme.klerosUIComponentsWhiteBackground};
Expand Down
10 changes: 9 additions & 1 deletion src/lib/form/field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import InfoIcon from "../../assets/svgs/status-icons/info.svg";
import UpArrowIcon from "../../assets/svgs/arrows/field-arrow-up.svg";
import DownArrowIcon from "../../assets/svgs/arrows/field-arrow-down.svg";

import { borderBox, small, svg } from "../../styles/common-style";
import {
borderBox,
hoverMediumBlue,
hoverLongTransitionTiming,
small,
svg,
} from "../../styles/common-style";
import { useHover } from "usehooks-ts";

export type VariantProp = {
Expand Down Expand Up @@ -53,6 +59,8 @@ const StyledErrorIcon = styled(ErrorIcon)`
`;

export const baseInputStyle = css<VariantProp>`
${hoverMediumBlue}
${hoverLongTransitionTiming}
height: 100%;
width: 100%;
background: ${(props) => props.theme.klerosUIComponentsWhiteBackground};
Expand Down
13 changes: 11 additions & 2 deletions src/lib/form/file-uploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import ErrorIcon from "../../assets/svgs/status-icons/error.svg";
import WarningIcon from "../../assets/svgs/status-icons/warning.svg";
import InfoIcon from "../../assets/svgs/status-icons/info.svg";
import { variantColor } from "./field";
import { borderBox, small, svg, button } from "../../styles/common-style";
import {
borderBox,
small,
svg,
button,
hoverShortTransitionTiming,
hoverWhiteBackground,
} from "../../styles/common-style";

type VariantProp = { variant?: "success" | "warning" | "error" | "info" };

Expand All @@ -18,9 +25,11 @@ const Wrapper = styled.div`

const DropZone = styled.button`
${button}
${hoverWhiteBackground}
${hoverShortTransitionTiming}
height: 100%;
width: 100%;
background: ${({ theme }) => theme.klerosUIComponentsMediumBlue};
background-color: ${({ theme }) => theme.klerosUIComponentsMediumBlue};
border: 1px dashed ${({ theme }) => theme.klerosUIComponentsPrimaryBlue};
border-radius: 3px;

Expand Down
13 changes: 11 additions & 2 deletions src/lib/pagination/tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import React from "react";
import styled from "styled-components";
import { borderBox, button, svg } from "../../styles/common-style";
import {
borderBox,
button,
hoverLongTransitionTiming,
hoverShortTransitionTiming,
svg,
} from "../../styles/common-style";

const Wrapper = styled.div`
${borderBox}
Expand All @@ -13,6 +19,7 @@ const StyledSVG = styled.svg``;

const StyledTab = styled.button<{ selected?: boolean }>`
${button}
${hoverShortTransitionTiming}
flex-grow: 1;
height: 45px;
background: none;
Expand All @@ -34,13 +41,15 @@ const StyledTab = styled.button<{ selected?: boolean }>`
${(props) =>
!props.disabled && !props.selected
? `:hover {
${hoverLongTransitionTiming}
border-bottom: 3px solid
${props.theme.klerosUIComponentsSecondaryBlue};
${props.theme.klerosUIComponentsPrimaryBlue};
}`
: ""}

& ${StyledSVG} {
${svg}
${hoverShortTransitionTiming}
height: 16px;
width: 16px;
margin-right: 16px;
Expand Down
20 changes: 18 additions & 2 deletions src/lib/tag/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import React from "react";
import styled from "styled-components";
import { borderBox, p, button } from "../../styles/common-style";
import {
borderBox,
p,
button,
hoverShortTransitionTiming,
} from "../../styles/common-style";

interface BaseTagProps {
active?: boolean;
Expand All @@ -11,18 +16,29 @@ const BaseTag = styled.button<BaseTagProps>`
${borderBox}
${button}
height: 32px;
background: ${({ theme }) => theme.klerosUIComponentsMediumBlue};
background-color: ${({ theme }) => theme.klerosUIComponentsMediumBlue};
border: ${({ theme, active }) =>
active ? `1px solid ${theme.klerosUIComponentsPrimaryBlue}` : "none"};
border-radius: 300px;
padding: 0 16px;
display: flex;
justify-content: center;
align-items: center;

:hover {
${({ active, theme }) =>
!active &&
`
p {
color: ${theme.klerosUIComponentsSecondaryBlue};
}
`}
}
`;

const StyledText = styled.p`
${p}
${hoverShortTransitionTiming}
color: ${({ theme }) => theme.klerosUIComponentsPrimaryBlue};
`;

Expand Down
33 changes: 33 additions & 0 deletions src/styles/common-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,36 @@ export const borderBox = css`
box-sizing: border-box;
}
`;

export const hoverShortTransitionTiming = css`
:hover {
transition: 0.1s;
}

:not(:hover) {
transition: 0.1s;
}
`;

export const hoverLongTransitionTiming = css`
:hover {
transition: 0.2s;
}

:not(:hover) {
transition: 0.2s;
}
`;

export const hoverMediumBlue = css`
:hover {
background-color: ${(props) => props.theme.klerosUIComponentsMediumBlue};
}
`;

export const hoverWhiteBackground = css`
:hover {
background-color: ${(props) =>
props.theme.klerosUIComponentsWhiteBackground};
}
`;
Loading
Loading