Skip to content

Commit

Permalink
fix(Select): inline prop showed the input two times
Browse files Browse the repository at this point in the history
  • Loading branch information
Utzel-Butzel committed Dec 3, 2019
1 parent f3d6530 commit b89f8c6
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 23 deletions.
1 change: 0 additions & 1 deletion src/components/List/_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
@import '../../globals/scss/typography';
@import '../../globals/scss/helper-mixins';
@import '../../globals/scss/import-once';
@import '../../globals/scss/css--reset';

@include exports('list') {
.#{$prefix}--list {
Expand Down
30 changes: 28 additions & 2 deletions src/components/RadioButtonGroup/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## Use with React Final Form or Redux Form
## Use with React Final Form (Redux form)

Use a container with a .wfp--radio-button-group className instead
Add `controlled={false}` to allow final-form to hand the state.

```js
<RadioButtonGroup
controlled={false}
labelText="Tracking frequency"
helperText="How often the position will be updated">
<Field
component={ReduxFormWrapper}
inputComponent={RadioButton}
id="radioButton-1"
name="radioButton"
value={5}
labelText="Radiobutton 1"
type="radio"
/>
<Field
component={ReduxFormWrapper}
inputComponent={RadioButton}
id="radioButton-2"
name="radioButton"
value={10}
labelText="Radiobutton 2"
type="radio"
/>
</RadioButtonGroup>
```
18 changes: 2 additions & 16 deletions src/components/Select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,9 @@ const Select = React.forwardRef(
<div className={`${prefix}--form-item`}>
<div className={selectClasses}>
{labelTextComponent}
{!inline && helper}
{inline && (
<>
<div className={`${prefix}--select-input--inline__wrapper`}>
<div
className={`${prefix}--select-input__wrapper`}
data-invalid={invalid || null}>
{input}
</div>
{error}
</div>
{helper}
</>
)}
{helper}
{input}
{inline && helper}
{!inline && error}
{error}
</div>
</div>
);
Expand Down
4 changes: 4 additions & 0 deletions src/components/Story/_story.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
margin-top: $spacing-2xl;
}

ul + h2 {
margin-top: $spacing-xl;
}

p + h3 {
margin-top: $spacing-2xl;
}
Expand Down
8 changes: 5 additions & 3 deletions src/documentation/Colours/_colours.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
$css--reset: false;
@import '../../globals/scss/vars';
@import '../../globals/scss/theme';
@import '../../globals/scss/colors';
@import '../../globals/scss/typography';
@import '../../globals/scss/spacing';
@import '../../globals/scss/helper-mixins';
/*@import '../../globals/scss/theme';
@import '../../globals/scss/colors';
@import '../../globals/scss/typography';
*/
.color--list {
display: flex;
flex-wrap: wrap;
Expand Down
27 changes: 26 additions & 1 deletion src/documentation/Credits-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Page from './Page';

storiesOf('Design|Getting started', module)
.addParameters({ options: { showPanel: false, isToolshown: false } })
.add('Credits', () => (
.add('Credits & Development', () => (
<Page
title="Credits & License"
subTitle="Introduction to the new WFP UI Kit">
Expand Down Expand Up @@ -45,5 +45,30 @@ storiesOf('Design|Getting started', module)
</Link>
</li>
</ul>
<h2>Contributing</h2>
<p>
Development is made on a GitHub repository. Feel free create an Issue or
submit a pull request.{' '}
<Link href="https://github.com/wfp/ui" target="_blank">
Project on GitHub
</Link>
</p>
<br />
<iframe
title="GitHub Like"
src="https://ghbtns.com/github-btn.html?user=wfp&repo=ui&type=star&count=true&size=large"
frameBorder="0"
scrolling="0"
width="160px"
height="30px"
/>
<h3>NPM</h3>
<p>
npm is a package manager for the JavaScript programming language. All
versions of the UI Kit will be published there.{' '}
<Link href="https://www.npmjs.com/package/@wfp/ui" target="_blank">
View package on npm
</Link>
</p>
</Page>
));
File renamed without changes.

0 comments on commit b89f8c6

Please sign in to comment.