Skip to content

Commit a4e51d1

Browse files
authored
Merge pull request #110 from HelixDesignSystem/fixes01
Choice Tile Updates
2 parents 2d1fd71 + 0a86b26 commit a4e51d1

File tree

8 files changed

+35
-13
lines changed

8 files changed

+35
-13
lines changed

src/Checkbox/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import PropTypes from 'prop-types';
22
import React, { useRef, useEffect } from 'react';
33

4-
const Checkbox = ({ id, label, indeterminate, className, ...rest }) => {
4+
const Checkbox = ({ id, label, indeterminate, className, style, ...rest }) => {
55
const inputRef = useRef();
66
useEffect(() => {
77
inputRef.current.indeterminate = indeterminate;
@@ -20,6 +20,7 @@ const Checkbox = ({ id, label, indeterminate, className, ...rest }) => {
2020

2121
Checkbox.propTypes = {
2222
className: PropTypes.string,
23+
style: PropTypes.object,
2324
checked: PropTypes.bool,
2425
id: PropTypes.string.isRequired,
2526
disabled: PropTypes.bool,

src/ChoiceTile/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@ const ChoiceTile = ({
1717
size,
1818
subdued,
1919
title,
20+
style,
2021
...rest
2122
}) => {
2223
return (
23-
<label className={classNames({ hxChoice: true, className })}>
24+
<label className={classNames({ hxChoice: true }, className)} style={style}>
2425
<input
2526
checked={wcBool(checked)}
2627
disabled={disabled}
2728
invalid={invalid?.toString()}
2829
name={name}
2930
onChange={onChange}
3031
type="radio"
32+
{...rest}
3133
/>
32-
<hx-tile class={classNames({ hxSubdued: subdued, [SIZES[size]]: true })} {...rest}>
34+
<hx-tile class={classNames({ hxSubdued: subdued, [SIZES[size]]: true })}>
3335
<hx-icon type="checkmark"></hx-icon>
3436
{icon && (
3537
<div className="hx-tile-icon">
@@ -47,6 +49,7 @@ ChoiceTile.propTypes = {
4749
checked: PropTypes.bool.isRequired,
4850
children: PropTypes.node,
4951
className: PropTypes.string,
52+
style: PropTypes.object,
5053
disabled: PropTypes.bool,
5154
icon: PropTypes.string,
5255
invalid: PropTypes.bool,

src/ChoiceTile/stories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ storiesOf('Choice Tile', module).add('All Knobs', () => {
4646
icon={icon}
4747
name="choiceTileDemo"
4848
onChange={action('onChange')}
49-
style={{ width: 200 }}
49+
style={{ width: 200, float: 'left' }}
5050
title={title || defaultTitle}
5151
>
5252
{<p>{description || defaultDescription}</p>}
@@ -55,7 +55,7 @@ storiesOf('Choice Tile', module).add('All Knobs', () => {
5555
<ChoiceTile
5656
icon="bell"
5757
name="choiceTileDemo"
58-
style={{ marginLeft: 25, width: 200 }}
58+
style={{ marginLeft: 25, width: 200, float: 'left' }}
5959
title="Other Choice"
6060
>
6161
{<p>{defaultDescription}</p>}

src/Radio/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
33

4-
const Radio = ({ id, label, className, ...rest }) => {
4+
const Radio = ({ id, label, className, style, ...rest }) => {
55
return (
6-
<hx-radio-control class={className}>
6+
<hx-radio-control class={className} style={style}>
77
<input {...rest} id={id} type="radio" />
88
<label htmlFor={id}>
99
<hx-radio></hx-radio>
@@ -16,6 +16,7 @@ const Radio = ({ id, label, className, ...rest }) => {
1616
Radio.propTypes = {
1717
label: PropTypes.string.isRequired,
1818
className: PropTypes.string,
19+
style: PropTypes.object,
1920
checked: PropTypes.bool,
2021
id: PropTypes.string.isRequired,
2122
disabled: PropTypes.bool,

src/Search/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const Search = ({
2020
required,
2121
containerId,
2222
value,
23+
style,
2324
...rest
2425
}) => {
2526
/**
@@ -39,7 +40,7 @@ const Search = ({
3940
}, [value]);
4041

4142
return (
42-
<hx-search-control class={className} id={containerId}>
43+
<hx-search-control class={className} id={containerId} style={style}>
4344
<input
4445
id={id}
4546
value={value}
@@ -69,6 +70,7 @@ const Search = ({
6970

7071
Search.propTypes = {
7172
className: PropTypes.string,
73+
style: PropTypes.object,
7274
clearLabel: PropTypes.string,
7375
label: PropTypes.string,
7476
id: PropTypes.string.isRequired,

src/Select/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ const Select = ({
1111
onChange,
1212
optional,
1313
required,
14+
style,
1415
...rest
1516
}) => {
1617
return (
17-
<hx-select-control class={className}>
18+
<hx-select-control class={className} style={style}>
1819
<select id={id} disabled={disabled} onChange={onChange} required={required} {...rest}>
1920
{children}
2021
</select>
@@ -37,6 +38,7 @@ const Select = ({
3738
Select.propTypes = {
3839
children: PropTypes.node.isRequired,
3940
className: PropTypes.string,
41+
style: PropTypes.object,
4042
disabled: PropTypes.bool,
4143
id: PropTypes.string.isRequired,
4244
label: PropTypes.string,

src/Text/index.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@ import PropTypes from 'prop-types';
22
import React from 'react';
33
import classnames from 'classnames';
44

5-
const Text = ({ id, label, className, required, optional, children, prefix, suffix, ...rest }) => {
5+
const Text = ({
6+
id,
7+
label,
8+
className,
9+
required,
10+
optional,
11+
children,
12+
prefix,
13+
suffix,
14+
style,
15+
...rest
16+
}) => {
617
return (
7-
<hx-text-control class={className}>
18+
<hx-text-control class={className} style={style}>
819
<input {...rest} id={id} required={required} type="text" />
920
<label
1021
className={classnames({
@@ -26,6 +37,7 @@ const Text = ({ id, label, className, required, optional, children, prefix, suff
2637
Text.propTypes = {
2738
id: PropTypes.string.isRequired,
2839
className: PropTypes.string,
40+
style: PropTypes.object,
2941
children: PropTypes.node,
3042
optional: PropTypes.bool,
3143
disabled: PropTypes.bool,

src/TextArea/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import PropTypes from 'prop-types';
22
import React from 'react';
33
import classnames from 'classnames';
44

5-
const TextArea = ({ id, label, className, required, optional, children, ...rest }) => {
5+
const TextArea = ({ id, label, className, required, optional, children, style, ...rest }) => {
66
return (
7-
<hx-textarea-control class={className}>
7+
<hx-textarea-control class={className} style={style}>
88
<textarea {...rest} id={id} required={required} />
99
<label
1010
className={classnames({
@@ -23,6 +23,7 @@ const TextArea = ({ id, label, className, required, optional, children, ...rest
2323
TextArea.propTypes = {
2424
id: PropTypes.string.isRequired,
2525
className: PropTypes.string,
26+
style: PropTypes.object,
2627
children: PropTypes.node,
2728
optional: PropTypes.bool,
2829
disabled: PropTypes.bool,

0 commit comments

Comments
 (0)