Skip to content

Commit

Permalink
es6 & add github in package
Browse files Browse the repository at this point in the history
  • Loading branch information
bifot authored and Mike Engel committed Jan 3, 2018
1 parent dd31128 commit 8380429
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 31 deletions.
62 changes: 33 additions & 29 deletions README.md
Expand Up @@ -24,10 +24,10 @@ yarn add floating-label-react
import FloatingLabel from 'floating-label-react'

<FloatingLabel
id="email"
name="email"
placeholder="Your email"
type="email"
id='email'
name='email'
placeholder='Your email'
type='email'
/>
```

Expand All @@ -37,11 +37,11 @@ If you'd like a textarea instead, use the `element` prop.
import FloatingLabel from 'floating-label-react'

<FloatingLabel
id="email"
element="textarea"
name="email"
placeholder="Your email"
type="email"
id='email'
element='textarea'
name='email'
placeholder='Your email'
type='email'
/>
```

Expand All @@ -53,32 +53,36 @@ import FloatingLabel, {
focusStyles,
inputStyles,
labelStyles
} from "./floating-label";
} from 'floating-label-react'

const inputStyle = {
floating: Object.assign({}, floatingStyles, {
color: blue
}),
focus: Object.assign({}, focusStyles, {
borderColor: blue
}),
input: Object.assign({}, inputStyles, {
floating: {
...floatingStyles,
color: 'blue'
},
focus: {
...focusStyles,
borderColor: 'blue'
},
input: {
...inputStyles,
borderBottomWidth: 2,
borderBottomColor: black,
width: "100%"
}),
label: Object.assign({}, labelStyles, {
marginTop: "0.5em",
width: "100%"
})
};
borderBottomColor: 'black',
width: '100%'
},
label: {
...labelStyles,
marginTop: '.5em',
width: '100%'
}
}

<FloatingLabel
id="email"
name="email"
placeholder="Your email"
id='email'
name='email'
placeholder='Your email'
styles={inputStyle}
type="email"
type='email'
/>
```

Expand Down
12 changes: 10 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "floating-label-react",
"version": "0.1.0",
"version": "1.0.0",
"description": "A floating-label component using react without any dependencies",
"main": "dist/floating-label-react.js",
"jsnext:main": "dist/floating-label-react.es.js",
Expand Down Expand Up @@ -55,5 +55,13 @@
"add-module-exports",
"transform-class-properties"
]
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/mike-engel/floating-label-react.git"
},
"bugs": {
"url": "https://github.com/mike-engel/floating-label-react/issues"
},
"homepage": "https://github.com/mike-engel/floating-label-react#readme"
}

0 comments on commit 8380429

Please sign in to comment.