From 5bb7c1d19bb23258f2ece68ef63eff13a106cff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Sun, 11 Dec 2016 23:43:41 +0000 Subject: [PATCH] convert input, modal, notification and pagination --- ui/src/components/input/index.js | 61 +++++++-- ui/src/components/input/style.css | 33 ----- ui/src/components/modal/index.js | 166 +++++++++++------------ ui/src/components/modal/style.css | 43 ------ ui/src/components/notification/index.js | 82 ++++++----- ui/src/components/notification/style.css | 54 -------- ui/src/components/pagination/index.js | 2 +- ui/src/components/pagination/style.css | 50 ------- ui/src/index.js | 6 +- ui/src/shared/match.js | 35 ++++- ui/stories/index.js | 40 ++++++ 11 files changed, 253 insertions(+), 319 deletions(-) delete mode 100644 ui/src/components/input/style.css delete mode 100644 ui/src/components/modal/style.css delete mode 100644 ui/src/components/notification/style.css delete mode 100644 ui/src/components/pagination/style.css diff --git a/ui/src/components/input/index.js b/ui/src/components/input/index.js index ec0f0ce6..60f21fce 100644 --- a/ui/src/components/input/index.js +++ b/ui/src/components/input/index.js @@ -1,6 +1,45 @@ -const classNames = require('classnames'); +const composers = require('../../shared/composers'); +const constants = require('../../shared/constants'); +const fns = require('../../shared/functions'); const React = require('react'); -const styles = require('./style.css'); +const Styled = require('styled-components'); + +const { + baseBox +} = composers; + +const { + colors +} = constants; + +const { + rndId +} = fns; + +const { + default: styled +} = Styled; + +const StyledLabel = styled.label` + color: #464646; +`; + +const StyledInput = styled.input` + background: ${colors.background}; + display: block; + height: 50px; + padding-left: 15px; + padding-right: 15px; + visibility: visible; + width: 100%; + + ${baseBox()} + + :focus { + border-color: ${colors.borderSelected}; + outline: none; + } +`; const Input = ({ autoComplete, @@ -9,7 +48,7 @@ const Input = ({ className, disabled = false, form, - id, + id = rndId(), inputMode, label, list, @@ -29,23 +68,17 @@ const Input = ({ const _label = label || children; const _children = label && children ? children : null; - const cn = classNames( - className, - styles['input-group'] - ); - - const labelledby = `${styles.label}-label`; + const labelledby = `${rndId()}-label`; return ( -
-