React component wrappers for the Atlassian User Interface (AUI) framework.


Keywords
aui, aui-react, atlassian, react, component, jira, confluence, bitbucket, stash, bamboo
License
Apache-2.0
Install
npm install aui-react@1.2.1

Documentation

Coverage Status

Javascript behaviour and styles are provided by AUI. You should include the relevant AUI files based on the AUI documentation.

Usage

ES6 (recommended)

import React, { Component } from 'react';

// You could also use "import AUI from 'aui-react';", but this would increase your bundle size in most cases.
// By consuming the component directly, you ensure only the component and its dependencies are included.
import AUIFontIcon from 'aui-react/lib/AUIFontIcon';

export default class MyApproveIcon extends Component {
    return <AUIFontIcon type="approve" />;
}

CommonJS/Node

var AUI = require('aui-react');

var MyApproveIcon = React.createClass({
    return <AUI.FontIcon type="approve" />;
});

module.exports = MyApproveIcon;

Global

<div id="container"></div>
<script src="node_modules/aui-react/dist/aui-react.js"></script>
<script type="text/babel">
    ReactDOM.render(<AUI.FontIcon type="approve" />, document.getElementById('container'));
</script>

Development Guide

Contributions are encouraged!

UI testing

Option 1 (recommended).

  • In aui-react, run npm link . and npm run watch.
  • Link aui-react to your application using npm link aui-react.

Option 2.

  • Each time you want to test the changes, use npm install path/to/aui-react to install them to your application.

Unit testing

$ npm test

Running linter

$ npm run lint

Checking test coverage

$ npm run coverage

Releasing

Releases can be prepared by anyone with access to the code.

Simply bump the version number following semantic versioning and make a commit to a branch

All you need to do is push the commit up and make a pull request, one of the admins will merge it and publish a release.

Components

Avatars

<AUI.Avatar
    src="{string}"
    [size="xsmall|small|medium|large|xlarge|xxlarge|xxxlarge"]
    [isProject={boolean=false}]
/>

AUI.Avatar

Application header

<AUI.ApplicationHeader
    product="aui|bamboo|bitbucket|confluence|crowd|fecru|hipchat|jira|stash"
    [primaryContent={Component}]
    [secondaryContent={Component}]
/>

AUI.ApplicationHeader

Buttons

<AUI.Button
    [type="link|primary|subtle"]
    [icon={string}]
/>

AUI.Button

Icons

<AUI.Icon
    icon={string}
/>

AUI.Icons

Tables

<AUI.table>
    <thead>
        <tr>
            <th>...</th>
            ...
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>...</td>
            ...
        </tr>
    </tbody>
</AUI.table>

AUI.Icons

Tabs

<AUI.Tabs>
    <AUI.Tab label="First Tab" id="first-tab">
        <p>Content of the <strong>first</strong> tab</p>
    </AUI.Tab>

    <AUI.Tab label={(<span>Second Tab <AUI.Badge text="123" /></span>)} id="second-tab">
        You can pass components as a tab label and to the tab content.
        It simply <AUI.Lozenge type="success">works</AUI.Lozenge>
    </AUI.Tab>

    <AUI.Tab label="Last tab" id="last-tab" isActive>
        <p>The last tab will be an active tab</p>
    </AUI.Tab>
</AUI.Tabs>

AUI.Tabs