Skip to content

Commit

Permalink
馃拕 add Blank component for generact
Browse files Browse the repository at this point in the history
  • Loading branch information
Yago committed Dec 17, 2020
1 parent c1b13b3 commit 1518f42
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"storybook:build": "NODE_PATH=src build-storybook",
"modules:build": "webpack",
"start": "concurrently \"yarn tailwind:start\" \"yarn storybook:start\"",
"build": "yarn tailwind:build && yarn run modules:build"
"build": "yarn tailwind:build && yarn run modules:build",
"generate": "npx generact"
},
"dependencies": {
"autoprefixer": "^10.1.0",
Expand Down
7 changes: 7 additions & 0 deletions src/components/atoms/Blank/Blank.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.blank {
@apply bg-gray-100;
}

.blank-active {
@apply bg-indigo-100;
}
15 changes: 15 additions & 0 deletions src/components/atoms/Blank/Blank.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

import Blank, { Props } from './Blank';

export default {
title: 'Atoms/Blank',
component: Blank,
};

const Template = (args: Props) => <Blank {...args} />;

export const Default = Template.bind({});
Default.args = {
active: false,
};
15 changes: 15 additions & 0 deletions src/components/atoms/Blank/Blank.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

export type Props = {
active: boolean;
};

const Blank = ({ active }: Props): JSX.Element => (
<span className={`blank ${active ? 'blank-active' : ''}`}>
Blank component
</span>
);

Blank.defaultProps = {};

export default Blank;
1 change: 1 addition & 0 deletions src/components/atoms/Blank/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Blank';
1 change: 1 addition & 0 deletions src/styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@import "tailwindcss/utilities";

/* ATOMS */
@import "../components/atoms/Blank/Blank.css";

/* MOLECULES */

Expand Down
11 changes: 11 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"exclude": [
"node_modules"
],
"include": [
"**/*.ts",
"**/*.js",
"**/*.tsx"
],
}

0 comments on commit 1518f42

Please sign in to comment.