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

fix(Input): update supported values for the size prop #3444

Merged
merged 1 commit into from
Feb 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/elements/Input/Input.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface StrictInputProps {
onChange?: (event: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void

/** An Input can vary in size. */
size?: SemanticSIZES
size?: 'mini' | 'small' | 'large' | 'big' | 'huge' | 'massive'

/** An Input can receive focus. */
tabIndex?: number | string
Expand Down
3 changes: 1 addition & 2 deletions src/elements/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
getUnhandledProps,
handleRef,
partitionHTMLProps,
SUI,
useKeyOnly,
useValueAndKey,
} from '../../lib'
Expand Down Expand Up @@ -86,7 +85,7 @@ class Input extends Component {
onChange: PropTypes.func,

/** An Input can vary in size. */
size: PropTypes.oneOf(SUI.SIZES),
size: PropTypes.oneOf(['mini', 'small', 'large', 'big', 'huge', 'massive']),

/** An Input can receive focus. */
tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
Expand Down
11 changes: 9 additions & 2 deletions test/specs/elements/Input/Input-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'

import Input from 'src/elements/Input/Input'
import { htmlInputProps, SUI } from 'src/lib'
import { htmlInputProps } from 'src/lib'
import * as common from 'test/specs/commonTests'
import { sandbox } from 'test/utils'

Expand Down Expand Up @@ -95,7 +95,14 @@ describe('Input', () => {
common.propKeyOnlyToClassName(Input, 'transparent')
common.propKeyOnlyToClassName(Input, 'icon')

common.propValueOnlyToClassName(Input, 'size', SUI.SIZES)
common.propValueOnlyToClassName(Input, 'size', [
'mini',
'small',
'large',
'big',
'huge',
'massive',
])

it('renders with conditional children', () => {
shallow(
Expand Down