Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.4.1 CHANGELOG #1313

Merged
merged 10 commits into from
Nov 15, 2018
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lerna": "lerna bootstrap -- --no-optional --no-package-lock",
"link": "lerna run link",
"lint": "eslint packages/clay-*/src/*.js packages/clay-*/src/**/*.js 'examples/*/src/**/*.js' && npm run mcritic",
"mcritic": "mcritic packages/ --ignore '**/{browserslist-config-clay,clayui.com,generator-metal-clay,node_modules}/**'",
"mcritic": "mcritic packages/ --ignore '**/{browserslist-config-clay,clayui.com,generator-metal-clay,node_modules,ClayDropdownItem.soy}/**'",
"pa11y": "pa11y-ci ./packages/clay-*/demos/a11y.html",
"prettier": "prettier-eslint packages/clay-*/src/*.js packages/clay-*/src/**/*.js 'examples/*/src/**/*.js'",
"soy": "lerna run soy",
Expand Down Expand Up @@ -56,7 +56,7 @@
]
},
"workspaces": {
"packages":["packages/*"],
"packages": ["packages/*"],
"nohoist": ["**/clay-charts-shared"]
},
"resolutions": {
Expand Down
7 changes: 7 additions & 0 deletions packages/clay-charts-react/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
"env",
"stage-3",
"react"
]
}
24 changes: 11 additions & 13 deletions packages/clay-charts-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
"name": "clay-charts-react",
"version": "2.4.0",
"description": "Implementation of clay-charts in React.js",
"private": true,
"main": "lib/index.js",
"jsnext:main": "src/index.js",
"scripts": {
"compile": "./node_modules/.bin/babel -d lib/ src/ -s --ignore src/__tests__",
"prepublish": "npm run compile && npm run copyAssets",
"start": "webpack-dev-server --mode development",
"copyAssets": "ncp ./node_modules/clay-charts-shared/lib/svg lib/svg && ncp ./node_modules/clay-charts-shared/lib/css lib/css"
"copyAssets": "ncp ./node_modules/clay-charts-shared/lib/svg lib/svg && ncp ./node_modules/clay-charts-shared/lib/css lib/css",
"test": "jest"
},
"author": "Bryce Osterhaus",
"license": "BSD",
Expand All @@ -21,28 +23,24 @@
"react-dom": "^16.6.0"
},
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.4",
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-loader": "^7.0.0",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"css-loader": "^1.0.0",
"eslint-plugin-react": "^7.11.1",
"html-webpack-plugin": "^3.2.0",
"ncp": "^2.0.0",
"raf": "^3.4.1",
"react": "^16.6.0",
"react-billboardjs": "^1.4.3",
"react-dom": "^16.6.0",
"react-test-renderer": "^16.6.1",
"style-loader": "^0.23.1",
"webpack": "^4.22.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10"
},
"babel": {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Chart should render named chart without js exception 1`] = `
<div
className="bar-chart"
style={undefined}
/>
`;

exports[`Chart should render with type without js exception 1`] = `
<div
className="bar-chart"
style={undefined}
/>
`;
36 changes: 36 additions & 0 deletions packages/clay-charts-react/src/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'raf/polyfill'; // React depends on requestAnimationFrame

import React from 'react';
import TestRenderer from 'react-test-renderer';
import Chart, {BarChart} from '../index';

const COLUMNS = [['data1', 100, 20, 30], ['data2', 20, 70, 100]];

describe('Chart', function() {
it('should render named chart without js exception', () => {
const testRenderer = TestRenderer.create(
<BarChart
className="bar-chart"
data={{
columns: COLUMNS,
}}
/>
);

expect(testRenderer.toJSON()).toMatchSnapshot();
});

it('should render with type without js exception', async () => {
const testRenderer = TestRenderer.create(
<Chart
className="bar-chart"
data={{
columns: [['data1', 30], ['data2', 70]],
type: 'donut',
}}
/>
);

expect(testRenderer.toJSON()).toMatchSnapshot();
});
});
5 changes: 5 additions & 0 deletions packages/clay-charts-shared/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"env"
]
}
6 changes: 4 additions & 2 deletions packages/clay-charts-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "clay-charts-shared",
"version": "2.4.0",
"description": "",
"private": true,
"main": "lib/all.js",
"jsnext:main": "src/all.js",
"scripts": {
Expand All @@ -18,8 +19,9 @@
"metal": "^2.16.6"
},
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-preset-env": "^1.6.0",
"ncp": "^2.0.0",
"node-sass": "^4.9.4"
}
Expand Down
1 change: 0 additions & 1 deletion packages/clay-dropdown/src/ClayDropdownItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'clay-checkbox';
import 'clay-icon';
import 'clay-link';
import 'clay-radio';
import './ClayDropdownBase';
import ClayComponent from 'clay-component';
import defineWebComponent from 'metal-web-component';
import Soy from 'metal-soy';
Expand Down
2 changes: 0 additions & 2 deletions packages/clay-dropdown/src/all/dropdown.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import ClayActionsDropdown from '../ClayActionsDropdown';
import ClayCreationMenuDropdown from '../ClayCreationMenuDropdown';
import ClayDropdownBase from '../ClayDropdownBase';
import ClayDropdownItem from '../ClayDropdownItem';
import ClayDropdown from '../ClayDropdown';

export {
ClayActionsDropdown,
ClayCreationMenuDropdown,
ClayDropdown,
ClayDropdownBase,
ClayDropdownItem,
};
11 changes: 8 additions & 3 deletions packages/clay-dropdown/src/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ let itemShape = {
maxItems: Config.number(),
separator: Config.bool().value(false),
title: Config.string(),
type: Config.oneOf(['checkbox', 'group', 'item', 'radiogroup']).value(
'item'
),
type: Config.oneOf([
'checkbox',
'group',
'item',
'radio',
'radiogroup',
'separator',
]).value('item'),
};

const itemsValidator = Config.arrayOf(Config.shapeOf(itemShape));
Expand Down
Loading