From fb01594954cb15c4afa4d43e710995c373f82a04 Mon Sep 17 00:00:00 2001 From: Eunbin Date: Wed, 4 Nov 2020 19:46:39 +0900 Subject: [PATCH 01/11] =?UTF-8?q?[feat]=20date=20picker=20atom=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20view=20=EA=B5=AC=ED=98=84=20-=20d?= =?UTF-8?q?ate=20picker=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20view=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20-=20storybook=20test=20code=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atoms/DatePicker/DatePicker.stories.tsx | 15 ++++++++++ .../atoms/DatePicker/DatePicker.tsx | 28 +++++++++++++++++++ .../src/components/atoms/DatePicker/index.ts | 1 + 3 files changed, 44 insertions(+) create mode 100644 client/src/components/atoms/DatePicker/DatePicker.stories.tsx create mode 100644 client/src/components/atoms/DatePicker/DatePicker.tsx create mode 100644 client/src/components/atoms/DatePicker/index.ts diff --git a/client/src/components/atoms/DatePicker/DatePicker.stories.tsx b/client/src/components/atoms/DatePicker/DatePicker.stories.tsx new file mode 100644 index 0000000..99839de --- /dev/null +++ b/client/src/components/atoms/DatePicker/DatePicker.stories.tsx @@ -0,0 +1,15 @@ +import React, { ChangeEvent, useState } from 'react'; +import { text } from '@storybook/addon-knobs'; +import DatePicker from './DatePicker'; + +export default { + title: 'Components/DatePicker', + component: DatePicker, +}; + +export const Default = () => { + const value = text('date', '2020-11-04'); + const onChange = (e: ChangeEvent) => {}; + + return ; +}; diff --git a/client/src/components/atoms/DatePicker/DatePicker.tsx b/client/src/components/atoms/DatePicker/DatePicker.tsx new file mode 100644 index 0000000..d1ac6ff --- /dev/null +++ b/client/src/components/atoms/DatePicker/DatePicker.tsx @@ -0,0 +1,28 @@ +import React, { FunctionComponent, ChangeEvent } from 'react'; +import styled from '@themes/styled'; + +const StyledDatePicker = styled.input` + background-color: ${({ theme }) => theme.palette.BG_COLOR01}; + font-size: 0.8rem; + color: ${({ theme }) => theme.palette.PRIMARY}; + border-radius: 0.5rem; + padding: 5px 12px; + width: 440px; + border: 1px solid ${({ theme }) => theme.palette.BG_COLOR02}; + &:focus { + background-color: ${({ theme }) => theme.palette.LIGHT}; + border-color: ${({ theme }) => theme.palette.LINK_BLUE}; + box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.3); + } +`; + +interface Props { + value: string; + onChange: (e: ChangeEvent) => void; +} + +const DatePicker: FunctionComponent = ({ value, onChange }) => ( + +); + +export default DatePicker; diff --git a/client/src/components/atoms/DatePicker/index.ts b/client/src/components/atoms/DatePicker/index.ts new file mode 100644 index 0000000..2ef49e2 --- /dev/null +++ b/client/src/components/atoms/DatePicker/index.ts @@ -0,0 +1 @@ +export { default } from './DatePicker'; From dd019979d019d37b42ab552185e1a7a07b12d022 Mon Sep 17 00:00:00 2001 From: Eunbin Date: Wed, 4 Nov 2020 19:50:47 +0900 Subject: [PATCH 02/11] =?UTF-8?q?[feat]=20filter=20button=20atom=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20view=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20-=20filter=20button=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20view=20=EA=B5=AC=ED=98=84=20-=20story=20test=20code?= =?UTF-8?q?=20=EC=9E=91=EC=84=B1=20issue=20number:=20#68?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FilterButton/FilterButton.stories.tsx | 15 ++++++++++++ .../atoms/FilterButton/FilterButton.tsx | 23 +++++++++++++++++++ .../components/atoms/FilterButton/index.ts | 1 + 3 files changed, 39 insertions(+) create mode 100644 client/src/components/atoms/FilterButton/FilterButton.stories.tsx create mode 100644 client/src/components/atoms/FilterButton/FilterButton.tsx create mode 100644 client/src/components/atoms/FilterButton/index.ts diff --git a/client/src/components/atoms/FilterButton/FilterButton.stories.tsx b/client/src/components/atoms/FilterButton/FilterButton.stories.tsx new file mode 100644 index 0000000..b22ad48 --- /dev/null +++ b/client/src/components/atoms/FilterButton/FilterButton.stories.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +import { text } from '@storybook/addon-knobs'; +import FilterButton from './FilterButton'; + +export default { + title: 'Components/FilterButton', + component: FilterButton, +}; + +export const Default = () => { + const onClick = () => {}; + const value = text('button text', 'Author'); + + return ; +}; diff --git a/client/src/components/atoms/FilterButton/FilterButton.tsx b/client/src/components/atoms/FilterButton/FilterButton.tsx new file mode 100644 index 0000000..b21e759 --- /dev/null +++ b/client/src/components/atoms/FilterButton/FilterButton.tsx @@ -0,0 +1,23 @@ +import React, { FunctionComponent } from 'react'; +import styled from '@themes/styled'; + +const StyledFilterButton = styled.button` + all: unset; + color: ${({ theme }) => theme.palette.SECONDARY}; + font-size: 0.8rem; + &:hover { + color: ${({ theme }) => theme.palette.PRIMARY}; + cursor: pointer; + } +`; + +interface Props { + onClick: () => void; + text: string; +} + +const FilterButton: FunctionComponent = ({ onClick, text }) => ( + {text} ▾ +); + +export default FilterButton; diff --git a/client/src/components/atoms/FilterButton/index.ts b/client/src/components/atoms/FilterButton/index.ts new file mode 100644 index 0000000..e364f4d --- /dev/null +++ b/client/src/components/atoms/FilterButton/index.ts @@ -0,0 +1 @@ +export { default } from './FilterButton'; From 1092d39cfe82fe281046efe19652819ec3e58474 Mon Sep 17 00:00:00 2001 From: Eunbin Date: Wed, 4 Nov 2020 19:52:24 +0900 Subject: [PATCH 03/11] =?UTF-8?q?[feat]=20input=20label=20atom=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20view=20=EA=B5=AC=ED=98=84=20-=20i?= =?UTF-8?q?nput=20=EC=9C=84=EC=97=90=20=EB=B6=99=EC=9D=BC=20label=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20view=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20-=20story=20test=20code=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atoms/InputLabel/InputLabel.stories.tsx | 13 +++++++++++++ .../components/atoms/InputLabel/InputLabel.tsx | 17 +++++++++++++++++ client/src/components/atoms/InputLabel/index.ts | 1 + 3 files changed, 31 insertions(+) create mode 100644 client/src/components/atoms/InputLabel/InputLabel.stories.tsx create mode 100644 client/src/components/atoms/InputLabel/InputLabel.tsx create mode 100644 client/src/components/atoms/InputLabel/index.ts diff --git a/client/src/components/atoms/InputLabel/InputLabel.stories.tsx b/client/src/components/atoms/InputLabel/InputLabel.stories.tsx new file mode 100644 index 0000000..b200095 --- /dev/null +++ b/client/src/components/atoms/InputLabel/InputLabel.stories.tsx @@ -0,0 +1,13 @@ +import React from 'react'; +import { text } from '@storybook/addon-knobs'; +import InputLabel from './InputLabel'; + +export default { + title: 'Components/InputLabel', + component: InputLabel, +}; + +export const Default = () => { + const value = text('label', 'Due date (optional)'); + return ; +}; diff --git a/client/src/components/atoms/InputLabel/InputLabel.tsx b/client/src/components/atoms/InputLabel/InputLabel.tsx new file mode 100644 index 0000000..67379bd --- /dev/null +++ b/client/src/components/atoms/InputLabel/InputLabel.tsx @@ -0,0 +1,17 @@ +import React, { FunctionComponent } from 'react'; +import styled from '@themes/styled'; + +const StyledInputLabel = styled.span` + font-size: 1rem; + font-weight: 600; +`; + +interface Props { + text: string; +} + +const InputLabel: FunctionComponent = ({ text }) => ( + {text} +); + +export default InputLabel; diff --git a/client/src/components/atoms/InputLabel/index.ts b/client/src/components/atoms/InputLabel/index.ts new file mode 100644 index 0000000..3b0b90a --- /dev/null +++ b/client/src/components/atoms/InputLabel/index.ts @@ -0,0 +1 @@ +export { default } from './InputLabel'; From f6aa1d4b0d8f7bf0f5c7e5a6126e2fb370b871d9 Mon Sep 17 00:00:00 2001 From: Eunbin Date: Wed, 4 Nov 2020 19:53:14 +0900 Subject: [PATCH 04/11] =?UTF-8?q?[feat]=20textarea=20atom=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20view=20=EA=B5=AC=ED=98=84=20-=20t?= =?UTF-8?q?extarea=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20view=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20-=20story=20test=20code=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1=20issue=20number:=20#76?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atoms/TextArea/TextArea.stories.tsx | 13 +++++++++++++ .../src/components/atoms/TextArea/TextArea.tsx | 16 ++++++++++++++++ client/src/components/atoms/TextArea/index.ts | 1 + 3 files changed, 30 insertions(+) create mode 100644 client/src/components/atoms/TextArea/TextArea.stories.tsx create mode 100644 client/src/components/atoms/TextArea/TextArea.tsx create mode 100644 client/src/components/atoms/TextArea/index.ts diff --git a/client/src/components/atoms/TextArea/TextArea.stories.tsx b/client/src/components/atoms/TextArea/TextArea.stories.tsx new file mode 100644 index 0000000..8d16ccd --- /dev/null +++ b/client/src/components/atoms/TextArea/TextArea.stories.tsx @@ -0,0 +1,13 @@ +import React from 'react'; +import { text } from '@storybook/addon-knobs'; +import Textarea from './TextArea'; + +export default { + title: 'Components/Textarea', + component: Textarea, +}; + +export const Default = () => { + const placeholder = text('placeholder', 'Leave a comment'); + return