Skip to content
Closed
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: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
npm-debug.log
lib
.out
.out
.vscode
2,970 changes: 2,282 additions & 688 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
"eslint-plugin-react": "^6.4.1",
"eslint-plugin-standard": "^3.0.1",
"jest": "^19.0.2",
"patternfly": "~3.3",
"prettier": "^1.3.1",
"prop-types": "^15.5.10",
"react": "^15.4.2",
"react-dom": "^15.5.0",
"react-test-renderer": "^15.5.0",
Expand All @@ -68,8 +70,8 @@
"prepublish": "npm run build",
"test": "npm run lint && jest",
"test:watch": "jest --watchAll",
"storybook": "start-storybook -c storybook -p 6006",
"build-storybook": "build-storybook -c storybook -o .out",
"storybook": "start-storybook -c storybook -s ./public -p 6006",
"build-storybook": "build-storybook -c storybook -s ./public -o .out",
"storybook:deploy": "storybook-to-ghpages",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
Expand Down
17 changes: 17 additions & 0 deletions public/css/patternfly-react.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
Important: The CSS defined here should be temporary until it is
entirely contributed upstream to Patternfly / Patternfly CSS.

https://github.com/patternfly/patternfly
https://github.com/patternfly/patternfly-css
*/
.pf-tabrow {
display: flex;
flex-wrap: wrap-reverse;
}
.pf-tabrow > li {
float: none;
}
.pf-tabrow > .pf-tabrow-contents {
margin-left: auto;
}
87 changes: 87 additions & 0 deletions public/img/brand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/Alert/Alert.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ClassNames from 'classnames'
import React from 'react'
import PropTypes from 'prop-types'
import { ALERT_TYPES } from '../common/constants'

/**
* Alert Component for Patternfly React
Expand Down Expand Up @@ -42,8 +43,7 @@ Alert.propTypes = {
/** callback when alert is dismissed */
onDismiss: PropTypes.func,
/** the type of alert */
type: PropTypes.oneOf(['danger', 'error', 'warning', 'success', 'info'])
.isRequired,
type: PropTypes.oneOf(ALERT_TYPES).isRequired,
/** children nodes */
children: PropTypes.node
}
Expand Down
4 changes: 3 additions & 1 deletion src/Alert/Alert.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ stories.addDecorator(

stories.addWithInfo('with danger', `This is the Alert with danger type.`, () =>
<Alert type="danger" onDismiss={action('onDismiss')}>
<span>{text('Label', 'Danger Will Robinson!')}</span>
<span>
{text('Label', 'Danger Will Robinson!')}
</span>
</Alert>
)

Expand Down
24 changes: 8 additions & 16 deletions src/Button/Button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ const stories = storiesOf('Button', module)

const description = (
<p>
This component is based on React Bootstrap Button component. See
{' '}
This component is based on React Bootstrap Button component. See{' '}
<a href="https://react-bootstrap.github.io/components.html#buttons">
React Bootstrap Docs
</a>
{' '}
</a>{' '}
for complete Button component documentation.
</p>
)
Expand All @@ -29,21 +27,15 @@ stories.addDecorator(
stories.addWithInfo('Button', '', () =>
<div>
<p>
<Button>Default Button</Button>
{' '}
<Button bsStyle="primary">Primary Button</Button>
{' '}
<Button bsStyle="danger">Danger Button</Button>
{' '}
<Button>Default Button</Button>{' '}
<Button bsStyle="primary">Primary Button</Button>{' '}
<Button bsStyle="danger">Danger Button</Button>{' '}
<Button bsStyle="link">Link Button</Button>
</p>
<p>
<Button bsSize="large">Large Button</Button>
{' '}
<Button>Default Button</Button>
{' '}
<Button bsSize="small">Small Button</Button>
{' '}
<Button bsSize="large">Large Button</Button>{' '}
<Button>Default Button</Button>{' '}
<Button bsSize="small">Small Button</Button>{' '}
<Button bsSize="xsmall">Extra Small Button</Button>
</p>
</div>
Expand Down
19 changes: 17 additions & 2 deletions src/DropdownKebab/DropdownKebab.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
import { Dropdown } from 'react-bootstrap'
import ClassNames from 'classnames'
import React from 'react'
import PropTypes from 'prop-types'

const DropdownKebab = ({ children, id, pullRight }) => {
/**
* DropdownKebab Component for Patternfly React
*/
const DropdownKebab = ({ className, children, id, pullRight }) => {
const kebabClass = ClassNames(
{
'dropdown-kebab-pf': true
},
className
)
return (
<Dropdown className="dropdown-kebab-pf" id={id} pullRight={pullRight}>
<Dropdown className={kebabClass} id={id} pullRight={pullRight}>
<Dropdown.Toggle bsStyle="link" noCaret>
<span className="fa fa-ellipsis-v" />
</Dropdown.Toggle>
Expand All @@ -15,8 +25,13 @@ const DropdownKebab = ({ children, id, pullRight }) => {
)
}
DropdownKebab.propTypes = {
/** additional kebab dropdown classes */
className: PropTypes.string,
/** children nodes */
children: PropTypes.node,
/** kebab dropdown id */
id: PropTypes.string.isRequired,
/** menu right aligned */
pullRight: PropTypes.bool
}
export default DropdownKebab
3 changes: 1 addition & 2 deletions src/DropdownKebab/DropdownKebab.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ stories.addWithInfo(
`pullRight prop is used to align the dropdown to the right.`,
() =>
<div>
<Button bsStyle="primary">Some Button</Button>
{' '}
<Button bsStyle="primary">Some Button</Button>{' '}
<Button>Another Button</Button>
<DropdownKebab id="myKebab" pullRight={boolean('Right aligned', false)}>
<MenuItem>Action</MenuItem>
Expand Down
12 changes: 4 additions & 8 deletions src/MenuItem/MenuItem.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ const stories = storiesOf('MenuItem', module)

const description = (
<p>
This component is based on React Bootstrap MenuItem component.
This component represents a menu item in a dropdown. See
{' '}
This component is based on React Bootstrap MenuItem component. This
component represents a menu item in a dropdown. See{' '}
<a href="https://react-bootstrap.github.io/components.html#menu-items">
React Bootstrap Docs
</a>
{' '}
</a>{' '}
for complete MenuItem component documentation.
</p>
)
Expand All @@ -35,9 +33,7 @@ stories.addWithInfo('MenuItem', '', () =>
<MenuItem header>Header</MenuItem>
<MenuItem>link</MenuItem>
<MenuItem disabled>disabled</MenuItem>
<MenuItem title="See? I have a title.">
link with title
</MenuItem>
<MenuItem title="See? I have a title.">link with title</MenuItem>
<MenuItem
eventKey={1}
href="#someHref"
Expand Down
9 changes: 9 additions & 0 deletions src/Navbar/Nav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Nav as BsNav } from 'react-bootstrap'
import React from 'react'

/**
* Nav Component for Patternfly React
*/
const Nav = props => <BsNav {...props} />

export default Nav
9 changes: 9 additions & 0 deletions src/Navbar/NavDropdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { NavDropdown as BsNavDropdown } from 'react-bootstrap'
import React from 'react'

/**
* NavDropdown Component for Patternfly React
*/
const NavDropdown = props => <BsNavDropdown {...props} />

export default NavDropdown
9 changes: 9 additions & 0 deletions src/Navbar/NavItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { NavItem as BsNavItem } from 'react-bootstrap'
import React from 'react'

/**
* NavItem Component for Patternfly React
*/
const NavItem = props => <BsNavItem {...props} />

export default NavItem
76 changes: 76 additions & 0 deletions src/Navbar/Navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import React from 'react'
import PropTypes from 'prop-types'

/**
* Navbar Component for Patternfly React
*/
export const Navbar = props => {
return (
<nav {...props} role="navigation">
{props.children}
</nav>
)
}
Navbar.propTypes = {
/** children nodes */
children: PropTypes.node
}

/**
* NavbarHeader Component for Patternfly React
*/
export const NavbarHeader = props => {
return (
<div className="navbar-header">
{props.children}
</div>
)
}
NavbarHeader.propTypes = {
/** children nodes */
children: PropTypes.node
}

/**
* NavbarBrand Component for Patternfly React
*/
export const NavbarBrand = props => {
return (
<a href="/" className="navbar-brand">
{props.children}
</a>
)
}
NavbarBrand.propTypes = {
/** children nodes */
children: PropTypes.node
}

/**
* NavbarToggle Component for Patternfly React
*/
export const NavbarToggle = () => {
return (
<button className="navbar-toggle">
<span className="sr-only">Toggle navigation</span>
<span className="icon-bar" />
<span className="icon-bar" />
<span className="icon-bar" />
</button>
)
}

/**
* NavbarCollapse Component for Patternfly React
*/
export const NavbarCollapse = props => {
return (
<div className="collapse navbar-collapse">
{props.children}
</div>
)
}
NavbarCollapse.propTypes = {
/** children nodes */
children: PropTypes.node
}
Loading