Skip to content

Commit

Permalink
v1.0.0-alpha.8
Browse files Browse the repository at this point in the history
Merge pull request #47 from CMSgov/staging
  • Loading branch information
sawyerh authored May 2, 2017
2 parents 3563f4c + 448d489 commit 7fbfe05
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 7 deletions.
10 changes: 9 additions & 1 deletion packages/core/dist/components/TextField/TextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ var TextField = exports.TextField = function (_React$PureComponent) {
onChange: this.props.onChange,
onBlur: this.props.onBlur,
rows: rows,
type: this.props.multiline ? undefined : 'text',
type: this.props.multiline ? undefined : this.props.type,
value: this.props.value
})
);
Expand All @@ -98,6 +98,10 @@ var TextField = exports.TextField = function (_React$PureComponent) {
return TextField;
}(_react2.default.PureComponent);

TextField.defaultProps = {
type: 'text'
};

TextField.propTypes = {
/**
* Additional classes to be added to the root element
Expand Down Expand Up @@ -142,6 +146,10 @@ TextField.propTypes = {
* applicable if this is a multiline field
*/
rows: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),
/**
* Any valid `input` [type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
*/
type: _propTypes2.default.string,
/**
* Current value of the text field. Use this for a controlled component where
* you are maintaining its current state; otherwise, use the `defaultValue` property
Expand Down
2 changes: 1 addition & 1 deletion packages/core/dist/index.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cmsgov/design-system-core",
"version": "1.0.0-alpha.7",
"version": "1.0.0-alpha.8",
"publishConfig": {
"access": "public"
},
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/components/TextField/TextField.example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export default function() {
name='disabled_example'
value='Example value'
/>
<TextField
label='Password field'
name='disabled_example'
type='password'
/>

<div className='ds-base--inverse ds-u-margin-top--3 ds-u-padding--2'>
<TextField
Expand Down
10 changes: 9 additions & 1 deletion packages/core/src/components/TextField/TextField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,18 @@ export class TextField extends React.PureComponent {
onChange={this.props.onChange}
onBlur={this.props.onBlur}
rows={rows}
type={this.props.multiline ? undefined : 'text'}
type={this.props.multiline ? undefined : this.props.type}
value={this.props.value}
/>
</div>
);
}
}

TextField.defaultProps = {
type: 'text'
};

TextField.propTypes = {
/**
* Additional classes to be added to the root element
Expand Down Expand Up @@ -108,6 +112,10 @@ TextField.propTypes = {
PropTypes.number,
PropTypes.string
]),
/**
* Any valid `input` [type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
*/
type: PropTypes.string,
/**
* Current value of the text field. Use this for a controlled component where
* you are maintaining its current state; otherwise, use the `defaultValue` property
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/components/TextField/TextField.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ describe('TextField', function() {
expect(field.prop('type')).toBeUndefined();
});

it('is a password field', () => {
const data = shallowRender({ type: 'password' });
const field = data.wrapper.find('.ds-c-field').first();

expect(field.prop('type')).toBe('password');
});

it('is disabled', () => {
const data = shallowRender({ disabled: true });
const field = data.wrapper.find('.ds-c-field').first();
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cmsgov/design-system-docs",
"version": "1.0.0-alpha.7",
"version": "1.0.0-alpha.8",
"private": true,
"description": "Design system's documentation website",
"repository": "CMSgov/design-system",
Expand Down
4 changes: 4 additions & 0 deletions packages/docs/src/styles/base/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ code {
padding: 2px;
}

a code {
text-decoration: underline;
}

pre {
line-height: 1.4;
margin: 0;
Expand Down
3 changes: 1 addition & 2 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ npm publish

echo "${ORANGE}[TODO] Publish docs${NC}"

echo "${GREEN}Publishing Succeeded!${NC}"
git stash apply
echo "${GREEN}Publishing Succeeded!${NC}"

0 comments on commit 7fbfe05

Please sign in to comment.