Skip to content

Commit

Permalink
feat: Panel (#32)
Browse files Browse the repository at this point in the history
* feat: Panel

* chore: Renamed component

* fix: Missing value by rebase
  • Loading branch information
hachiojidev committed Oct 28, 2020
1 parent c160770 commit 907994c
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Checkbox = styled.input.attrs({ type: "checkbox" })`
border: 0;
border-radius: 8px;
background-color: ${({ theme }) => theme.colors.input};
box-shadow: inset 0px 2px 2px -1px rgba(74, 74, 104, 0.1);
box-shadow: ${({ theme }) => theme.shadows.inset};
&:after {
content: "";
Expand Down
27 changes: 27 additions & 0 deletions src/components/ColorBox/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react";
import styled from "styled-components";
import ColorBox from "./index";

const Row = styled.div`
margin-bottom: 32px;
& > button + button {
margin-left: 16px;
}
`;

export default {
title: "ColorBox",
component: ColorBox,
argTypes: {},
};

export const Default: React.FC = () => {
return (
<div style={{ padding: "32px", width: "500px" }}>
<Row>
<ColorBox>ColorBox</ColorBox>
</Row>
</div>
);
};
11 changes: 11 additions & 0 deletions src/components/ColorBox/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styled from "styled-components";

const Panel = styled.div`
background-color: ${({ theme }) => theme.colors.input};
border-radius: 16px;
box-shadow: ${({ theme }) => theme.shadows.inset};
color: ${({ theme }) => theme.colors.text};
padding: 16px;
`;

export default Panel;
2 changes: 1 addition & 1 deletion src/components/Toggle/StyledToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const StyledToggle = styled.div<{ checked: boolean }>`
align-items: center;
background-color: ${({ theme, checked }) => theme.colors[checked ? "success" : "input"]};
border-radius: 24px;
box-shadow: inset 0px 2px 2px -1px rgba(74, 74, 104, 0.1);
box-shadow: ${({ theme }) => theme.shadows.inset};
cursor: pointer;
display: inline-flex;
height: 40px;
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ export { default as Card } from "./components/Card";
export { default as Checkbox } from "./components/Checkbox";
export { default as Heading } from "./components/Heading";
export * from "./components/Layouts";
export { default as Link } from "./components/Link";
export * from "./components/Svg";
export { default as Tag } from "./components/Tag";
export { default as Text } from "./components/Text";
export { default as Link } from "./components/Link";
export { default as ColorBox } from "./components/ColorBox";
export { default as Toggle } from "./components/Toggle";
export { default as ResetCSS } from "./ResetCSS";

Expand Down
1 change: 1 addition & 0 deletions src/styled.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type Shadows = {
success: string;
warning: string;
focus: string;
inset: string;
};

export type Colors = {
Expand Down
1 change: 1 addition & 0 deletions src/theme/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const shadows = {
success: "0px 0px 0px 1px #31D0AA, 0px 0px 0px 4px rgba(49, 208, 170, 0.2)",
warning: "0px 0px 0px 1px #ED4B9E, 0px 0px 0px 4px rgba(237, 75, 158, 0.2)",
focus: "0px 0px 0px 1px #7645D9, 0px 0px 0px 4px rgba(118, 69, 217, 0.6)",
inset: "inset 0px 2px 2px -1px rgba(74, 74, 104, 0.1)",
};

const spacing: Spacing = [0, 4, 8, 16, 24, 32, 48, 64];
Expand Down

0 comments on commit 907994c

Please sign in to comment.