1.6.4 • Published 7 years ago

@amber-engine/amber-components v1.6.4

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

Amber Components (js)

A wonderful place for all of our shareable components! :information_desk_person:

Getting Started

Install amber-components using yarn:

yarn add @amber-engine/amber-components

There's some additional webpack configuration necessary noted in the Webpack Configuration section.

Need a Button component that adheres to our brand standard?

import { components } from '@amber-engine/amber-components';
const { Button } = components;

Sweet!

Webpack Configuration

The amber-lib-js project should have all of its dependencies included in the project, but the library is simply transpiled by babel rather than completely bundlec by webpack (usually you'll be doing this in your project).

Make sure you have a way to load the following:

typenotes
scssFor loading styles referenced in shared components
svgFor loading icons!

Rather than including a specific path to resolve content included in amber-lib-js, you'll need to include these files via a regex in the Webpack loader.

Example (for SVG):

{
  test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.svg/],
  loader: require.resolve('url-loader'),
  exclude: [
    /icons/,
  ],
},
{
  test: /\.svg$/,
  include: [
    /icons/,
  ],
  use: [
    { loader: 'babel-loader' },
    {
      loader: 'react-svg-loader',
      options: { jsx: true },
    },
  ],
},

To see how things are being used in a real project, check out the Apollo project!

Components

Button

A standard, styled button.

Properties

nametypenotes
onClickfunctionFor loading styles referenced in shared components
typestringFor loading styles referenced in shared components. Can be ['login', 'export', 'import', 'importNew', 'logout']
classNamestring optionalThe class to apply to the button element.

Example:

<Button
  onClick={this.executeThing}
  type="import"
  className={stylesheet.extraBigText}
>
  Import!
</Button>

Dropdown

Form

Icon

IconButton

Modal

Pagination

RoundRectangle

SquareSelect

Table

1.6.4

7 years ago

1.6.3

7 years ago

1.6.2

7 years ago

1.5.0

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.3

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.3

7 years ago