Skip to content

Commit

Permalink
Added examples and bumped devDep on ffe-form.
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Hermansen committed Aug 14, 2017
1 parent cfd799d commit d8db112
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.4.1
* Added examples for local testing.
* Bumped devDep on `ffe-form` to `7.0.2` to fix styling of invalid.

## 4.4.0
* Support `aria-invalid` as a prop in addition to `invalid`.

Expand Down
30 changes: 30 additions & 0 deletions examples/checkbox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react';
import {render} from 'react-dom';
import Checkbox from '../src/checkbox';

require('./example.less');

const heading = document.createElement('h1');
heading.textContent = 'Checkbox';
heading.className = 'ffe-h1';
document.body.appendChild(heading);

const checkboxDOM = document.createElement('section');
document.body.appendChild(checkboxDOM);

render(
<div className="ffe-input-group">
<Checkbox
label="This is an example checkbox"
name="justACheckbox"
inline={ false }
/>

<Checkbox
label="This is an example checkbox with error"
name="anotherCheckbox"
inline={ false }
invalid={ true }
/>
</div>
, checkboxDOM);
12 changes: 12 additions & 0 deletions examples/example.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@import "../node_modules/ffe-core/less/ffe.less";
@import "../node_modules/ffe-form/less/form.less";
@font-url: "../node_modules/ffe-core/fonts";

body {
margin: 2.5%;
font-family: "MuseoSansRounded-500", arial, sans-serif;
}

.ffe-input-group {
margin-bottom: 3em;
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "ffe-checkbox-react",
"version": "4.4.0",
"version": "4.4.1",
"main": "lib/checkbox.js",
"scripts": {
"build": "babel -d lib/. --ignore=*.test.js src/. && npm run example",
"watch": "onchange 'src/**.js' -- npm run build",
"lint": "eslint src/.",
"start": "budo examples/checkbox.js --open --live --title \"FFE Checkbox React\" -- -t [ babelify --presets [ es2015 react ] ] -t node-lessify",
"test:nsp": "nsp check",
"test:spec": "mocha --require babel-register src/**/*.test.js",
"test": "npm run test:spec && npm run test:nsp",
Expand All @@ -16,7 +17,7 @@
"postpublish": "git tag ${npm_package_version} && git push --tags"
},
"peerDependencies": {
"ffe-form": "1.x - 6.x"
"ffe-form": "1.x - 7.x"
},
"dependencies": {
"classnames": "^2.2.5",
Expand All @@ -30,6 +31,8 @@
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.5.0",
"babel-register": "^6.4.3",
"babelify": "^7.3.0",
"budo": "8.3.0",
"chai": "^3.5.0",
"enzyme": "2.2.0",
"eslint": "^3.12.2",
Expand All @@ -38,9 +41,10 @@
"eslint-plugin-jsx-a11y": "^3.0.2",
"eslint-plugin-react": "^6.8.0",
"ffe-core": "^9.2.0",
"ffe-form": "^5.1.0",
"ffe-form": "7.0.2",
"mocha": "^2.4.5",
"mocha-tap13": "0.0.3",
"node-lessify": "^0.1.4",
"nsp": "^2.2.0",
"react": "^15.3.1",
"react-addons-test-utils": "^15.0.1",
Expand Down

0 comments on commit d8db112

Please sign in to comment.