Skip to content

Commit

Permalink
fix(TimePickerSelect): deprecate hideLabel to match spec (#5826)
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod authored and joshblack committed Apr 21, 2020
1 parent c2570d3 commit 693122c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5561,9 +5561,7 @@ Map {
"disabled": Object {
"type": "bool",
},
"hideLabel": Object {
"type": "bool",
},
"hideLabel": [Function],
"iconDescription": Object {
"isRequired": true,
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const props = {
}),
select: () => ({
disabled: boolean('Disabled (disabled in <TimePickerSelect>)', false),
hideLabel: boolean('No label (hideLabel in <TimePickerSelect>)', true),
labelText: text(
'Label text (labelText in <TimePickerSelect>)',
'Please select'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import React, { Component } from 'react';
import classNames from 'classnames';
import { ChevronDown16 } from '@carbon/icons-react';
import { settings } from 'carbon-components';
import deprecate from '../../prop-types/deprecate';

const { prefix } = settings;

Expand Down Expand Up @@ -53,7 +54,11 @@ export default class TimePickerSelect extends Component {
/**
* Specify whether the label should be hidden, or not
*/
hideLabel: PropTypes.bool,
hideLabel: deprecate(
PropTypes.bool,
'The `hideLabel` prop for `TimePickerSelect` is no longer needed and has ' +
'been deprecated. It will be removed in the next major release.'
),

/**
* Provide label text to be read by screen readers when interacting with the
Expand Down Expand Up @@ -89,6 +94,7 @@ export default class TimePickerSelect extends Component {
});

const labelClasses = classNames(`${prefix}--label`, {
// TODO: set to always be `true` after `hideLabel` is deprecated
[`${prefix}--visually-hidden`]: hideLabel,
});

Expand Down

0 comments on commit 693122c

Please sign in to comment.