UI Components
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
.root {
|
||||
@apply cursor-pointer font-bold inline-flex items-center px-8 py-2 rounded-sm border border-transparent text-base leading-6 font-medium text-white bg-black transition ease-in-out duration-150 shadow-sm;
|
||||
@apply cursor-pointer inline-flex items-center px-8 py-2 rounded-sm border border-transparent text-base leading-6 text-white bg-black transition ease-in-out duration-150 shadow-sm font-medium;
|
||||
}
|
||||
|
||||
.root:hover {
|
||||
|
||||
@@ -26,7 +26,9 @@ export default class Button extends React.Component<Props> {
|
||||
let Component: React.ComponentType<
|
||||
React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> &
|
||||
React.ClassAttributes<HTMLButtonElement | HTMLAnchorElement>
|
||||
> = "button" as any;
|
||||
> = "a" as any;
|
||||
|
||||
// Catch for buttons / span / stc.
|
||||
|
||||
const rootClassName = cn(
|
||||
s.root,
|
||||
|
||||
3
ui/Container/Container.module.css
Normal file
3
ui/Container/Container.module.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
@apply max-w-6xl mx-auto;
|
||||
}
|
||||
25
ui/Container/Container.tsx
Normal file
25
ui/Container/Container.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import cn from "classnames";
|
||||
import { FunctionComponent } from "react";
|
||||
import s from "./Container.module.css";
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
children?: any;
|
||||
el?: HTMLElement;
|
||||
}
|
||||
|
||||
const Container: FunctionComponent<Props> = ({
|
||||
children,
|
||||
className,
|
||||
el = "div",
|
||||
}) => {
|
||||
const rootClassName = cn(s.root, className);
|
||||
|
||||
let Component: React.ComponentType<React.HTMLAttributes<
|
||||
HTMLDivElement
|
||||
>> = el as any;
|
||||
|
||||
return <Component className={rootClassName}>{children}</Component>;
|
||||
};
|
||||
|
||||
export default Container;
|
||||
1
ui/Container/index.ts
Normal file
1
ui/Container/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from "./Container";
|
||||
@@ -1,15 +0,0 @@
|
||||
import cn from "classnames";
|
||||
import { FunctionComponent } from "react";
|
||||
import s from "./Navbar.module.css";
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
children?: any;
|
||||
}
|
||||
|
||||
const Navbar: FunctionComponent<Props> = ({ children, className }) => {
|
||||
const rootClassName = cn(s.root, className);
|
||||
return <div className={rootClassName}>{children}</div>;
|
||||
};
|
||||
|
||||
export default Navbar;
|
||||
@@ -1 +0,0 @@
|
||||
export { default } from "./Navbar";
|
||||
3
ui/README.md
Normal file
3
ui/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# UI
|
||||
|
||||
Building blocks to build a rich graphical interfaces. Components should be atomic and pure. Serve one purpuse.
|
||||
@@ -1,2 +1,4 @@
|
||||
export { default as Button } from "./Button";
|
||||
export { default as Container } from "./Container";
|
||||
export { default as Featurebar } from "./Featurebar";
|
||||
export { default as Logo } from "./Logo";
|
||||
|
||||
Reference in New Issue
Block a user