From fa8d828d613889c19844f674739f3c5cd63d0fdb Mon Sep 17 00:00:00 2001 From: Conor Cafferkey Date: Mon, 28 Jan 2019 12:24:27 +0100 Subject: [PATCH 1/5] Fixes #792 --- src/Checkbox/index.jsx | 13 +++++++++++-- src/utils/index.js | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Checkbox/index.jsx b/src/Checkbox/index.jsx index d16160c3..b783c695 100644 --- a/src/Checkbox/index.jsx +++ b/src/Checkbox/index.jsx @@ -55,8 +55,15 @@ export default class Checkbox extends React.Component * Label content (string) */ label : PropTypes.string, - onClick : PropTypes.func, - onChange : PropTypes.func, + /** + * change callback prop + */ + onChange : PropTypes.func, + /** + * click callback prop + */ + onClick : PropTypes.func, + }; static defaultProps = @@ -69,6 +76,8 @@ export default class Checkbox extends React.Component isChecked : undefined, isDisabled : false, label : undefined, + onChange : undefined, + onClick : undefined, }; static displayName = 'Checkbox'; diff --git a/src/utils/index.js b/src/utils/index.js index a3254e43..1e4f5e14 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -114,11 +114,13 @@ function createEventHandler( func, customizer ) } else if ( type === 'change' ) { - if ( typeof target.checked === 'boolean' ) + const inputType = target.getAttribute( 'type' ); + console.log( target, inputType ) + if ( inputType === 'checkbox' || inputType === 'radio' ) { eventPayload.isChecked = target.checked; } - else if ( target.value ) + else { eventPayload.value = target.value; } From b2aeaa2c3f554a6da119aa56a75f26fcc12255e1 Mon Sep 17 00:00:00 2001 From: Conor Cafferkey Date: Mon, 28 Jan 2019 12:26:07 +0100 Subject: [PATCH 2/5] Fixes onChange payload for inputs + checkboxes #792 --- src/utils/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/index.js b/src/utils/index.js index 1e4f5e14..50e5c3de 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -115,7 +115,6 @@ function createEventHandler( func, customizer ) else if ( type === 'change' ) { const inputType = target.getAttribute( 'type' ); - console.log( target, inputType ) if ( inputType === 'checkbox' || inputType === 'radio' ) { eventPayload.isChecked = target.checked; From 3a60d877f5189863435fd1d300ac6ba7e9d358e1 Mon Sep 17 00:00:00 2001 From: Conor Cafferkey Date: Mon, 28 Jan 2019 12:29:27 +0100 Subject: [PATCH 3/5] Remove overflow: hidden & Co. from grid.css #788 --- src/Grid/grid.css | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Grid/grid.css b/src/Grid/grid.css index 78cb290e..4b3a6cd8 100644 --- a/src/Grid/grid.css +++ b/src/Grid/grid.css @@ -18,14 +18,7 @@ .default { - display: grid; - max-width: 100%; - - > * - { - overflow: hidden; - min-width: 0; - } + display: grid; } From dea61582e906e2eec876ea7656022002e5a19ee0 Mon Sep 17 00:00:00 2001 From: Conor Cafferkey Date: Mon, 28 Jan 2019 12:45:10 +0100 Subject: [PATCH 4/5] Update Grid defaults #796 --- src/Grid/README.md | 8 ++++---- src/Grid/index.jsx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Grid/README.md b/src/Grid/README.md index 7b4975ef..9420f9c4 100644 --- a/src/Grid/README.md +++ b/src/Grid/README.md @@ -108,8 +108,8 @@ The props accept one of four values: `"S"`, `"M"` (default), `"L"` and `"none"` #### Horizontal alignment -The Grid’s `justify` prop accepts one of four values: `"stretch"`, -`"start"` (default), `"end"` and `"center"`. +The Grid’s `justify` prop accepts one of four values: `"stretch"` (default), +`"start"`, `"end"` and `"center"`. Aligns grid items along the inline (row) axis. This value applies to all grid items inside the container. @@ -117,8 +117,8 @@ items inside the container. #### Vertical alignment -The Grid’s `align` prop accepts one of four values: `"stretch"`, `"start"` -(default), `"center"` and `"end"`. +The Grid’s `align` prop accepts one of four values: `"stretch"` (default), +`"start"`, `"center"` and `"end"`. Aligns grid items along the block (column) axis. This value applies to all grid items inside the container. diff --git a/src/Grid/index.jsx b/src/Grid/index.jsx index 517c6c37..7e79280e 100644 --- a/src/Grid/index.jsx +++ b/src/Grid/index.jsx @@ -93,7 +93,7 @@ export default class Grid extends React.Component static defaultProps = { - align : 'start', + align : 'stretch', autoCols : undefined, autoFlow : 'row', autoRows : undefined, @@ -104,7 +104,7 @@ export default class Grid extends React.Component cssMap : undefined, customColumns : undefined, customRows : undefined, - justify : 'start', + justify : 'stretch', rowGap : 'M', rows : undefined, }; @@ -129,8 +129,8 @@ export default class Grid extends React.Component { ...attachEvents( this.props ) } className = { cssMap.main } style = { { - gridAutoColumns : autoCols || '1fr', - gridAutoRows : autoRows || '1fr', + gridAutoColumns : autoCols, + gridAutoRows : autoRows, gridTemplateColumns : customColumns || `repeat( ${columns}, 1fr )`, gridTemplateRows : customRows || `repeat( ${rows}, 1fr )`, From b6376f9e410abda0daaaca4822f7935ce47b4962 Mon Sep 17 00:00:00 2001 From: Conor Cafferkey Date: Mon, 28 Jan 2019 14:07:26 +0100 Subject: [PATCH 5/5] Release 10.0.0-alpha.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0e7c8744..8010d2d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nessie-ui", - "version": "10.0.0-alpha.0", + "version": "10.0.0-alpha.1", "description": "dunnhumby media UI component library", "author": "Sociomantic Labs GmbH", "main": "dist",