Skip to content

Commit bfd2666

Browse files
committed
stuff
1 parent 940f8f9 commit bfd2666

File tree

5 files changed

+102
-2
lines changed

5 files changed

+102
-2
lines changed

components/Button/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type ButtonProps = {
77
className?: string,
88
type?: string,
99
size?: string,
10-
children: React.ReactNode
10+
children?: React.ReactNode
1111
}
1212

1313
/* Default Button is medium sized */

components/Input/index.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import * as React from "react";
2+
import classnames from 'classnames';
3+
4+
import "./styles.less";
5+
6+
type InputProps = {
7+
className?: string,
8+
type?: string,
9+
size?: string,
10+
children?: React.ReactNode
11+
}
12+
13+
/* Default Button is medium sized */
14+
export const Input = ({ className, type, size, children }: InputProps) => {
15+
let classes = classnames("acm-btn",
16+
{
17+
"acm-btn-primary": type === "primary",
18+
"acm-btn-outline": type === "outline",
19+
"acm-btn-small": size === "small",
20+
"acm-btn-medium": size === "medium",
21+
"acm-btn-large": size === "large"
22+
}
23+
);
24+
if (className) {
25+
classes = classnames(classes, ...className.split(" "));
26+
}
27+
return (
28+
<button className={classes}>
29+
<span>{children}</span>
30+
</button>
31+
);
32+
};

components/Input/styles.less

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
@import "../../styles/vars.less";
2+
.acm-btn {
3+
background-color: @b1;
4+
color: @white;
5+
text-align: center;
6+
display: inline-block;
7+
border-radius: 30px;
8+
margin: 5px 0;
9+
border: 2px solid transparent;
10+
cursor: pointer;
11+
transition: 200ms;
12+
line-height: 1.5;
13+
outline: none;
14+
}
15+
.acm-btn-outline {
16+
background-color: @white;
17+
color: @b1;
18+
}
19+
.acm-btn:hover {
20+
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.25);
21+
}
22+
.acm-btn-primary:hover {
23+
background-color: @white;
24+
color: @button-hover-color;
25+
border: 2px solid @b1;
26+
transform: translatey(-1px);
27+
}
28+
.acm-btn-outline:hover {
29+
border: 2px solid @white;
30+
background-color: @b1;
31+
color: @button-hover-color-dark;
32+
transform: translatey(-1px);
33+
}
34+
.acm-btn-small {
35+
width: 124px;
36+
min-height: 35px;
37+
}
38+
.acm-btn-medium {
39+
width: 220px;
40+
min-height: 35px;
41+
}
42+
.acm-btn-large {
43+
padding: 0 15px;
44+
min-width: 300px;
45+
min-height: 35px;
46+
}
47+
.acm-btn-large.acm-btn-primary:hover {
48+
opacity: 0.75;
49+
background-color: @b1;
50+
border: 2px solid @b1;
51+
color: @white;
52+
transform: translatey(-1px);
53+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@acmucsd/components",
3-
"version": "1.0.0",
3+
"version": "1.0.2",
44
"description": "ACM Components, an extension of Ant Design",
55
"main": "/lib/index.js",
66
"scripts": {

stories/input.stories.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { storiesOf } from "@storybook/react";
2+
import * as React from "react";
3+
import 'antd/dist/antd.css';
4+
import { Input as AntdInput } from "antd";
5+
6+
storiesOf("Input", module).add("All", () => (
7+
<div className="storycontainer">
8+
<div className="story-module spaced" style={{backgroundColor:'rgba(10,190,240, 0.25)'}}>
9+
<div style={{width: '500px', marginLeft: '50px'}}>
10+
<h3>Input</h3>
11+
<AntdInput />
12+
</div>
13+
</div>
14+
</div>
15+
));

0 commit comments

Comments
 (0)