From a18b82e8dbea12db9a1851960e36e085de0930be Mon Sep 17 00:00:00 2001 From: emyarod Date: Thu, 30 Jul 2020 18:25:36 -0500 Subject: [PATCH] docs(Switch): add explicit disabled prop type (#6598) * docs(Switch): add explicit disabled prop type * chore: update snapshots Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../react/__tests__/__snapshots__/PublicAPI-test.js.snap | 3 +++ packages/react/src/components/Switch/Switch.js | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index 0177758501ff..e06b6c8f528e 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -4555,6 +4555,9 @@ Map { "className": Object { "type": "string", }, + "disabled": Object { + "type": "bool", + }, "index": Object { "type": "number", }, diff --git a/packages/react/src/components/Switch/Switch.js b/packages/react/src/components/Switch/Switch.js index fb2b1f92b343..1326e03a2a5d 100644 --- a/packages/react/src/components/Switch/Switch.js +++ b/packages/react/src/components/Switch/Switch.js @@ -15,6 +15,7 @@ const { prefix } = settings; const Switch = React.forwardRef(function Switch(props, tabRef) { const { className, + disabled, index, name, onClick, @@ -43,6 +44,7 @@ const Switch = React.forwardRef(function Switch(props, tabRef) { onClick: handleClick, onKeyDown: handleKeyDown, className: classes, + disabled, }; return ( @@ -66,6 +68,11 @@ Switch.propTypes = { */ className: PropTypes.string, + /** + * Specify whether or not the Switch should be disabled + */ + disabled: PropTypes.bool, + /** * The index of your Switch in your ContentSwitcher that is used for event handlers. * Reserved for usage in ContentSwitcher