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

chore(Tile): updated props for v11 #9628

Merged
merged 10 commits into from Sep 20, 2021
28 changes: 16 additions & 12 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Expand Up @@ -188,6 +188,7 @@ Map {
"disabled": Object {
"type": "bool",
},
"handleClick": [Function],
"hasIconOnly": Object {
"type": "bool",
},
Expand Down Expand Up @@ -6221,9 +6222,9 @@ Map {
"ClickableTile" => Object {
"defaultProps": Object {
"clicked": false,
"handleClick": [Function],
"handleKeyDown": [Function],
"light": false,
"onClick": [Function],
"onKeyDown": [Function],
},
"propTypes": Object {
"children": Object {
Expand All @@ -6232,18 +6233,20 @@ Map {
"className": Object {
"type": "string",
},
"handleClick": Object {
"type": "func",
},
"handleKeyDown": Object {
"type": "func",
},
"handleClick": [Function],
"handleKeyDown": [Function],
"href": Object {
"type": "string",
},
"light": Object {
"type": "bool",
},
"onClick": Object {
"type": "func",
},
"onKeyDown": Object {
"type": "func",
},
"rel": Object {
"type": "string",
},
Expand All @@ -6252,6 +6255,9 @@ Map {
"SelectableTile" => Object {
"defaultProps": Object {
"light": false,
"onChange": [Function],
"onClick": [Function],
"onKeyDown": [Function],
"selected": false,
"tabIndex": 0,
"title": "title",
Expand Down Expand Up @@ -6316,9 +6322,9 @@ Map {
"ExpandableTile" => Object {
"defaultProps": Object {
"expanded": false,
"handleClick": [Function],
"light": false,
"onBeforeClick": [Function],
"onClick": [Function],
"tabIndex": 0,
"tileCollapsedIconText": "Interact to expand Tile",
"tileExpandedIconText": "Interact to collapse Tile",
Expand All @@ -6335,9 +6341,7 @@ Map {
"expanded": Object {
"type": "bool",
},
"handleClick": Object {
"type": "func",
},
"handleClick": [Function],
"id": Object {
"type": "string",
},
Expand Down
10 changes: 9 additions & 1 deletion packages/react/src/components/Button/Button.js
Expand Up @@ -219,7 +219,7 @@ const Button = React.forwardRef(function Button(
onMouseLeave: composeEventHandlers([onMouseLeave, handleMouseLeave]),
onFocus: composeEventHandlers([onFocus, handleFocus]),
onBlur: composeEventHandlers([onBlur, handleBlur]),
onClick: composeEventHandlers([handleClick, onClick]),
onClick: composeEventHandlers([onClick, handleClick]),
sstrubberg marked this conversation as resolved.
Show resolved Hide resolved
...other,
...commonProps,
...otherProps,
Expand Down Expand Up @@ -262,6 +262,14 @@ Button.propTypes = {
*/
disabled: PropTypes.bool,

/**
* Deprecated in v11. Use 'onClick' instead.
*/
handleClick: deprecate(
sstrubberg marked this conversation as resolved.
Show resolved Hide resolved
PropTypes.func,
'The handleClick prop for Button has been deprecated in favor of onClick. It will be removed in the next major release.'
),

/**
* Specify if the button is an icon-only button
*/
Expand Down
6 changes: 0 additions & 6 deletions packages/react/src/components/Tile/Tile-story.js
Expand Up @@ -6,7 +6,6 @@
*/

import React from 'react';
import { action } from '@storybook/addon-actions';
import './tile-story.scss';

import {
Expand Down Expand Up @@ -51,8 +50,6 @@ const props = {
}),
selectable: () => ({
selected: boolean('Selected (selected)', false),
handleClick: action('handleClick'),
handleKeyDown: action('handleKeyDown'),
light: boolean('Light variant (light)', false),
disabled: boolean('Disabled (disabled)', false),
}),
Expand All @@ -63,11 +60,9 @@ const props = {
radioValues,
''
),
onChange: action('onChange'),
}),
radio: () => ({
name: text('Form item name (name in <RadioTile>)', 'tiles'),
onChange: action('onChange'),
light: boolean('Light variant (light)', false),
disabled: boolean('Disabled (disabled)', false),
}),
Expand All @@ -84,7 +79,6 @@ const props = {
),
tileCollapsedLabel: text('Collapsed icon text (tileCollapsedLabel)'),
tileExpandedLabel: text('Collapsed icon text (tileExpandedLabel)'),
handleClick: action('handleClick'),
light: boolean('Light variant (light)', false),
}),
};
Expand Down