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

gt - Add support for CustomInputs #444

Merged
merged 1 commit into from
Aug 16, 2018
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
3 changes: 3 additions & 0 deletions src/components/CustomInput.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import CustomInput from 'reactstrap/lib/CustomInput';

export default CustomInput;
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import CardTitle from './components/CardTitle';
import Col from './components/Col';
import Collapse from './components/Collapse';
import Container from './components/Container';
import CustomInput from './components/CustomInput';
import Dropdown from './components/Dropdown';
import DropdownItem from './components/DropdownItem';
import DropdownMenu from './components/DropdownMenu';
Expand Down Expand Up @@ -154,6 +155,7 @@ export {
Col,
Collapse,
Container,
CustomInput,
Dropdown,
DropdownItem,
DropdownMenu,
Expand Down
96 changes: 96 additions & 0 deletions stories/Input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import React from 'react';
import { CustomInput, FormLabelGroup } from '../src';
import { storiesOf } from '@storybook/react';
import { boolean, select, text } from '@storybook/addon-knobs';

storiesOf('Input', module).addWithInfo('Custom Input', () => (
<div>
<p>
For more customization and cross browser consistency, Bootstrap has custom form elements
to replace the browser defaults. They’re built on top of semantic and accessible markup,
so they’re safe replacements for default form controls.
</p>
<div className="mb-4">
<h3>Checkbox</h3>
<div>
<CustomInput
type="checkbox"
id="exampleCustomCheckbox"
label="Check this custom checkbox"
/>
<CustomInput
type="checkbox"
id="exampleCustomCheckbox2"
label="Or this one"
/>
<CustomInput
type="checkbox"
id="exampleCustomCheckbox3"
label="But not this disabled one"
disabled
/>
</div>
</div>
<div className="mb-4">
<h3>Radio</h3>
<div>
<CustomInput
type="radio"
id="exampleCustomRadio"
name="customRadio"
label="Select this custom radio"
/>
<CustomInput
type="radio"
id="exampleCustomRadio2"
name="customRadio"
label="Or this one"
/>
<CustomInput
type="radio"
id="exampleCustomRadio3"
label="But not this disabled one"
disabled
/>
</div>
</div>
<div className="mb-4">
<h3>Inline Checkbox</h3>
<div>
<CustomInput
type="checkbox"
id="exampleCustomInline"
label="An inline custom input"
inline
/>
<CustomInput
type="checkbox"
id="exampleCustomInline2"
label="and another one"
inline
/>
</div>
</div>
<div className="mb-4">
<h3>Select</h3>
<CustomInput type="select" id="exampleCustomSelect" name="customSelect">
<option value="">Select</option>
<option>Value 1</option>
<option>Value 2</option>
<option>Value 3</option>
<option>Value 4</option>
<option>Value 5</option>
</CustomInput>
</div>

<div className="mb-4">
<h3>File</h3>
<CustomInput
type="file"
id="exampleCustomFileBrowser"
name="customFile"
label="Choose Files to Add"
/>
</div>
</div>
));
1 change: 1 addition & 0 deletions stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import './Forms';
import './HasManyFields';
import './HelpBubble';
import './Icon';
import './Input';
import './InfoBox';
import './InputGroup';
import './LabelBadge';
Expand Down